]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Unify completepopup settings
authorMagnus Groß <magnus@mggross.com>
Wed, 31 May 2023 22:51:38 +0000 (00:51 +0200)
committerMagnus Groß <magnus@mggross.com>
Wed, 31 May 2023 23:03:01 +0000 (01:03 +0200)
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

index 643ea997e0241f3abd0f80a0858e24356f68bf3f..fffc3e69ddc8578b445236fcaabd8a2d54f356d6 100644 (file)
@@ -604,11 +604,10 @@ export def BufferInit(lspserver: dict<any>, 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')
     # <Enter> in insert mode stops completion and inserts a <Enter>
     if !opt.lspOptions.noNewlineInCompletion
       :inoremap <expr> <buffer> <CR> pumvisible() ? "\<C-Y>\<CR>" : "\<CR>"