From 8bc41ba869dbbd3c6bc2c8f2338c740311074f23 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Wed, 15 Dec 1999 17:35:20 +0000 Subject: manual/9058 --- Completion/Core/_tags | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'Completion/Core/_tags') diff --git a/Completion/Core/_tags b/Completion/Core/_tags index fcef91061..e913095c4 100644 --- a/Completion/Core/_tags +++ b/Completion/Core/_tags @@ -4,7 +4,7 @@ if (( $# )); then # We have arguments: the tags supported in this context. - local curcontext="$curcontext" order + local curcontext="$curcontext" order tag nodef if [[ "$1" = -C?* ]]; then curcontext="${curcontext}:${1[3,-1]}" @@ -38,9 +38,24 @@ if (( $# )); then _offered_tags=( "$_offered_tags[@]" "$@" ) _last_tags=() - # Call the function that sorts the tags into sets. + # Sort the tags. - "${_sort_tags:-_sort_tags}" "$@" + if [[ -n "$_sort_tags" ]]; then + "$_sort_tags" "$@" + elif zstyle -a ":completion${curcontext}" tag-order order; then + + for tag in $order; do + case $tag in + -) nodef=yes;; + *\(\)) "${${tag%%[ ]#\(\)}##[ ]#}" "$@";; + ?*) comptry ${=tag};; + esac + done + + [[ -z "$nodef" ]] && comptry "$@" + else + comptry "$@" + fi # Return non-zero if at least one set of tags should be used. -- cgit 1.4.1