]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Added an option for configuring the wrapping mode of diagnostic virtual text
authorAndrew Spaulding <andyespaulding@gmail.com>
Tue, 6 Feb 2024 04:32:31 +0000 (20:32 -0800)
committerAndrew Spaulding <andyespaulding@gmail.com>
Tue, 6 Feb 2024 04:32:31 +0000 (20:32 -0800)
autoload/lsp/diag.vim
autoload/lsp/options.vim

index 6e24a12cc4a48411868a728763b428516971020f..acf073679462bd4b17bc9863ea7c98ed178bbd6e 100644 (file)
@@ -267,6 +267,10 @@ export def DiagsRefresh(bnr: number, all: bool = false)
     diag_symbol = 'E>'
   endif
 
+  if lspOpts.diagVirtualTextWrap != 'default'
+    diag_wrap = lspOpts.diagVirtualTextWrap
+  endif
+
   var signs: list<dict<any>> = []
   var diags: list<dict<any>> = diagsMap[bnr].sortedDiagnostics
   var inlineHLprops: list<list<list<number>>> = [[], [], [], [], []]
index 18e23dd1b29071e0b73a549e03b01d2ef3a87fab..50697a3bec9b29cc675bbd852df605f758bf8abf 100644 (file)
@@ -70,6 +70,10 @@ export var lspOptions: dict<any> = {
   # Allowed values: 'above' | 'below' | 'after' (default is 'above')
   diagVirtualTextAlign: 'above',
 
+  # Wrapping of virtual diagnostic text, when showDiagWithVirtualText is true.
+  # Allowed valuse: 'default' | 'truncate' | 'wrap' (default is 'default')
+  diagVirtualTextWrap: 'default',
+
   # Suppress adding a new line on completion selection with <CR>
   noNewlineInCompletion: false,