mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-31 20:33:50 -07:00
Merge pull request #423 from blueyed/zsh-fzf-completion-localoptions
zsh: fzf-completion: use noshwordsplit local option
This commit is contained in:
@@ -116,11 +116,8 @@ _fzf_complete_unalias() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fzf-completion() {
|
fzf-completion() {
|
||||||
local tokens cmd prefix trigger tail fzf matches lbuf d_cmds sws
|
local tokens cmd prefix trigger tail fzf matches lbuf d_cmds
|
||||||
if setopt | \grep shwordsplit > /dev/null; then
|
setopt localoptions noshwordsplit
|
||||||
sws=1
|
|
||||||
unsetopt shwordsplit
|
|
||||||
fi
|
|
||||||
|
|
||||||
# http://zsh.sourceforge.net/FAQ/zshfaq03.html
|
# http://zsh.sourceforge.net/FAQ/zshfaq03.html
|
||||||
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags
|
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags
|
||||||
@@ -163,7 +160,6 @@ fzf-completion() {
|
|||||||
else
|
else
|
||||||
eval "zle ${fzf_default_completion:-expand-or-complete}"
|
eval "zle ${fzf_default_completion:-expand-or-complete}"
|
||||||
fi
|
fi
|
||||||
[ -n "$sws" ] && setopt shwordsplit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -z "$fzf_default_completion" ] &&
|
[ -z "$fzf_default_completion" ] &&
|
||||||
@@ -171,4 +167,3 @@ fzf-completion() {
|
|||||||
|
|
||||||
zle -N fzf-completion
|
zle -N fzf-completion
|
||||||
bindkey '^I' fzf-completion
|
bindkey '^I' fzf-completion
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user