From: Yegappan Lakshmanan Date: Sun, 27 Nov 2022 17:57:28 +0000 (-0800) Subject: Check whether the current buffer has a LSP server before clearing the highlights X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=33b85cf29668f8532bff4e815f70a0ef77911603;p=vim-lsp.git Check whether the current buffer has a LSP server before clearing the highlights --- diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index 09ba79b..dd3307a 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -584,8 +584,12 @@ enddef # clear the symbol reference highlight def g:LspDocHighlightClear() - :silent! prop_remove({types: ['LspTextRef', 'LspReadRef', 'LspWriteRef'], - all: true}) + var lspserver: dict = buf.CurbufGetServerChecked() + if lspserver->empty() + return + endif + + prop_remove({types: ['LspTextRef', 'LspReadRef', 'LspWriteRef'], all: true}) enddef def g:LspRequestDocSymbols()