]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
add diagVirtualTextHL highlight option
authorOleksiy Hryshchenko <greeschenko@gmail.com>
Mon, 27 Mar 2023 16:00:30 +0000 (19:00 +0300)
committerOleksiy Hryshchenko <greeschenko@gmail.com>
Mon, 27 Mar 2023 16:00:30 +0000 (19:00 +0300)
autoload/lsp/lsp.vim
autoload/lsp/options.vim
doc/lsp.txt

index 1cfb4697631fc532bbe7bf1e5f7506ad59ea6ae7..79892e58500e81d480c46308ba24de8dcbe18d03 100644 (file)
@@ -48,7 +48,7 @@ def LspInitOnce()
 
   if has('patch-9.0.1157') && opt.lspOptions.showDiagWithVirtualText
       if !hlexists('LspDiagVirtualText')
-          hlset([{name: 'LspDiagVirtualText', linksto: 'LineNr'}])
+          hlset([{name: 'LspDiagVirtualText', linksto: opt.lspOptions.diagVirtualTextHL}])
       endif
       prop_type_add('LspDiagVirtualText', {highlight: 'LspDiagVirtualText', override: true})
   endif
index 33cbffa32c0437711831039739847b6627a278c3..1b20a997d7fc7908d8bfd254390f73a6480190ed 100644 (file)
@@ -38,6 +38,8 @@ export var lspOptions: dict<any> = {
   diagLineHL: 'DiffAdd',
   # Show a diagnostic messages with virtual text
   showDiagWithVirtualText: false,
+  # The highlight group used for a diagnostics virtual text
+  diagVirtualTextHL: 'LineNr',
   # Don't print message when a configured language server is missing.
   ignoreMissingServer: false,
   # Use a floating menu to show the code action menu instead of asking for input
index 39fb8c3304d8d58155d6e61ab0e0b4a5378a0a27..da139ce504b298af0cf3da827fc1f621bbce5f81 100644 (file)
@@ -337,6 +337,9 @@ showInlayHints              |Boolean| option.  Show inlay hints from the language
 showDiagWithVirtualText                |Boolean| option.  Show diagnostic messages text from the language
                        server with virtual text.  By default this is set to false.
             Needs Vim version 9.0.1157 or later.
+diagVirtualTextHL              |String| option.
+            The highlight group used for a diagnostics virtual text.
+            By default uses "LineNr".
 showSignature          |Boolean| option.  In insert mode, automatically show
                        the current symbol signature in a popup.
                        By default this is set to true.