about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Base/_arguments12
2 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 50950590d..f9c6b968c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
 2000-05-16  Sven Wischnowsky  <wischnow@zsh.org>
 
-	* 11403(?): Completion/Core/_expand, Src/Zle/compcore.c,
+	* 11406: Completion/Base/_arguments: make _arguments take the
+ 	attempt to add matches as an indication not to do default
+ 	option-completion
+	
+	* 11403: Completion/Core/_expand, Src/Zle/compcore.c,
 	Src/Zle/complist.c: fix scrolling in menu-selection with matches
 	spanning multiple lines
 	
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 453e3d3e2..8aad10852 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -163,7 +163,7 @@ done
 zstyle -s ":completion:${curcontext}:options" auto-description autod
 
 if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then
-  local action noargs aret expl local
+  local action noargs aret expl local tried
   local next direct odirect equal single match matched ws tmp1 tmp2 tmp3
   local opts subc tc prefix suffix descrs actions subcs
   local origpre="$PREFIX" origipre="$IPREFIX"
@@ -244,6 +244,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then
 
 	      _message "$descr"
 	      mesg=yes
+	      tried=yes
 
             elif [[ "$action" = \(\(*\)\) ]]; then
 
@@ -252,6 +253,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then
               eval ws\=\( "${action[3,-3]}" \)
 
               _describe -t "$subc" "$descr" ws -M "$match" "$subopts[@]"
+	      tried=yes
 
             elif [[ "$action" = \(*\) ]]; then
 
@@ -259,6 +261,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then
 
               _all_labels "$subc" expl "$descr" \
                   compadd "$subopts[@]" - ${=action[2,-2]}
+	      tried=yes
             elif [[ "$action" = \{*\} ]]; then
 
               # A string in braces is evaluated.
@@ -266,6 +269,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then
               while _next_label "$subc" expl "$descr"; do
                 eval "$action[2,-2]"
               done
+	      tried=yes
             elif [[ "$action" = \ * ]]; then
 
               # If the action starts with a space, we just call it.
@@ -274,6 +278,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then
               while _next_label "$subc" expl "$descr"; do
                 "$action[@]"
               done
+	      tried=yes
             else
 
               # Otherwise we call it with the description-arguments.
@@ -282,6 +287,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then
               while _next_label "$subc" expl "$descr"; do
                 "$action[1]" "$subopts[@]" "$expl[@]" "${(@)action[2,-1]}"
 	      done
+	      tried=yes
             fi
           fi
         fi
@@ -293,8 +299,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then
       if [[ -z "$matched$hasopts" ]] && _requested options &&
           { [[ -n "$ismulti" ]] ||
             ! zstyle -T ":completion:${curcontext}:options" prefix-needed ||
-            [[ "$origpre" = [-+]* ||
-               ( -z "$aret$mesg" && nm -eq compstate[nmatches] ) ]] } ; then
+            [[ "$origpre" = [-+]* || -z "$aret$mesg$tried" ]] } ; then
 	local prevpre="$PREFIX" previpre="$IPREFIX"
 
 	hasopts=yes
@@ -351,6 +356,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then
 	PREFIX="$prevpre"
 	IPREFIX="$previpre"
       fi
+      [[ -n "$tried" ]] && break
     done
     if [[ -n "$opts" && -z "$aret$matched$mesg" &&
           nm -eq compstate[nmatches] ]]; then