]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Ignore errors when clearing the highlight text properties
authorYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 27 Nov 2022 16:29:32 +0000 (08:29 -0800)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 27 Nov 2022 16:29:32 +0000 (08:29 -0800)
autoload/lsp/diag.vim
autoload/lsp/lsp.vim

index 45df1d285fa3e70c8e9a96b87108287cb47a2cb3..9898dddf88e5d84e0c9baeaf88f5fd66753698c6 100644 (file)
@@ -125,7 +125,7 @@ export def DiagsGetErrorCount(lspserver: dict<any>): dict<number>
     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
index 314e117e6beca68ed607d402c32ab238292cdb67..09ba79b4b1df4fb48e123762799be502d3770b45 100644 (file)
@@ -527,7 +527,7 @@ enddef
 
 # get the count of diagnostics in the current buffer
 export def ErrorCount(): dict<number>
-  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()