summaryrefslogtreecommitdiffstats
path: root/nvim/init.lua
diff options
context:
space:
mode:
authorDamjan 9000 <damjan.9000@gmail.com>2024-05-02 22:53:07 +0200
committerGitHub <noreply@github.com>2024-05-02 16:53:07 -0400
commit3704c4855859bef58d2988823c7e895af004bc93 (patch)
treee202ab331e49d1ccb8da604333b42cdd4726276c /nvim/init.lua
parenta5e8a5e43d9afdce93d909cc2d8d96c322f45c5a (diff)
downloaddots-3704c4855859bef58d2988823c7e895af004bc93.tar.gz
Move LspDetach handler near kickstart-lsp-highlight group (#900)
Moved to make sure the kickstart-lsp-highlight group exists when the LspDetach handler is invoked. The LspDetach handler is used to clean up any lsp highlights that were enabled by CursorHold if the LSP is stopped or crashed.
Diffstat (limited to 'nvim/init.lua')
-rw-r--r--nvim/init.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/nvim/init.lua b/nvim/init.lua
index 036eefb..457ad21 100644
--- a/nvim/init.lua
+++ b/nvim/init.lua
@@ -526,6 +526,14 @@ require('lazy').setup({
group = highlight_augroup,
callback = vim.lsp.buf.clear_references,
})
+
+ vim.api.nvim_create_autocmd('LspDetach', {
+ group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
+ callback = function(event2)
+ vim.lsp.buf.clear_references()
+ vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
+ end,
+ })
end
-- The following autocommand is used to enable inlay hints in your
@@ -540,14 +548,6 @@ require('lazy').setup({
end,
})
- vim.api.nvim_create_autocmd('LspDetach', {
- group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
- callback = function(event)
- vim.lsp.buf.clear_references()
- vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event.buf }
- end,
- })
-
-- LSP servers and clients are able to communicate to each other what features they support.
-- By default, Neovim doesn't support everything that is in the LSP specification.
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.