Only delete autocmds for the current buffer with the group name
This commit is contained in:
parent
f45cec078c
commit
a37febf80b
7
init.lua
7
init.lua
|
@ -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…
Reference in New Issue