about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--Completion/Base/Utility/_arguments8
-rw-r--r--Src/Zle/computil.c2
3 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 1848ff3d0..55eff46fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-05-31  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* 14607: Completion/Base/Utility/_arguments, Src/Zle/computil.c:
+	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
+
 2001-05-31  Oliver Kiddle  <opk@zsh.org>
 
 	* unposted: Doc/Makefile.in, Doc/Zsh/compsys.yo: correct alphabetical
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"
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 2c0e119f9..85fde0dba 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -1436,7 +1436,7 @@ ca_parse_line(Cadef d, int multi, int first)
 	    char *p;
 	    Caopt tmpopt;
 
-	    if (sopts && nonempty(sopts))
+	    if (cur != compcurrent && sopts && nonempty(sopts))
 		state.curopt = (Caopt) uremnode(sopts, firstnode(sopts));
 
 	    if (!state.oargs[state.curopt->num])