summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-08-24 01:15:35 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-08-24 01:15:35 +0900
commitf958c9daf59439240c36d74f42187333c23bd8a4 (patch)
tree747d08f1317cbea2dbeba8dadc66b0e3925ce733 /plugin
parentb86838c2b088ab7c7d80b6103a5fa59d6172ce10 (diff)
[vim] Tilde prefix is not allowed for `left` or `right` layout
Diffstat (limited to 'plugin')
-rw-r--r--plugin/fzf.vim13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index 2da98b51..abaa420c 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -276,10 +276,10 @@ function! s:fzf_tmux(dict)
if s:present(a:dict, o)
let spec = a:dict[o]
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
" Legacy boolean option
- let size = '-'.o[0].(spec == 1 ? '' : spec)
+ let size = '-'.o[0].(spec == 1 ? '' : substitute(spec, '^\~', '', ''))
endif
break
endif
@@ -375,10 +375,11 @@ function! s:execute_tmux(dict, command, temps) abort
endfunction
function! s:calc_size(max, val, dict)
- if a:val =~ '%$'
- let size = a:max * str2nr(a:val[:-2]) / 100
+ let val = substitute(a:val, '^\~', '', '')
+ if val =~ '%$'
+ let size = a:max * str2nr(val[:-2]) / 100
else
- let size = min([a:max, str2nr(a:val)])
+ let size = min([a:max, str2nr(val)])
endif
let srcsz = -1
@@ -409,7 +410,7 @@ function! s:split(dict)
if !empty(val)
let [cmd, resz, max] = triple
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
let sz = s:calc_size(max, val, {})
endif