summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-05-10 02:54:22 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-05-10 02:54:22 +0900
commit207aa07891e480bb18a1bc790ea6d9560b24b696 (patch)
treee9bd0eb37f0fef7e8742a17b7af550908e2ea725 /shell
parent26a141c6a6222c73207babbc15f57fc7849d0f61 (diff)
[zsh-completion] Temporarily set nonomatch (#230)
No error on ~INVALID_USERNAME**<TAB>
Diffstat (limited to 'shell')
-rw-r--r--shell/completion.zsh9
1 files changed, 7 insertions, 2 deletions
diff --git a/shell/completion.zsh b/shell/completion.zsh
index 79a9b24d..c9c3276f 100644
--- a/shell/completion.zsh
+++ b/shell/completion.zsh
@@ -11,7 +11,7 @@
# - $FZF_COMPLETION_OPTS (default: empty)
_fzf_path_completion() {
- local base lbuf find_opts fzf_opts suffix tail fzf dir leftover matches
+ local base lbuf find_opts fzf_opts suffix tail fzf dir leftover matches nnm
base=$1
lbuf=$2
find_opts=$3
@@ -20,6 +20,10 @@ _fzf_path_completion() {
tail=$6
[ ${FZF_TMUX:-1} -eq 1 ] && fzf="fzf-tmux -d ${FZF_TMUX_HEIGHT:-40%}" || fzf="fzf"
+ if ! setopt | grep nonomatch > /dev/null; then
+ nnm=1
+ setopt nonomatch
+ fi
dir="$base"
while [ 1 ]; do
if [ -z "$dir" -o -d ${~dir} ]; then
@@ -35,11 +39,12 @@ _fzf_path_completion() {
LBUFFER="$lbuf$matches$tail"
zle redisplay
fi
- return
+ break
fi
dir=$(dirname "$dir")
dir=${dir%/}/
done
+ [ -n "$nnm" ] && unsetopt nonomatch
}
_fzf_all_completion() {