Only delete autocmds for the current buffer with the group name

pull/864/head
Francis Belanger 1 month ago
parent f45cec078c
commit a37febf80b

@ -542,9 +542,12 @@ require('lazy').setup({
vim.api.nvim_create_autocmd('LspDetach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
callback = function()
callback = function(event)
vim.lsp.buf.clear_references()
vim.api.nvim_del_augroup_by_name 'kickstart-lsp-highlight'
local cmds = vim.api.nvim_get_autocmds { group = 'kickstart-lsp-highlight', buffer = event.buf }
for _, cmd in ipairs(cmds) do
vim.api.nvim_del_autocmd(cmd.id)
end
end,
})

Loading…
Cancel
Save