summaryrefslogtreecommitdiffstats
path: root/Completion/Zsh/Context/_value
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2002-03-13 09:28:04 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2002-03-13 09:28:04 +0000
commit45f9a36216637075172d0bdf7ad8e18fad34c42e (patch)
tree8505f11011505b00e8cef1142b11c2b2e94e17e9 /Completion/Zsh/Context/_value
parent16804: completion for sccs (diff)
downloadzsh-45f9a36216637075172d0bdf7ad8e18fad34c42e.tar
zsh-45f9a36216637075172d0bdf7ad8e18fad34c42e.tar.gz
zsh-45f9a36216637075172d0bdf7ad8e18fad34c42e.tar.bz2
zsh-45f9a36216637075172d0bdf7ad8e18fad34c42e.tar.lz
zsh-45f9a36216637075172d0bdf7ad8e18fad34c42e.tar.xz
zsh-45f9a36216637075172d0bdf7ad8e18fad34c42e.tar.zst
zsh-45f9a36216637075172d0bdf7ad8e18fad34c42e.zip
remove that -T option to compdef again and instead use comma-separated sub-contexts both for function and style lookup (16819)
Diffstat (limited to 'Completion/Zsh/Context/_value')
-rw-r--r--Completion/Zsh/Context/_value32
1 files changed, 12 insertions, 20 deletions
diff --git a/Completion/Zsh/Context/_value b/Completion/Zsh/Context/_value
index 9d0acaa0e..15732f22c 100644
--- a/Completion/Zsh/Context/_value
+++ b/Completion/Zsh/Context/_value
@@ -1,4 +1,4 @@
-#compdef -value- -array-value- -T values -default-
+#compdef -value- -array-value- -value-,-default-,-default-
# You can customize completion for different parameters by writing
# functions with the tag-line `#compdef -T value <name>'.
@@ -6,30 +6,20 @@
# and `<param-name>'. If the line contains a command (as in `make foo=<TAB>')
# the string `<command>:<param-name>:<param-type>' is also searched for.
-if [[ "$service" != -default- ]]; then
- local strs type
+if [[ "$service" != -value-,* ]]; then
+ local strs ctx=
- type="${(Pt)compstate[parameter]}"
-
- if [[ -z "$type" ]]; then
- if [[ "$compstate[parameter]" = *-* ]]; then
- type=association-value
- elif [[ "$compstate[context]" = value ]]; then
- type=scalar
- else
- type=array
- fi
- fi
-
- strs=( "${compstate[parameter]}:$type" "$compstate[parameter]" )
+ strs=( -default- )
if [[ "$compstate[context]" != *value && -n "$_comp_command1" ]]; then
- strs=( "${_comp_command1}:$^strs[@]" "$strs[@]" )
+ ctx="${_comp_command}"
+ strs=( "${_comp_command1}" "$strs[@]" )
[[ -n "$_comp_command2" ]] &&
- strs=( "${_comp_command2}:${(@)^strs[-2,-1]}" "$strs[@]" )
+ strs=( "${_comp_command2}" "$strs[@]" )
fi
- _dispatch -d values "$strs[@]"
+ _dispatch -value-,${compstate[parameter]},$ctx \
+ -value-,{${compstate[parameter]},-default-},${^strs}
else
if [[ "$compstate[parameter]" != *-* &&
"$compstate[context]" = *value &&
@@ -39,7 +29,9 @@ else
compadd -k "$compstate[parameter]"
else
compstate[parameter]="${compstate[parameter]}-${words[CURRENT-1]}"
- _value "$@"
+
+ _dispatch -value-,${compstate[parameter]}, \
+ -value-,{${compstate[parameter]},-default-},-default-
fi
else
local pats