mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 00:49:03 +02:00
fix(lsp): dont highlight document words when cmp is visible
This commit is contained in:
parent
32b2574c1b
commit
0d57115f01
2 changed files with 7 additions and 1 deletions
|
@ -70,6 +70,11 @@ function M.add_missing_snippet_docs(window)
|
|||
end
|
||||
end
|
||||
|
||||
function M.visible()
|
||||
local ok, cmp = pcall(require, "cmp")
|
||||
return ok and cmp.core.view:visible()
|
||||
end
|
||||
|
||||
-- This is a better implementation of `cmp.confirm`:
|
||||
-- * check if the completion menu is visible without waiting for running sources
|
||||
-- * create an undo point before confirming
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue