Merge 'upstream' fix: highlight group clear on each attach, README

This commit is contained in:
Damjan 9000 2024-04-22 23:48:46 +02:00
commit 77dbcfaaf7
2 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@ That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
current plugin status. Hit `q` to close the window. current plugin status. Hit `q` to close the window.
Read through the `init.lua` file in your configuration folder for more Read through the `init.lua` file in your configuration folder for more
information about extending and exploring Neovim. That includes also information about extending and exploring Neovim. That also includes
examples of adding popularly requested plugins. examples of adding popularly requested plugins.

View File

@ -105,7 +105,7 @@ return {
-- When you move your cursor, the highlights will be cleared (the second autocommand). -- When you move your cursor, the highlights will be cleared (the second autocommand).
local client = vim.lsp.get_client_by_id(event.data.client_id) local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client.server_capabilities.documentHighlightProvider then if client and client.server_capabilities.documentHighlightProvider then
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = true }) local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
buffer = event.buf, buffer = event.buf,
group = highlight_augroup, group = highlight_augroup,