about summary refs log tree commit diff
path: root/Completion/Core
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-02-18 09:37:17 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-02-18 09:37:17 +0000
commita76b8ea1a52442c2a287db12305b34c3e2b16f7f (patch)
tree61364d752642aa090038bb0dcfa587d1ce662c3c /Completion/Core
parent680a2161a4cd2b26373408a3ca5f935ab17cc43d (diff)
downloadzsh-a76b8ea1a52442c2a287db12305b34c3e2b16f7f.tar.gz
zsh-a76b8ea1a52442c2a287db12305b34c3e2b16f7f.tar.xz
zsh-a76b8ea1a52442c2a287db12305b34c3e2b16f7f.zip
zsh-workers/9787
Diffstat (limited to 'Completion/Core')
-rw-r--r--Completion/Core/_expand15
1 files changed, 8 insertions, 7 deletions
diff --git a/Completion/Core/_expand b/Completion/Core/_expand
index 8279a1406..eee3f9b81 100644
--- a/Completion/Core/_expand
+++ b/Completion/Core/_expand
@@ -34,9 +34,9 @@ zstyle -s ":completion:${curcontext}:" substitute expr &&
 
 # If the array is empty, store the original string again.
 
-[[ -z "$exp" ]] && exp=("$word")
+(( $#exp )) || exp=("$word")
 
-subd="$exp"
+subd=("$exp[@]")
 
 # Now try globbing.
 
@@ -47,14 +47,15 @@ zstyle -s ":completion:${curcontext}:" glob expr &&
 # If we don't have any expansions or only one and that is the same
 # as the original string, we let other completers run.
 
-[[ $#exp -eq 0 ||
-   ( $#exp -eq 1 && "$exp[1]" = "$word"(|\(N\)) ) ]] && return 1
+(( $#exp )) || exp=("$subd[@]")
+
+[[ $#exp -eq 1 && "$exp[1]" = "$word"(|\(N\)) ]] && return 1
 
 # With subst-globs-only we bail out if there were no glob expansions,
 # regardless of any substitutions
+
 zstyle -s ":completion:${curcontext}:" subst-globs-only expr &&
-    [[ "${(e):-\$[$expr]}" -eq 1 ]] &&
-    [[ "$subd" = "$exp"(|\(N\)) ]] && return 1
+    [[ "${(e):-\$[$expr]}" -eq 1 && "$subd" = "$exp"(|\(N\)) ]] && return 1
 
 # Now add as matches whatever the user requested.
 
@@ -76,7 +77,7 @@ else
   _requested all-expansions expl 'all expansions' "o:$word" &&
       compadd "$expl[@]" -UQ -qS "$suf" - "$exp"
 
-  if _requested expansions; then
+  if [[ $#exp -gt 1 ]] && _requested expansions; then
     if [[ "$sort" = menu ]]; then
       _description expansions expl expansions "o:$word"
     else