about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-31 06:11:07 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-31 06:11:07 +0000
commit3beeb8a6fddac8af7dd2a31335c2ce97c3d60e82 (patch)
tree6f6874e655bfd4f648f298c98ab64d1a0c2fed41 /Completion
parent64d9b8310594840494311dde271e93c7668ed807 (diff)
downloadzsh-3beeb8a6fddac8af7dd2a31335c2ce97c3d60e82.tar.gz
zsh-3beeb8a6fddac8af7dd2a31335c2ce97c3d60e82.tar.xz
zsh-3beeb8a6fddac8af7dd2a31335c2ce97c3d60e82.zip
avoid reporting the same ->state more than once (11678)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/_arguments21
1 files changed, 12 insertions, 9 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index da7a7ad4a..a5a39112a 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -223,15 +223,18 @@ if (( $# )) && comparguments -i "$autod" "$@"; then
           fi
 
           if [[ "$action" = -\>* ]]; then
-            comparguments -W line opt_args
-            state=( "$state[@]" "${${action[3,-1]##[ 	]#}%%[ 	]#}" )
-	    if [[ -n "$usecc" ]]; then
-	      curcontext="${oldcontext%:*}:$subc"
-	    else
-	      context=( "$context[@]" "$subc" )
-	    fi
-            compstate[restore]=''
-            aret=yes
+	    action="${${action[3,-1]##[ 	]#}%%[ 	]#}"
+	    if (( ! $state[(I)$action] )); then
+              comparguments -W line opt_args
+              state=( "$state[@]" "$action" )
+	      if [[ -n "$usecc" ]]; then
+	        curcontext="${oldcontext%:*}:$subc"
+	      else
+	        context=( "$context[@]" "$subc" )
+	      fi
+              compstate[restore]=''
+              aret=yes
+            fi
           else
             if [[ -z "$local" ]]; then
               local line