From 475c47c896db78b1f7e8716f6315c6717eaa7a3e Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sun, 27 Nov 2022 08:29:32 -0800 Subject: [PATCH] Ignore errors when clearing the highlight text properties --- autoload/lsp/diag.vim | 2 +- autoload/lsp/lsp.vim | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index 45df1d2..9898ddd 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -125,7 +125,7 @@ export def DiagsGetErrorCount(lspserver: dict): dict endfor endif - return {'Error': errCount, 'Warn': warnCount, 'Info': infoCount, 'Hint': hintCount} + return {Error: errCount, Warn: warnCount, Info: infoCount, Hint: hintCount} enddef # Map the LSP DiagnosticSeverity to a quickfix type character diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index 314e117..09ba79b 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -527,7 +527,7 @@ enddef # get the count of diagnostics in the current buffer export def ErrorCount(): dict - var res = {'Error': 0, 'Warn': 0, 'Info': 0, 'Hint': 0} + var res = {Error: 0, Warn: 0, Info: 0, Hint: 0} var fname: string = @% if fname == '' return res @@ -584,9 +584,8 @@ enddef # clear the symbol reference highlight def g:LspDocHighlightClear() - prop_remove({'type': 'LspTextRef', 'all': true}, 1, line('$')) - prop_remove({'type': 'LspReadRef', 'all': true}, 1, line('$')) - prop_remove({'type': 'LspWriteRef', 'all': true}, 1, line('$')) + :silent! prop_remove({types: ['LspTextRef', 'LspReadRef', 'LspWriteRef'], + all: true}) enddef def g:LspRequestDocSymbols() -- 2.48.1