mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-12-23 03:19:01 +00:00
[vim] Apply FZF_DEFAULT_{OPTS,COMMAND} when using tmux splits (#87)
Fixed escaping bug of the previous commit
This commit is contained in:
parent
4313c1c25c
commit
1e07b3b1c2
@ -148,11 +148,18 @@ function! s:execute(dict, command, temps)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:execute_tmux(dict, command, temps)
|
function! s:env_var(name)
|
||||||
if has_key(a:dict, 'dir')
|
if exists('$'.a:name)
|
||||||
let command = 'cd '.s:escape(a:dict.dir).' && '.a:command
|
return a:name . "='". substitute(expand('$'.a:name), "'", "'\\\\''", 'g') . "' "
|
||||||
else
|
else
|
||||||
let command = a:command
|
return ''
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:execute_tmux(dict, command, temps)
|
||||||
|
let command = s:env_var('FZF_DEFAULT_OPTS').s:env_var('FZF_DEFAULT_COMMAND').a:command
|
||||||
|
if has_key(a:dict, 'dir')
|
||||||
|
let command = 'cd '.s:escape(a:dict.dir).' && '.command
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let splitopt = '-v'
|
let splitopt = '-v'
|
||||||
|
Loading…
Reference in New Issue
Block a user