diff options
| author | jiz4oh <41264693+jiz4oh@users.noreply.github.com> | 2025-05-13 23:53:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-14 00:53:26 +0900 |
| commit | 2c6381499c8bfb3f1604f61f3e2eb0eadcfc2728 (patch) | |
| tree | f492a0851e17f37481770b3dfcc7821105bf14ee | |
| parent | 4df842e78cb1b2788508cb1cc9ddd8a0f0ea58e2 (diff) | |
| download | fzf-2c6381499c8bfb3f1604f61f3e2eb0eadcfc2728.tar.gz | |
[neovim] Respect winborder of Neovim 0.11+ (#4389)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
| -rw-r--r-- | plugin/fzf.vim | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 63857ce3..254e69d7 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -553,8 +553,15 @@ try let height = s:calc_size(&lines, dict.down, dict) let optstr .= ' --no-tmux --height='.height endif - " Respect --border option given in $FZF_DEFAULT_OPTS and 'options' - let optstr = join([s:border_opt(get(dict, 'window', 0)), s:extract_option($FZF_DEFAULT_OPTS, 'border'), optstr]) + + if exists('&winborder') && &winborder !=# '' && &winborder !=# 'none' + " Add 1-column horizontal margin + let optstr = join(['--margin 0,1', optstr]) + else + " Respect --border option given in $FZF_DEFAULT_OPTS and 'options' + let optstr = join([s:border_opt(get(dict, 'window', 0)), s:extract_option($FZF_DEFAULT_OPTS, 'border'), optstr]) + endif + let command = prefix.(use_tmux ? s:fzf_tmux(dict) : fzf_exec).' '.optstr.' > '.temps.result if use_term |
