diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2014-04-04 12:43:29 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2014-04-04 12:43:29 +0900 |
| commit | af677e7e35465bd6bfdb690d3c7a9674bcfcc620 (patch) | |
| tree | 3ca16b978ec608583aadfaaed977ff44af63b2de /plugin | |
| parent | 6ad38bdad3589c472d7ff93eb23719b09273f7b5 (diff) | |
| download | fzf-af677e7e35465bd6bfdb690d3c7a9674bcfcc620.tar.gz | |
Vim plugin: do not enable tmux-integration if version < 1.7
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/fzf.vim | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index faf8e57a..0b809318 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -40,6 +40,19 @@ else let s:exec = 'fzf' endif +function! s:tmux_enabled() + if exists('s:tmux') + return s:tmux + endif + + let s:tmux = 0 + if exists('$TMUX') + let output = system('tmux -V') + let s:tmux = !v:shell_error && output >= 'tmux 1.7' + endif + return s:tmux +endfunction + function! s:shellesc(arg) return '"'.substitute(a:arg, '"', '\\"', 'g').'"' endfunction @@ -75,7 +88,7 @@ function! fzf#run(...) abort endif let command = prefix.s:exec.' '.optstr.' > '.temps.result - if exists('$TMUX') && has_key(dict, 'tmux') && + if s:tmux_enabled() && has_key(dict, 'tmux') && \ dict.tmux > 0 && winheight(0) >= s:min_tmux_height return s:execute_tmux(dict, command, temps) else |
