From 33b85cf29668f8532bff4e815f70a0ef77911603 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sun, 27 Nov 2022 09:57:28 -0800 Subject: [PATCH] Check whether the current buffer has a LSP server before clearing the highlights --- autoload/lsp/lsp.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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() -- 2.48.1