[vim] Disable height calculation when 'preview' is found in the option string

Fix #2093

And we'll phase out height specification with `~` prefix.
This commit is contained in:
Junegunn Choi
2020-06-29 22:26:13 +09:00
parent 6dec42a33a
commit bdde69d011
2 changed files with 5 additions and 2 deletions

View File

@@ -629,6 +629,9 @@ function! s:calc_size(max, val, dict)
endif
let opts = $FZF_DEFAULT_OPTS.' '.s:evaluate_opts(get(a:dict, 'options', ''))
if opts =~ 'preview'
return size
endif
let margin = match(opts, '--inline-info\|--info[^-]\{-}inline') > match(opts, '--no-inline-info\|--info[^-]\{-}\(default\|hidden\)') ? 1 : 2
let margin += stridx(opts, '--border') > stridx(opts, '--no-border') ? 2 : 0
if stridx(opts, '--header') > stridx(opts, '--no-header')