Skip to content
Myr

[neovim] Do not use Pmenu group colors for floating window

Before adoption: this commit came in with the history the project adopted, so no landing records it.

In Neovim, the foreground and background colors of a floating window defaults to those of Pmenu highlight group, which yields unexpected results. This commit makes the colors of fzf window defaults to those of 'Normal' group (or 'NormalFloat' if defined), by ignoring Pmenu group. Then the colors can be configured via --color option of fzf. NOTE: An error from setwinvar call is ignored because the exact behavior of &winhighlight with an empty target group is not clearly documented. Close #3035 Close https://github.com/junegunn/fzf.vim/issues/1431 See https://github.com/neovim/neovim/pull/9722#discussion_r264777602

authored by Junegunn Choi · committed by Junegunn Choi · parent 2c6a735 · Browse files · 1 file+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:plugin/fzf.vim+4 added-4 removed
971 unmodified lines
972 endif973endfunction974975if has('nvim')976 function s:create_popup(hl, opts) abort976 function s:create_popup(opts) abort977 let buf = nvim_create_buf(v:false, v:true)978 let opts = extend({'relative': 'editor', 'style': 'minimal'}, a:opts)979 let win = nvim_open_win(buf, v:true, opts)980 call setwinvar(win, '&winhighlight', 'NormalFloat:'..a:hl)980 silent! call setwinvar(win, '&winhighlight', 'Pmenu:')981 call setwinvar(win, '&colorcolumn', '')982 return buf983 endfunction984else985 function! s:create_popup(hl, opts) abort985 function! s:create_popup(opts) abort986 let s:popup_create = {buf -> popup_create(buf, #{987 \ line: a:opts.row,988 \ col: a:opts.col,989 \ minwidth: a:opts.width,
26 unmodified lines
1016 let col = min([max([0, col]), &columns - width])1017 let row += !has('nvim')1018 let col += !has('nvim')10191020 call s:create_popup('Normal', {1020 call s:create_popup({1021 \ 'row': row, 'col': col, 'width': width, 'height': height1022 \ })1023endfunction1024
36 unmodified lines