From: Andreas Louv Date: Tue, 4 Apr 2023 21:51:31 +0000 (+0200) Subject: Add "LspSigActiveParameter" highlighting group X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=81b91d26eef4617a523f356073d2cc04ef6deb31;p=vim-lsp.git Add "LspSigActiveParameter" highlighting group --- diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index 65accd3..12f4461 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -37,6 +37,7 @@ def LspInitOnce() diag.InitOnce() inlayhints.InitOnce() + signature.InitOnce() :set ballooneval balloonevalterm lspInitializedOnce = true diff --git a/autoload/lsp/signature.vim b/autoload/lsp/signature.vim index 945e7af..1bfac2d 100644 --- a/autoload/lsp/signature.vim +++ b/autoload/lsp/signature.vim @@ -21,6 +21,10 @@ def CloseCurBufSignaturePopup() CloseSignaturePopup(lspserver) enddef +export def InitOnce() + hlset([{name: 'LspSigActiveParameter', default: true, linksto: 'LineNr'}]) +enddef + # Initialize the signature triggers for the current buffer export def BufferInit(lspserver: dict) if !lspserver.isSignatureHelpProvider @@ -81,7 +85,7 @@ export def SignatureHelp(lspserver: dict, sighelp: any): void :echon "\r\r" :echon '' :echon text->strpart(0, startcol) - :echoh LineNr + :echoh LspSigActiveParameter :echon text->strpart(startcol, hllen) :echoh None :echon text->strpart(startcol + hllen) @@ -91,7 +95,7 @@ export def SignatureHelp(lspserver: dict, sighelp: any): void var popupID = text->popup_atcursor({moved: [col('.') - 1, 9999999]}) var bnum: number = popupID->winbufnr() - prop_type_add('signature', {bufnr: bnum, highlight: 'LineNr'}) + prop_type_add('signature', {bufnr: bnum, highlight: 'LspSigActiveParameter'}) if hllen > 0 prop_add(1, startcol + 1, {bufnr: bnum, length: hllen, type: 'signature'}) endif diff --git a/doc/lsp.txt b/doc/lsp.txt index 5a89c34..f0c73d7 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -1092,6 +1092,9 @@ override them. *LspInlayHintsType* Used to highlight inlay hints of kind "type". By default, linked to the "Conceal" highlight group. +*LspSigActiveParameter* Used to highlight the active signature + parameter. By default, linked to the "LineNr" + highlight group. For example, to override the highlight used for diagnostics virtual text, you can use the following: >