From: Andrew Spaulding Date: Tue, 6 Feb 2024 04:32:31 +0000 (-0800) Subject: Added an option for configuring the wrapping mode of diagnostic virtual text X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=2155fc42ad8751090c990ef3b8f791889c567e9f;p=vim-lsp.git Added an option for configuring the wrapping mode of diagnostic virtual text --- diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index 6e24a12..acf0736 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -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> = [] var diags: list> = diagsMap[bnr].sortedDiagnostics var inlineHLprops: list>> = [[], [], [], [], []] diff --git a/autoload/lsp/options.vim b/autoload/lsp/options.vim index 18e23dd..50697a3 100644 --- a/autoload/lsp/options.vim +++ b/autoload/lsp/options.vim @@ -70,6 +70,10 @@ export var lspOptions: dict = { # 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 noNewlineInCompletion: false,