temporarily desiable cursorhold bug

This commit is contained in:
StuartStephens 2025-03-17 23:07:14 -04:00
parent d6f67fd894
commit 0796cc3c52
1 changed files with 23 additions and 23 deletions

View File

@ -581,29 +581,29 @@ require('lazy').setup({
-- See `:help CursorHold` for information about when this is executed
--
-- 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)
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
buffer = event.buf,
group = highlight_augroup,
callback = vim.lsp.buf.document_highlight,
})
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
buffer = event.buf,
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
-- local client = vim.lsp.get_client_by_id(event.data.client_id)
-- if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
-- local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
-- vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
-- buffer = event.buf,
-- group = highlight_augroup,
-- callback = vim.lsp.buf.document_highlight,
-- })
--
-- vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
-- buffer = event.buf,
-- 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 code creates a keymap to toggle inlay hints in your
-- code, if the language server you are using supports them