about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-05-31 12:38:34 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-05-31 12:38:34 +0000
commit171855e2e23938f40080ca2630d2efc42f319014 (patch)
treedb76e5c94287e7016304f81e56779305d482a8e4 /Completion
parent63a32f3c34a09b0293c10421538b2da63ef9de73 (diff)
downloadzsh-171855e2e23938f40080ca2630d2efc42f319014.tar.gz
zsh-171855e2e23938f40080ca2630d2efc42f319014.tar.xz
zsh-171855e2e23938f40080ca2630d2efc42f319014.zip
fix tag-order problem with _arguments (completion after an option that gets an argument in the same word); and a fix for completion after -ab, where -a gets an argument in the next word and -b gets one in the same word (14607)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/Utility/_arguments8
1 files changed, 5 insertions, 3 deletions
diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments
index 3bd95687d..209785f2d 100644
--- a/Completion/Base/Utility/_arguments
+++ b/Completion/Base/Utility/_arguments
@@ -233,7 +233,7 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then
 	descr="$descrs[anum]"
 	subc="$subcs[anum++]"
 
-        if [[ -n "$matched" ]] || _requested "$subc"; then
+        if [[ -z "$tried" ]] && { [[ -n "$matched" ]] || _requested "$subc" }; then
 
           curcontext="${oldcontext%:*}:$subc"
 
@@ -328,7 +328,8 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then
         fi
       done
       if [[ -z "$hasopts" &&
-            ( -z "$matched" || -n "$alwopt" ) &&
+            -z "$matched" &&
+            ( -z "$tried" || -n "$alwopt" ) &&
             ( -z "$aret" || "$PREFIX" = "$origpre" ) ]] &&
           _requested options &&
           { ! zstyle -T ":completion:${curcontext}:options" prefix-needed ||
@@ -389,7 +390,8 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then
       [[ -n "$tried" && "${${alwopt:+$origpre}:-$PREFIX}" != [-+]* ]] && break
     done
     if [[ -n "$opts" && -z "$aret" &&
-          ( -z "$matched$mesg" || -n "$alwopt" ) &&
+          -z "$matched" &&
+          ( -z "$tried" || -n "$alwopt" ) &&
           nm -eq compstate[nmatches] ]]; then
 
       PREFIX="$origpre"