mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-10-03 01:11:37 +02:00
moved to Completion/Base/Core/_tags
This commit is contained in:
parent
4c9dc4a461
commit
069a04e104
@ -1,66 +0,0 @@
|
||||
#autoload
|
||||
|
||||
local prev
|
||||
|
||||
# A `--' as the first argument says that we should tell comptags to use
|
||||
# the preceding function nesting level. This is only documented here because
|
||||
# if everythings goes well, users won't have to worry about it and should
|
||||
# not mess with it.
|
||||
|
||||
if [[ "$1" = -- ]]; then
|
||||
prev=-
|
||||
shift
|
||||
fi
|
||||
|
||||
if (( $# )); then
|
||||
|
||||
# We have arguments: the tags supported in this context.
|
||||
|
||||
local curcontext="$curcontext" order tag nodef tmp
|
||||
|
||||
if [[ "$1" = -C?* ]]; then
|
||||
curcontext="${curcontext%:*}:${1[3,-1]}"
|
||||
shift
|
||||
elif [[ "$1" = -C ]]; then
|
||||
curcontext="${curcontext%:*}:${2}"
|
||||
shift 2
|
||||
fi
|
||||
|
||||
[[ "$1" = -(|-) ]] && shift
|
||||
|
||||
zstyle -a ":completion:${curcontext}:" group-order order &&
|
||||
compgroups "$order[@]"
|
||||
|
||||
# Set and remember offered tags.
|
||||
|
||||
comptags "-i$prev" "$curcontext" "$@"
|
||||
|
||||
# Sort the tags.
|
||||
|
||||
if [[ -n "$_sort_tags" ]]; then
|
||||
"$_sort_tags" "$@"
|
||||
else
|
||||
zstyle -a ":completion:${curcontext}:" tag-order order ||
|
||||
order=('(|*-)argument-* (|*-)option-* values' options)
|
||||
|
||||
for tag in $order; do
|
||||
case $tag in
|
||||
-) nodef=yes;;
|
||||
\!*) comptry "${(@)argv:#(${(j:|:)~${=~tag[2,-1]}})}";;
|
||||
?*) comptry -m "$tag";;
|
||||
esac
|
||||
done
|
||||
|
||||
[[ -z "$nodef" ]] && comptry "$@"
|
||||
fi
|
||||
|
||||
# Return non-zero if at least one set of tags should be used.
|
||||
|
||||
comptags "-T$prev"
|
||||
|
||||
return
|
||||
fi
|
||||
|
||||
# The other mode: switch to the next set of tags.
|
||||
|
||||
comptags "-N$prev"
|
Loading…
Reference in New Issue
Block a user