Simplify clearing the autocommands

This commit is contained in:
Francis Belanger 2024-04-22 10:15:45 -04:00
parent a37febf80b
commit 5ba86c5e6a
1 changed files with 1 additions and 4 deletions

View File

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