From f40672be99356d453fba6e2b4239c1876cd1b9dd Mon Sep 17 00:00:00 2001 From: phanium <91544758+phanen@users.noreply.github.com> Date: Sat, 11 Oct 2025 12:09:51 +0800 Subject: [PATCH] fix(undotree): clear autocmd correctly #36124 Problem: nvim_clear_autocmds clear some other autocmd unexpectedly Solution: clear it correctly --- runtime/pack/dist/opt/nvim.undotree/lua/undotree.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/runtime/pack/dist/opt/nvim.undotree/lua/undotree.lua b/runtime/pack/dist/opt/nvim.undotree/lua/undotree.lua index d7eb00ce9e..724fdae31a 100644 --- a/runtime/pack/dist/opt/nvim.undotree/lua/undotree.lua +++ b/runtime/pack/dist/opt/nvim.undotree/lua/undotree.lua @@ -371,9 +371,7 @@ function M.open(opts) vim.api.nvim_win_set_cursor(w, { vim.api.nvim_buf_line_count(b), 0 }) - local group = vim.api.nvim_create_augroup('nvim.undotree', { clear = false }) - vim.api.nvim_clear_autocmds({ buffer = b }) - vim.api.nvim_clear_autocmds({ buffer = buf }) + local group = vim.api.nvim_create_augroup('nvim.undotree', {}) vim.api.nvim_win_call(w, function() vim.cmd.syntax('region Comment start="(" end=")"')