[vim/fzf-tmux] Handle fzf project directory with spaces

Close #583
This commit is contained in:
Junegunn Choi 2016-06-03 12:09:31 +09:00
parent cfc0b18eaa
commit 1c86aaf342
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
2 changed files with 4 additions and 4 deletions

View File

@ -141,14 +141,14 @@ for arg in "${args[@]}"; do
done
if [ -n "$term" -o -t 0 ]; then
cat <<< "$fzf $opts > $fifo2; echo \$? > $fifo3 $close" > $argsf
cat <<< "\"$fzf\" $opts > $fifo2; echo \$? > $fifo3 $close" > $argsf
tmux set-window-option synchronize-panes off \;\
set-window-option remain-on-exit off \;\
split-window $opt "cd $(printf %q "$PWD");$envs bash $argsf" $swap \
> /dev/null 2>&1
else
mkfifo $fifo1
cat <<< "$fzf $opts < $fifo1 > $fifo2; echo \$? > $fifo3 $close" > $argsf
cat <<< "\"$fzf\" $opts < $fifo1 > $fifo2; echo \$? > $fifo3 $close" > $argsf
tmux set-window-option synchronize-panes off \;\
set-window-option remain-on-exit off \;\
split-window $opt "$envs bash $argsf" $swap \

View File

@ -49,7 +49,7 @@ function! s:fzf_exec()
throw 'fzf executable not found'
endif
endif
return s:exec
return s:shellesc(s:exec)
endfunction
function! s:tmux_enabled()
@ -179,7 +179,7 @@ function! s:fzf_tmux(dict)
endif
endfor
return printf('LINES=%d COLUMNS=%d %s %s %s --',
\ &lines, &columns, s:fzf_tmux, size, (has_key(a:dict, 'source') ? '' : '-'))
\ &lines, &columns, s:shellesc(s:fzf_tmux), size, (has_key(a:dict, 'source') ? '' : '-'))
endfunction
function! s:splittable(dict)