[vim] Tilde prefix is not allowed for left or right layout

This commit is contained in:
Junegunn Choi 2016-08-24 01:15:35 +09:00
parent b86838c2b0
commit f958c9daf5
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -276,10 +276,10 @@ function! s:fzf_tmux(dict)
if s:present(a:dict, o) if s:present(a:dict, o)
let spec = a:dict[o] let spec = a:dict[o]
if (o == 'up' || o == 'down') && spec[0] == '~' if (o == 'up' || o == 'down') && spec[0] == '~'
let size = '-'.o[0].s:calc_size(&lines, spec[1:], a:dict) let size = '-'.o[0].s:calc_size(&lines, spec, a:dict)
else else
" Legacy boolean option " Legacy boolean option
let size = '-'.o[0].(spec == 1 ? '' : spec) let size = '-'.o[0].(spec == 1 ? '' : substitute(spec, '^\~', '', ''))
endif endif
break break
endif endif
@ -375,10 +375,11 @@ function! s:execute_tmux(dict, command, temps) abort
endfunction endfunction
function! s:calc_size(max, val, dict) function! s:calc_size(max, val, dict)
if a:val =~ '%$' let val = substitute(a:val, '^\~', '', '')
let size = a:max * str2nr(a:val[:-2]) / 100 if val =~ '%$'
let size = a:max * str2nr(val[:-2]) / 100
else else
let size = min([a:max, str2nr(a:val)]) let size = min([a:max, str2nr(val)])
endif endif
let srcsz = -1 let srcsz = -1
@ -409,7 +410,7 @@ function! s:split(dict)
if !empty(val) if !empty(val)
let [cmd, resz, max] = triple let [cmd, resz, max] = triple
if (dir == 'up' || dir == 'down') && val[0] == '~' if (dir == 'up' || dir == 'down') && val[0] == '~'
let sz = s:calc_size(max, val[1:], a:dict) let sz = s:calc_size(max, val, a:dict)
else else
let sz = s:calc_size(max, val, {}) let sz = s:calc_size(max, val, {})
endif endif