From 3beeb8a6fddac8af7dd2a31335c2ce97c3d60e82 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Wed, 31 May 2000 06:11:07 +0000 Subject: avoid reporting the same ->state more than once (11678) --- ChangeLog | 5 +++++ Completion/Base/_arguments | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 331747395..9af3d33ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-05-31 Sven Wischnowsky + + * 11678: Completion/Base/_arguments: avoid reporting the same + ->state more than once + 2000-05-30 Oliver Kiddle * 11661: Src/hist.c: AIX dependency fix 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 -- cgit 1.4.1