summaryrefslogtreecommitdiff
path: root/Completion/Zsh
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Zsh')
-rw-r--r--Completion/Zsh/Command/_fc2
-rw-r--r--Completion/Zsh/Command/_typeset24
-rw-r--r--Completion/Zsh/Context/_brace_parameter2
-rw-r--r--Completion/Zsh/Context/_value1
-rw-r--r--Completion/Zsh/Function/_add-zle-hook-widget1
-rw-r--r--Completion/Zsh/Function/_add-zsh-hook1
6 files changed, 21 insertions, 10 deletions
diff --git a/Completion/Zsh/Command/_fc b/Completion/Zsh/Command/_fc
index 6cc01f32d..dd014e7d7 100644
--- a/Completion/Zsh/Command/_fc
+++ b/Completion/Zsh/Command/_fc
@@ -1,6 +1,6 @@
#compdef fc history r
-local curcontext="$curcontext" state state_descr line ret=1
+local curcontext="$curcontext" state state_descr line expl ret=1
local num cmd sep
local -a events
typeset -A opt_args
diff --git a/Completion/Zsh/Command/_typeset b/Completion/Zsh/Command/_typeset
index 94f63cf7e..160150234 100644
--- a/Completion/Zsh/Command/_typeset
+++ b/Completion/Zsh/Command/_typeset
@@ -21,6 +21,7 @@ allargs=(
X '+X[immediately autoload function]'
Z "($fopts -A -E -F -i)-Z+[right justify and fill with leading zeros]:width"
a "($fopts -A -E -F -T -i)-a[specify that arguments refer to arrays]"
+ df "-d[default absolute path autoload to fpath]"
f "($popts)-f[specify that arguments refer to functions]"
g "($fopts -T)-+g[do not restrict parameter to local scope]"
h "($fopts -T)-+h[hide specialness of parameter]"
@@ -31,6 +32,8 @@ allargs=(
m '(-A -E -F -T -i)-m[treat arguments as patterns]'
p '-p[output parameters in form of calls to typeset]'
r '(-f)-+r[mark parameters as readonly]'
+ rf '-r[remember autoload path]'
+ Rf '-R[remember autoload path, error if not found]'
t '(-T)-+t[tag parameters and turn on execution tracing for functions]'
tf '(-T)-+t[turn on execution tracing for functions]'
tp '(-T)-+t[tag parameters]'
@@ -46,7 +49,7 @@ use="AEFHLRTUZafghiklmprtuxz"
case ${service} in
autoload)
- use="UTXktwz"
+ use="URTXdkrtwz"
func=f
;;
float) use="EFHghlprtux";;
@@ -74,7 +77,7 @@ onopts=${(j..)${${words[1,CURRENT-1]:#^-*}##-}}
offopts=${(j..)${${words[1,CURRENT-1]:#^+*}##+}}
for ((i=1;i<=$#use;++i)); do
- args+=( ${allargs[${use[$i]}${${(s::)use[$i]}[(r)[UutT]]:+$func}]} )
+ args+=( ${allargs[${use[$i]}${${(s::)use[$i]}[(r)[dUurRtT]]:+$func}]} )
done
_arguments -C -s -A "-*" -S "${args[@]}" '*::vars:= ->vars_eq'
@@ -90,12 +93,17 @@ if [[ "$state" = vars_eq ]]; then
elif (( $+opt_args[-w] )); then
_wanted files expl 'zwc file' _files -g '*.zwc(-.)'
elif [[ $service = autoload || -n $opt_args[(i)-[uU]] ]]; then
- args=(${^fpath}/*(-.:t))
- # Filter out functions already loaded or marked for autoload.
- local -a funckeys
- funckeys=(${(k)functions})
- args=(${args:|funckeys})
- _wanted functions expl 'shell function' compadd -a args
+ if [[ $PREFIX[1] = [/~] ]]; then
+ # Autoload by absolute path
+ _files
+ else
+ args=(${^fpath}/*(-.:t))
+ # Filter out functions already loaded or marked for autoload.
+ local -a funckeys
+ funckeys=(${(k)functions})
+ args=(${args:|funckeys})
+ _wanted functions expl 'shell function' compadd -a args
+ fi
elif [[ -n $onopts$offopts ]]; then
if [[ -n $offopts ]]; then
args=(${(f)"$(functions +${offopts//[^UXkmtTuz]/})"})
diff --git a/Completion/Zsh/Context/_brace_parameter b/Completion/Zsh/Context/_brace_parameter
index aa1572176..f22db8895 100644
--- a/Completion/Zsh/Context/_brace_parameter
+++ b/Completion/Zsh/Context/_brace_parameter
@@ -141,7 +141,7 @@ if [[ $PREFIX = *'${('[^\)]# ]]; then
flags+=(
"#:evaluate as numeric expression"
"@:double-quoted splitting of scalars"
- "A:create array parameter"
+ "A:assign as an array parameter"
"a:sort in array index order (with O to reverse)"
"b:backslash quote pattern characters only"
"c:count characters in an array (with \${(c)#...})"
diff --git a/Completion/Zsh/Context/_value b/Completion/Zsh/Context/_value
index 47fbc1749..22372ab36 100644
--- a/Completion/Zsh/Context/_value
+++ b/Completion/Zsh/Context/_value
@@ -24,6 +24,7 @@ else
if [[ "$compstate[parameter]" != *-* &&
"$compstate[context]" = *value &&
"${(Pt)${compstate[parameter]}}" = assoc* ]]; then
+ local expl
if (( CURRENT & 1 )); then
_wanted association-keys expl 'association key' \
compadd -k "$compstate[parameter]"
diff --git a/Completion/Zsh/Function/_add-zle-hook-widget b/Completion/Zsh/Function/_add-zle-hook-widget
index 93954a2bb..f108d1868 100644
--- a/Completion/Zsh/Function/_add-zle-hook-widget
+++ b/Completion/Zsh/Function/_add-zle-hook-widget
@@ -11,6 +11,7 @@ _add-zle-hook-widget_types() {
}
_add-zle-hook-widget_widgets() {
+ local expl
if (( $+opt_args[-d] )); then
local -a tmp
zstyle -g tmp $line[1] widgets
diff --git a/Completion/Zsh/Function/_add-zsh-hook b/Completion/Zsh/Function/_add-zsh-hook
index fb5403a60..e8ae97052 100644
--- a/Completion/Zsh/Function/_add-zsh-hook
+++ b/Completion/Zsh/Function/_add-zsh-hook
@@ -1,6 +1,7 @@
#compdef add-zsh-hook
_add-zsh-hook_hooks() {
+ local expl
if (( $+opt_args[-d] )); then
_wanted functions expl "installed hooks" compadd -a - "$line[1]_functions" && return 0
else