From beb429d62fe8b11f9eef67c455bcfdc8fe9f2722 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 4 Nov 1999 09:35:39 +0000 Subject: zsh-workers/8533 --- Completion/Base/_arguments | 2 +- Completion/Base/_describe | 2 +- Completion/Base/_values | 2 +- Completion/Builtins/_kill | 2 +- Completion/Builtins/_wait | 2 +- Completion/Core/_files | 2 +- Completion/Core/_main_complete | 3 ++- Completion/Core/_tags | 12 ++++++++---- 8 files changed, 16 insertions(+), 11 deletions(-) (limited to 'Completion') diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments index 04d588c49..31713750f 100644 --- a/Completion/Base/_arguments +++ b/Completion/Base/_arguments @@ -154,7 +154,7 @@ fi if comparguments -i "$compconfig[autodescribe_options]" "$@"; then local nm="$compstate[nmatches]" action noargs aret expl local local next direct odirect equal single match matched ws tmp1 tmp2 - local prios tags opts + local tags opts if comparguments -D descr action; then if comparguments -O next direct odirect equal; then diff --git a/Completion/Base/_describe b/Completion/Base/_describe index 5355e4d7f..29997e262 100644 --- a/Completion/Base/_describe +++ b/Completion/Base/_describe @@ -3,7 +3,7 @@ # This can be used to add options or values with descriptions as matches. local cmd func opt expl tmps tmpd tmpmd tmpms ret=1 showd _nm hide -local prios tags type=value +local tags type=value cmd="$words[1]" func="$funcstack[2]" diff --git a/Completion/Base/_values b/Completion/Base/_values index 34a5c4097..5c2249929 100644 --- a/Completion/Base/_values +++ b/Completion/Base/_values @@ -2,7 +2,7 @@ if compvalues -i "$@"; then - local tags prios noargs args opts descr action expl sep + local tags noargs args opts descr action expl sep if ! compvalues -D descr action; then diff --git a/Completion/Builtins/_kill b/Completion/Builtins/_kill index a3efbef41..b4fa5fb88 100644 --- a/Completion/Builtins/_kill +++ b/Completion/Builtins/_kill @@ -6,7 +6,7 @@ if compset -P 1 -; then _description expl signal compadd "$expl[@]" $signals[1,-3] else - local prios tags ret=1 + local tags ret=1 _tags job process diff --git a/Completion/Builtins/_wait b/Completion/Builtins/_wait index 0f096355f..0b58367f1 100644 --- a/Completion/Builtins/_wait +++ b/Completion/Builtins/_wait @@ -1,6 +1,6 @@ #compdef wait -local prios tags list ret=1 expl +local tags list ret=1 expl _tags job process diff --git a/Completion/Core/_files b/Completion/Core/_files index e667289c5..4adae0f73 100644 --- a/Completion/Core/_files +++ b/Completion/Core/_files @@ -1,6 +1,6 @@ #autoload -local opts opt type=file prios tags +local opts opt type=file tags opts=() while getopts "P:S:qr:R:W:F:J:V:X:f/g:M:" opt; do diff --git a/Completion/Core/_main_complete b/Completion/Core/_main_complete index 877a975b3..d1d75de7f 100644 --- a/Completion/Core/_main_complete +++ b/Completion/Core/_main_complete @@ -17,8 +17,9 @@ # state than the global one for which you are completing. -local comp post ret=1 _compskip prios tags +local comp post ret=1 _compskip tags _prio_num=1 typeset -U _offered_tags _tried_tags _failed_tags _used_tags _unused_tags +typeset -A _prio_names _offered_tags=() _tried_tags=() diff --git a/Completion/Core/_tags b/Completion/Core/_tags index af8dc21dd..f6a7fdc11 100644 --- a/Completion/Core/_tags +++ b/Completion/Core/_tags @@ -63,17 +63,21 @@ if (( $# )); then done done - prios=( "${(@)tags:#}" ) + prio="_prio_arr$(( _prio_num++ ))" + _prio_names[$funcstack]="$prio" + eval "${prio}=( \"\${(@)tags:#}\" )" return 0 fi +local prios="$_prio_names[$funcstack]" + _failed_tags=( "$_failed_tags[@]" "$_last_tags[@]" ) -(( $#prios )) || return 1 +(( ${(P)#prios} )) || return 1 -tags="${prios[1]}:" -shift 1 prios +tags="${${(@P)prios}[1]}:" +shift 1 "$prios" _last_tags=( "${(@s.:.)${${tags#:}%:}}" ) _tried_tags=( "$_tried_tags[@]" "$_last_tags[@]" ) -- cgit 1.4.1