Vim plugin: do not enable tmux-integration if version < 1.7
This commit is contained in:
parent
6ad38bdad3
commit
af677e7e35
@ -40,6 +40,19 @@ else
|
|||||||
let s:exec = 'fzf'
|
let s:exec = 'fzf'
|
||||||
endif
|
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)
|
function! s:shellesc(arg)
|
||||||
return '"'.substitute(a:arg, '"', '\\"', 'g').'"'
|
return '"'.substitute(a:arg, '"', '\\"', 'g').'"'
|
||||||
endfunction
|
endfunction
|
||||||
@ -75,7 +88,7 @@ function! fzf#run(...) abort
|
|||||||
endif
|
endif
|
||||||
let command = prefix.s:exec.' '.optstr.' > '.temps.result
|
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
|
\ dict.tmux > 0 && winheight(0) >= s:min_tmux_height
|
||||||
return s:execute_tmux(dict, command, temps)
|
return s:execute_tmux(dict, command, temps)
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user