From d6111e464e416bcbd0e3f145bbad599e2d5a62a3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Magnus=20Gro=C3=9F?= Date: Thu, 1 Jun 2023 00:51:38 +0200 Subject: [PATCH] Unify completepopup settings There is not really a reason to have different completepopup settings depending on if the LSP server supports lazy documentation or not: In both cases info may be displayed, the only difference being that with "resolveProvider" the info is to be fetched on demand. But for both scenarios the formatting of the info popup should be the same. This fixes a problem, where in the non-lazydoc branch the info popup is colored with the PmenuSel highlight group, which is a little bit ugly when the content is syntax highlighted as well. --- autoload/lsp/completion.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/autoload/lsp/completion.vim b/autoload/lsp/completion.vim index 643ea99..fffc3e6 100644 --- a/autoload/lsp/completion.vim +++ b/autoload/lsp/completion.vim @@ -604,11 +604,10 @@ export def BufferInit(lspserver: dict, bnr: number, ftype: string) if opt.lspOptions.autoComplete if lspserver.completionLazyDoc setbufvar(bnr, '&completeopt', 'menuone,popuphidden,noinsert,noselect') - setbufvar(bnr, '&completepopup', 'width:80,highlight:Pmenu,align:item,border:off') else setbufvar(bnr, '&completeopt', 'menuone,popup,noinsert,noselect') - setbufvar(bnr, '&completepopup', 'border:off') endif + setbufvar(bnr, '&completepopup', 'width:80,highlight:Pmenu,align:item,border:off') # in insert mode stops completion and inserts a if !opt.lspOptions.noNewlineInCompletion :inoremap pumvisible() ? "\\" : "\" -- 2.48.1