mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-17 18:45:10 +00:00
[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
This commit is contained in:
parent
2c6a73546d
commit
0881a6bc17
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user