summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-07-19 16:18:23 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-07-19 16:19:48 +0900
commit821b8e70a80e3ea96772a4dda36311b19b7171b4 (patch)
tree373f259ba8282fa341bacc79ee3f643ebc51eec4
parent8ceda54c7d32833db084dc30ae95fdefe3aff716 (diff)
downloadfzf-821b8e70a80e3ea96772a4dda36311b19b7171b4.tar.gz
[neovim] Fix margin background color when &winborder is used
Fix #4453
-rw-r--r--plugin/fzf.vim17
1 files changed, 16 insertions, 1 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index f2066996..a733f8c9 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -1027,8 +1027,23 @@ if has('nvim')
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)
- silent! call setwinvar(win, '&winhighlight', 'Pmenu:,Normal:Normal')
call setwinvar(win, '&colorcolumn', '')
+
+ " Colors
+ try
+ call setwinvar(win, '&winhighlight', 'Pmenu:,Normal:Normal')
+ let rules = get(g:, 'fzf_colors', {})
+ if has_key(rules, 'bg')
+ let color = call('s:get_color', rules.bg)
+ if len(color)
+ let ns = nvim_create_namespace('fzf_popup')
+ let hl = nvim_set_hl(ns, 'Normal',
+ \ &termguicolors ? { 'bg': color } : { 'ctermbg': str2nr(color) })
+ call nvim_win_set_hl_ns(win, ns)
+ endif
+ endif
+ catch
+ endtry
return buf
endfunction
else