summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2022-11-05 01:03:25 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2022-11-05 16:52:23 +0900
commit0881a6bc17d970d2833be21fafc8de69fe468631 (patch)
treedf2ef85b3570d676e91a9ed6dd28425048de58db /plugin
parent2c6a73546ddefe7c1c1c01e4282e1df06bfe82e8 (diff)
[neovim] Do not use Pmenu group colors for floating window
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
Diffstat (limited to 'plugin')
-rw-r--r--plugin/fzf.vim8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index ca2dbaa4..a56f23ce 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -973,16 +973,16 @@ function! s:callback(dict, lines) abort
endfunction
if has('nvim')
- function s:create_popup(hl, opts) abort
+ function s:create_popup(opts) abort
let buf = nvim_create_buf(v:false, v:true)
let opts = extend({'relative': 'editor', 'style': 'minimal'}, a:opts)
let win = nvim_open_win(buf, v:true, opts)
- call setwinvar(win, '&winhighlight', 'NormalFloat:'..a:hl)
+ silent! call setwinvar(win, '&winhighlight', 'Pmenu:')
call setwinvar(win, '&colorcolumn', '')
return buf
endfunction
else
- function! s:create_popup(hl, opts) abort
+ function! s:create_popup(opts) abort
let s:popup_create = {buf -> popup_create(buf, #{
\ line: a:opts.row,
\ col: a:opts.col,
@@ -1017,7 +1017,7 @@ function! s:popup(opts) abort
let row += !has('nvim')
let col += !has('nvim')
- call s:create_popup('Normal', {
+ call s:create_popup({
\ 'row': row, 'col': col, 'width': width, 'height': height
\ })
endfunction