]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Clear inline diagnostic highlight with ":LspDiagHighlightDisable"
authorAndreas Louv <andreas@louv.dk>
Wed, 29 Mar 2023 18:38:26 +0000 (20:38 +0200)
committerAndreas Louv <andreas@louv.dk>
Wed, 29 Mar 2023 20:31:01 +0000 (22:31 +0200)
autoload/lsp/diag.vim

index 7a56c5ffecb7971301b7be15801aec08ef176f47..4661ca75a945cae179527d5bf536b16e181f91fc 100644 (file)
@@ -489,9 +489,18 @@ export def DiagsHighlightDisable()
 
   # Remove the diganostics virtual text in all the buffers.
   if opt.lspOptions.showDiagWithVirtualText
+      || opt.lspOptions.highlightDiagInline
     for binfo in getbufinfo({bufloaded: true})
       # Remove all virtual text
-      prop_remove({type: 'LspDiagVirtualText', bufnr: binfo.bufnr, all: true})
+      if opt.lspOptions.showDiagWithVirtualText
+        prop_remove({type: 'LspDiagVirtualText', bufnr: binfo.bufnr, all: true})
+      endif
+      if opt.lspOptions.highlightDiagInline
+        prop_remove({type: 'LspDiagInlineError', bufnr: binfo.bufnr, all: true})
+        prop_remove({type: 'LspDiagInlineWarning', bufnr: binfo.bufnr, all: true})
+        prop_remove({type: 'LspDiagInlineInfo', bufnr: binfo.bufnr, all: true})
+        prop_remove({type: 'LspDiagInlineHint', bufnr: binfo.bufnr, all: true})
+      endif
     endfor
   endif