fix(lsp): dont highlight document words when cmp is visible

This commit is contained in:
Folke Lemaitre 2024-06-16 15:17:45 +02:00
parent 32b2574c1b
commit 0d57115f01
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 7 additions and 1 deletions

View file

@ -280,10 +280,11 @@ function M.words.setup(opts)
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()
else
elseif not LazyVim.cmp.visible() then
vim.lsp.buf.document_highlight()
end
end