[vim] Adjust split size when --header option is set

Close #622
This commit is contained in:
Junegunn Choi 2016-07-14 13:35:18 +09:00
parent 5c2b96bd00
commit a1049328d6
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -282,6 +282,7 @@ function! s:calc_size(max, val, dict)
let opts = get(a:dict, 'options', '').$FZF_DEFAULT_OPTS let opts = get(a:dict, 'options', '').$FZF_DEFAULT_OPTS
let margin = stridx(opts, '--inline-info') > stridx(opts, '--no-inline-info') ? 1 : 2 let margin = stridx(opts, '--inline-info') > stridx(opts, '--no-inline-info') ? 1 : 2
let margin += stridx(opts, '--header') > stridx(opts, '--no-header')
return srcsz >= 0 ? min([srcsz + margin, size]) : size return srcsz >= 0 ? min([srcsz + margin, size]) : size
endfunction endfunction