From 26d2af5ee8b254b5a150728aac428762a6f6e92b Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 12 May 2015 01:40:44 +0900 Subject: [zsh-completion] Respect backslash-escaped spaces (#230) --- shell/completion.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'shell') diff --git a/shell/completion.zsh b/shell/completion.zsh index 299826c1..99cc112c 100644 --- a/shell/completion.zsh +++ b/shell/completion.zsh @@ -12,7 +12,7 @@ _fzf_path_completion() { local base lbuf find_opts fzf_opts suffix tail fzf dir leftover matches nnm - base=$1 + base=${(Q)1} lbuf=$2 find_opts=$3 fzf_opts=$4 @@ -102,7 +102,8 @@ fzf-completion() { local tokens cmd prefix trigger tail fzf matches lbuf d_cmds # http://zsh.sourceforge.net/FAQ/zshfaq03.html - tokens=(${=LBUFFER}) + # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags + tokens=(${(z)LBUFFER}) if [ ${#tokens} -lt 1 ]; then eval "zle ${fzf_default_completion:-expand-or-complete}" return -- cgit v1.2.3