autoload/lsp/diag.vim | 11 ++++++++++- diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index 7a56c5ffecb7971301b7be15801aec08ef176f47..4661ca75a945cae179527d5bf536b16e181f91fc 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -489,9 +489,18 @@ opt.lspOptions.autoHighlightDiags = false # 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