summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-07-28 00:48:29 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-07-28 00:56:03 +0900
commitfcae99f09b9ed700465ac06b375c376cc2d6dde8 (patch)
tree71fe404e599d4ddd1e1543f15175cabcdf6d364d /plugin
parentfb1b026d3daaaa9b64d8f49ae6fbbf6727ac33c0 (diff)
No need to "tmux list-panes" when obviously not on tmux (#303)
Diffstat (limited to 'plugin')
-rw-r--r--plugin/fzf.vim9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index c4deb9ec..c9eb6d15 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -54,14 +54,17 @@ function! s:fzf_exec()
return s:exec
endfunction
+function! s:tmux_not_zoomed()
+ return system('tmux list-panes -F "#F"') !~# 'Z'
+endfunction
+
function! s:tmux_enabled()
if has('gui_running')
return 0
endif
- let not_zoomed = system('tmux list-panes -F "#F"') !~# 'Z'
if exists('s:tmux')
- return s:tmux && not_zoomed
+ return s:tmux && s:tmux_not_zoomed()
endif
let s:tmux = 0
@@ -69,7 +72,7 @@ function! s:tmux_enabled()
let output = system('tmux -V')
let s:tmux = !v:shell_error && output >= 'tmux 1.7'
endif
- return s:tmux && not_zoomed
+ return s:tmux && s:tmux_not_zoomed()
endfunction
function! s:shellesc(arg)