Skip to content
Myr

[vim] Use terminal buffer on 'down' layout on regular Vim on terminal

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

When 'down' layout was used on regular Vim on terminal, fzf would open below the editor using `--height` option. This was the only case where terminal buffer was not used (the code was written when Vim didn't have builtin terminal) and this exception has been a constant source of confusion. This commit makes fzf open in a terminal buffer even in that case.

authored by Junegunn Choi · committed by Junegunn Choi · parent 7411da8 · 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
485 unmodified lines
486 \ executable('tput') && filereadable('/dev/tty')487 let has_vim8_term = has('terminal') && has('patch-8.0.995')488 let has_nvim_term = has('nvim-0.2.1') || has('nvim') && !s:is_win489 let use_term = has_nvim_term ||490 \ has_vim8_term && !has('win32unix') && (has('gui_running') || s:is_win || !use_height && s:present(dict, 'down', 'up', 'left', 'right', 'window'))490 \ has_vim8_term && !has('win32unix') && (has('gui_running') || s:is_win || s:present(dict, 'down', 'up', 'left', 'right', 'window'))491 let use_tmux = (has_key(dict, 'tmux') || (!use_height && !use_term || prefer_tmux) && !has('win32unix') && s:splittable(dict)) && s:tmux_enabled()492 if prefer_tmux && use_tmux493 let use_height = 0494 let use_term = 0495 endif496 if use_height496 if use_term497 let optstr .= ' --no-height'498 elseif use_height499 let height = s:calc_size(&lines, dict.down, dict)500 let optstr .= ' --height='.height499 elseif use_term500 let optstr .= ' --no-height'501 endif502 let optstr .= s:border_opt(get(dict, 'window', 0))503 let prev_default_command = $FZF_DEFAULT_COMMAND504 if len(source_command)
541 unmodified lines