summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-06-03 12:09:31 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-06-03 12:09:31 +0900
commit1c86aaf342120700c169683dd538a6d15b184369 (patch)
tree328f7ea81a4c61d44ac2416adafbf7d2ee1918e3
parentcfc0b18eaa2914717d143cdb110af784283a1462 (diff)
[vim/fzf-tmux] Handle fzf project directory with spaces
Close #583
-rwxr-xr-xbin/fzf-tmux4
-rw-r--r--plugin/fzf.vim4
2 files changed, 4 insertions, 4 deletions
diff --git a/bin/fzf-tmux b/bin/fzf-tmux
index 4de93e28..932b3c08 100755
--- a/bin/fzf-tmux
+++ b/bin/fzf-tmux
@@ -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 \
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index 16220bc5..93611818 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -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)