[vim/vim] pum: No opacity when background not set for Popup menu group (PR #20638)

0 views
Skip to first unread message

Shad

unread,
3:40 PM (3 hours ago) 3:40 PM
to vim/vim, Subscribed

Problem: pum: When the Pmenu highlight group has no guibg/ctermbg the
popup menu becomes fully transparent.
Solution: Create an entry if no popup_attr exists (highlight group
cleared for example), and test if popup_attr exists but
without guibg/ctermbg attributes to fallback to normal bg
color. Similar to patch 9.2.0602 for popup window

without this patch:
pum-opacity-without-patch.png (view on web)

With this patch:
pum-opacity-with-patch.png (view on web)

To reproduce: source a testfile containing

set pumopt=opacity:50,border:round
set completeopt=menu
set background=dark
highlight clear Pmenu
highlight clear PmenuSel
highlight Underbg ctermbg=red guibg=red
highlight Underfg ctermfg=green guifg=green
call setline(1, '')
for i in range(10)
    call append(line('$'), ' X YYY ZZZ X YYY X X X X X X')
endfor
call matchadd('Underbg', 'YYY')
call matchadd('Underfg', 'ZZZ')
normal gg
inoremap <F5> <Cmd>call complete(col('.'),
            \ ['item', 'another item', 'and a last one'])<CR>

with

vim --clean -S test-pum-opacity-hlnone.vim

switch to insert mode then press <F5>


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20638

Commit Summary

  • 27866e1 pum: No opacity when background not set for Popup menu group

File Changes

(6 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20638@github.com>

Reply all
Reply to author
Forward
0 new messages