summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2015-11-18 16:09:00 +0100
committerDaniel Hahler <git@thequod.de>2015-11-18 16:09:00 +0100
commit701687faab00833700d3bc81d110119fb7af99da (patch)
treea29c7d7859ac93489c2824b6a5497934299cfedb
parentbbc3055feb810fb4f032f1cd2cea2577da24076c (diff)
zsh: fzf-completion: use noshwordsplit local option
This also fixes the completion causing a bell / flickering in case "shwordsplit" was not set, because then the function would return false.
-rw-r--r--shell/completion.zsh9
1 files changed, 2 insertions, 7 deletions
diff --git a/shell/completion.zsh b/shell/completion.zsh
index a2b07ce8..76ca801d 100644
--- a/shell/completion.zsh
+++ b/shell/completion.zsh
@@ -116,11 +116,8 @@ _fzf_complete_unalias() {
}
fzf-completion() {
- local tokens cmd prefix trigger tail fzf matches lbuf d_cmds sws
- if setopt | \grep shwordsplit > /dev/null; then
- sws=1
- unsetopt shwordsplit
- fi
+ local tokens cmd prefix trigger tail fzf matches lbuf d_cmds
+ setopt localoptions noshwordsplit
# http://zsh.sourceforge.net/FAQ/zshfaq03.html
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags
@@ -163,7 +160,6 @@ fzf-completion() {
else
eval "zle ${fzf_default_completion:-expand-or-complete}"
fi
- [ -n "$sws" ] && setopt shwordsplit
}
[ -z "$fzf_default_completion" ] &&
@@ -171,4 +167,3 @@ fzf-completion() {
zle -N fzf-completion
bindkey '^I' fzf-completion
-