From 2155fc42ad8751090c990ef3b8f791889c567e9f Mon Sep 17 00:00:00 2001 From: Andrew Spaulding Date: Mon, 5 Feb 2024 20:32:31 -0800 Subject: [PATCH] Added an option for configuring the wrapping mode of diagnostic virtual text --- autoload/lsp/diag.vim | 4 ++++ autoload/lsp/options.vim | 4 ++++ 2 files changed, 8 insertions(+) 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, -- 2.48.1