From a555da8d2fa6688fb6dc1bfd7d3a5f8ef1fcc36e Mon Sep 17 00:00:00 2001 From: Andreas Louv Date: Wed, 29 Mar 2023 20:38:26 +0200 Subject: [PATCH] Clear inline diagnostic highlight with ":LspDiagHighlightDisable" --- autoload/lsp/diag.vim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index 7a56c5f..4661ca7 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -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 -- 2.48.1