summaryrefslogtreecommitdiff
path: root/Completion/Zsh
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Zsh')
-rw-r--r--Completion/Zsh/Command/_zle2
-rw-r--r--Completion/Zsh/Type/_globquals16
2 files changed, 10 insertions, 8 deletions
diff --git a/Completion/Zsh/Command/_zle b/Completion/Zsh/Command/_zle
index 80f217711..2bfc708e5 100644
--- a/Completion/Zsh/Command/_zle
+++ b/Completion/Zsh/Command/_zle
@@ -44,7 +44,7 @@ case "$state[1]" in
'(-)*:widget arguments: ' && ret=0
;;
(widget*)
- _wanted -C "$context[1]" widgets expl widget compadd -k widgets && ret=0
+ _wanted -C "$context[1]" widgets expl "${state_descr[1]:-widget}" compadd -k widgets && ret=0
;&
(function)
[[ $state[1] != *function ]] || # Handle fall-through
diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals
index 778dfa822..9de7742ff 100644
--- a/Completion/Zsh/Type/_globquals
+++ b/Completion/Zsh/Type/_globquals
@@ -1,7 +1,8 @@
#autoload
-local state=qual expl char delim
+local state=qual expl char delim timespec
local -a alts
+local -A specmap
while [[ -n $PREFIX ]]; do
char=$PREFIX[1]
@@ -111,18 +112,19 @@ while [[ -n $PREFIX ]]; do
;;
([amc])
- if ! compset -P '([Mwhms]|)([-+]|)<->'; then
+ if ! compset -P '([Mwhmsd]|)([-+]|)<->'; then
# complete/skip relative time spec
alts=()
- if ! compset -P '[Mwhms]' && [[ -z $PREFIX ]]; then
- alts+=(
- "time-specifiers:time specifier:\
-((M\:months w\:weeks h\:hours m:\minutes s\:seconds))")
+ timespec=$PREFIX[1]
+ if ! compset -P '[Mwhmsd]' && [[ -z $PREFIX ]]; then
+ alts+=("time-specifiers:time specifier:\
+((M\:months w\:weeks h\:hours m:\minutes s\:seconds d\:days))")
fi
if ! compset -P '[-+]' && [[ -z $PREFIX ]]; then
alts+=("senses:sense:((-\:less\ than +\:more\ than))")
fi
- alts+=('digits:digit: ')
+ specmap=( M months w weeks h hours m minutes s seconds '(|+|-|d)' days)
+ alts+=('digits:digit ('${${specmap[(K)$timespec]}:-invalid time specifier}'):' )
_alternative $alts
return
fi