summaryrefslogtreecommitdiff
path: root/plugin/fzf.vim
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2014-03-31 13:22:52 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2014-03-31 13:22:52 +0900
commita85bb93b69c09a7c178bd23468344ffd2709c1e0 (patch)
treef7415aeaf024b9aacfb49ff66e6354ccf88bc33d /plugin/fzf.vim
parent057eda060c59a0ce6d7730d45cafbde3cfa521e6 (diff)
downloadfzf-a85bb93b69c09a7c178bd23468344ffd2709c1e0.tar.gz
Fix use of screenrow when tmux height is given in %
Diffstat (limited to 'plugin/fzf.vim')
-rw-r--r--plugin/fzf.vim11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index c1b68cef..1bc31cc6 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -108,6 +108,15 @@ function! s:execute(dict, command, temps)
endif
endfunction
+function! s:screenrow()
+ try
+ execute "normal! :let g:_screenrow = screenrow()\<cr>"
+ return g:_screenrow
+ finally
+ unlet! g:_screenrow
+ endtry
+endfunction
+
function! s:execute_tmux(dict, command, temps)
if has_key(a:dict, 'dir')
let command = 'cd '.s:escape(a:dict.dir).' && '.a:command
@@ -117,7 +126,7 @@ function! s:execute_tmux(dict, command, temps)
if type(a:dict.tmux) == 1
if a:dict.tmux =~ '%$'
- let height = screenrow() * str2nr(a:dict.tmux[0:-2]) / 100
+ let height = s:screenrow() * str2nr(a:dict.tmux[0:-2]) / 100
else
let height = str2nr(a:dict.tmux)
endif