From 0a63734b783509407530eae789258fcf9a6f2219 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 27 May 2024 18:22:44 +0200 Subject: [PATCH] fix(lsp): double check for documentHighlight. See #3246 --- lua/lazyvim/util/lsp.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 24a2bc98..adc1be0d 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -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()