fix(lsp): double check for documentHighlight. See #3246

This commit is contained in:
Folke Lemaitre 2024-05-27 18:22:44 +02:00
parent a23e8c15f5
commit 0a63734b78
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -236,6 +236,9 @@ function M.words.setup(opts)
group = vim.api.nvim_create_augroup("lsp_word_" .. buf, { clear = true }),
buffer = buf,
callback = function(ev)
if not require("lazyvim.plugins.lsp.keymaps").has(buf, "documentHighlight") then
return false
end
if not ({ M.words.get() })[2] then
if ev.event:find("CursorMoved") then
vim.lsp.buf.clear_references()