summaryrefslogtreecommitdiff
path: root/Completion/Zsh
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Zsh')
-rw-r--r--Completion/Zsh/Command/_cd11
-rw-r--r--Completion/Zsh/Command/_fc2
-rw-r--r--Completion/Zsh/Command/_kill8
-rw-r--r--Completion/Zsh/Command/_typeset77
-rw-r--r--Completion/Zsh/Command/_vared2
-rw-r--r--Completion/Zsh/Command/_zle1
-rw-r--r--Completion/Zsh/Command/_zparseopts2
-rw-r--r--Completion/Zsh/Context/_dynamic_directory_name30
-rw-r--r--Completion/Zsh/Context/_equal10
-rw-r--r--Completion/Zsh/Context/_parameter5
-rw-r--r--Completion/Zsh/Context/_redirect3
-rw-r--r--Completion/Zsh/Context/_subscript3
-rw-r--r--Completion/Zsh/Type/_command_names10
-rw-r--r--Completion/Zsh/Type/_globquals1
-rw-r--r--Completion/Zsh/Type/_module_math_func2
-rw-r--r--Completion/Zsh/Type/_parameters7
-rw-r--r--Completion/Zsh/Type/_ps123423
-rw-r--r--Completion/Zsh/Type/_suffix_alias_files1
18 files changed, 129 insertions, 69 deletions
diff --git a/Completion/Zsh/Command/_cd b/Completion/Zsh/Command/_cd
index 46237e73d..9ca846c8f 100644
--- a/Completion/Zsh/Command/_cd
+++ b/Completion/Zsh/Command/_cd
@@ -70,8 +70,15 @@ else
tmpcdpath=(${${(@)cdpath:#.}:#$PWD})
- (( $#tmpcdpath )) &&
- alt=( 'path-directories:directory in cdpath:_path_files -W tmpcdpath -/' )
+ if zstyle -t ":completion:${curcontext}:path-directories" separate-sections; then
+ local elem
+ for ((elem=1; elem <= $#tmpcdpath; elem++)); do
+ alt+=( "path-directories-${elem}:directory in ${tmpcdpath[$elem]}:_path_files -W 'tmpcdpath[$elem]' -/" )
+ done
+ else
+ (( $#tmpcdpath )) &&
+ alt=( 'path-directories:directory in cdpath:_path_files -W tmpcdpath -/' )
+ fi
# With cdablevars, we can complete foo as if ~foo/
if [[ -o cdablevars && -n "$PREFIX" && "$PREFIX" != <-> ]]; then
diff --git a/Completion/Zsh/Command/_fc b/Completion/Zsh/Command/_fc
index 80e570c5d..626d35956 100644
--- a/Completion/Zsh/Command/_fc
+++ b/Completion/Zsh/Command/_fc
@@ -40,7 +40,7 @@ fc_hist=(
'(-A -R -W -e -d -E -i -t -a -p -P)-f[mm/dd/yyyy format time-stamps]'
'(-A -R -W -e -d -f -i -t -a -p -P)-E[dd.mm.yyyy format time-stamps]'
'(-A -R -W -e -d -f -E -t -a -p -P)-i[yyyy-mm-dd format time-stamps]'
- '(-A -R -W -e -d -f -E -i -a -p -P)-t[print time-stamps in specified format]:date format'
+ '(-A -R -W -e -d -f -E -i -a -p -P)-t[print time-stamps in specified format]: : _date_formats zsh'
'(-A -R -W -e -a -p -P)-D[print elapsed times]'
'(-A -R -W -I -e -d -f -i -l -m -n -r -D -E -t -P)-a[with -p, automatically pop history on function return]'
diff --git a/Completion/Zsh/Command/_kill b/Completion/Zsh/Command/_kill
index b9dfde3f0..3b5c02151 100644
--- a/Completion/Zsh/Command/_kill
+++ b/Completion/Zsh/Command/_kill
@@ -4,9 +4,11 @@ local curcontext="$curcontext" line state ret=1
typeset -A opt_args
_arguments -C \
- '(-s -l 1)-n[specify signal number]:signal number' \
- '(-n -l 1)-s[specify signal name]:signal:_signals -s' \
- '(-n -s)-l[list signal names or numbers of specified signals]:*:signal:_signals' \
+ '(-s -l -L 1)-n[specify signal number]:signal number' \
+ '(-l -L)-q[send the specified integer with the signal using sigqueue]:value' \
+ '(-n -l -L 1)-s[specify signal name]:signal:_signals -s' \
+ '-l[list signal names or numbers of specified signals]:*:signal:_signals' \
+ '(- *)-L[list each signal and corresponding number]' \
'(-n -s -l)1::signal:_signals -p -s' \
'*:processes:->processes' && ret=0
diff --git a/Completion/Zsh/Command/_typeset b/Completion/Zsh/Command/_typeset
index 058842378..99b9e7e0d 100644
--- a/Completion/Zsh/Command/_typeset
+++ b/Completion/Zsh/Command/_typeset
@@ -1,80 +1,87 @@
-#compdef autoload declare export functions integer float local readonly typeset
+#compdef autoload declare export functions integer float local nameref private readonly typeset
local expl state state_descr line func i use curcontext="$curcontext" ret=1
local fopts="-f -k -z +k +z"
-local popts="-A -E -F -L -R -T -Z -a -g -h -H -i -l -r -x"
+local popts="-A +A -E +E -F +F -L +L -R +R -T -Z +Z -a +a -g +g -h +h -H +H -i +i -l +l -n +n -r +r -x +x"
local -A allargs opt_args
local -a args
allargs=(
- A "($fopts -E -F -L -R -T -U -Z -a -i -m)-A[specify that arguments refer to associative arrays]"
- E "($fopts -A -F -L -R -T -U -Z -a -i -m)-E[floating point, use engineering notation on output]"
- F "($fopts -A -E -L -R -T -U -Z -a -i -m)-F[floating point, use fixed point decimal on output]"
- L "($fopts -A -E -F -i)-L+[left justify and remove leading blanks from value]:width"
- R "($fopts -A -E -F -i)-R+[right justify and fill with leading blanks]:width"
- T "($fopts -A -E -F -a -g -h -i -l -m -t)-T[tie scalar to array or trace function]"
- Tf "($popts -t)-T[trace execution of this function only]"
- Tp "($fopts -A -E -F -a -g -h -i -l -m -t)-T[tie scalar to array]"
- U '(-A -E -F -i)-U[keep array values unique and suppress alias expansion for functions]'
+ A "($fopts -A +A -E +E -F +F -L +L -R +R -T -U +U -Z +Z -a +a -i +i -m +m -n +n)-+A[specify that arguments refer to associative arrays]"
+ E "($fopts -A +A -E +E -F +F -L +L -R +R -T -U +U -Z +Z -a +a -i +i -m +m -n +n)-+E[floating point, use engineering notation on output]"
+ F "($fopts -A +A -E +E -F +F -L +L -R +R -T -U +U -Z +Z -a +a -i +i -m +m -n +n)-+F[floating point, use fixed point decimal on output]"
+ L "($fopts -A +A -E +E -F +F -L +L -R +R -i -n +n)-+L+[left justify and remove leading blanks from value]:width"
+ R "($fopts -A +A -E +E -F +F -L +L -R +R -i -n +n)-+R+[right justify and fill with leading blanks]:width"
+ T "($fopts -A +A -E -F -a +a -g -h -i -l +l -m +m -n +n -t)-T[tie scalar to array or trace function]"
+ Tf "($popts -t +t -T +T)-+T[trace execution of this function only]"
+ Tp "($fopts -A +A -E +E -F +F -a +a -g -h -i -l +l -m +m -n +n -t)-T[tie scalar to array]"
+ U '(-A +A -E +E -F +F -i)-U[keep array values unique and suppress alias expansion for functions]'
Uf '-U[suppress alias expansion for functions]'
- Up '(-E -F -i)-+U[keep array values unique]'
+ Up '(-E +E -F +F -i -n +n)-+U[keep array values unique]'
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]"
+ Z "($fopts -A +A -E +E -F +F -Z +Z -i -n +n)-+Z+[right justify and fill with leading zeros]:width"
+ a "($fopts -A +A -E +E -F +F -T -i +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]"
+ f "($popts -f +f)-+f[specify that arguments refer to functions]"
+ g "($fopts -T)-+g[don't restrict parameter to local scope]"
+ h "($fopts -T -n +n)-+h[hide specialness of parameter]"
H "($fopts -T)-+H[hide value of parameter in listings]"
- i "($fopts -A -E -F -T)-+i[represent internally as an integer]"
+ i "($fopts -A +A -E +E -F +F -T -n +n)-+i[represent internally as an integer]"
k "($popts -w -z)-+k[mark function for ksh-style autoloading]"
- l "($popts -T)-l[convert the value to lowercase]"
- m '(-A -E -F -T -i)-m[treat arguments as patterns]'
+ l "($popts -T -n +n)-+l[convert the value to lowercase]"
+ m '(-A +A -E +E -F +F -T -i -n)-+m[treat arguments as patterns]'
+ n "($fopts -A +A -E +E -F +F -L -R -T -U +U -Z +Z -a +a -i +i -h +h -l +l -m +m -t +t -x +x)-+n[make parameter a reference to another parameter]"
p '-p+[output parameters in form of calls to typeset]::option:((1\:multi-line\ output\ of\ arrays))'
- r '(-f)-+r[mark parameters as readonly]'
+ r '(-f -r +r)-+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]'
+ t '(-T -n +n)-+t[tag parameters and turn on execution tracing for functions]'
+ tf '(-t +t -T +T)-+t[turn on execution tracing for functions]'
+ tp '(-T -n +n)-+t[tag parameters]'
u '-u[convert the value to uppercase or mark function for autoloading]'
- uf '-u[mark function for autoloadling]'
- up '-u[convert the value to uppercase]'
+ uf '-u[mark function for autoloading]'
+ up '(-u +u)-+u[convert the value to uppercase]'
w '(-k -z)-w[specify that arguments refer to files compiled with zcompile]'
W '-+W[turn on WARN_NESTED_VAR for function]'
- x "($fopts)-+x[export parameter]"
+ x "($fopts -n +n)-+x[export parameter]"
z "($popts -k -w)-+z[mark function for zsh-style autoloading]"
)
+allargs[rp]="$allargs[r]"
-use="AEFHLRTUZafghiklmprtuxz"
+use="AEFHLRTUZafghiklmnprtuxz"
case ${service} in
autoload)
use="URTXdkrtwz"
func=f
;;
- float) use="EFHghlprtux";;
+ float) use="EFHghlprtux" func=p ;;
functions)
use="UkmTtuzW"
func=f
args=(
- '(-k -t -T -u -U -W -x -z -M +M +k +t +W +z)-+M[define mathematical function]'
- '(-k -m -t -T -u -U -W -x -z +M +k +t +W +z)-s[define mathematical function that takes a string argument]'
+ '(-k -t -T +T -u -U -W -x -z -M +M +k +t +W +z)-+M[define mathematical function]'
+ '(-k -m +m -t -T +T -u -U -W -x -z +M +k +t +W +z)-s[define mathematical function that takes a string argument]'
'(-M)-x+[specify spaces to use for indentation]:spaces'
'(-* +*)-c[copy shell function to another name]:old name:_functions:new name:_functions'
)
;;
integer)
use="Hghilprtux"
+ func=p
allargs[i]='-i+[specify arithmetic base for output]:: :_guard "[0-9]#" base' \
;;
- readonly) use="${use/r/}" ;;
- local) use="${use//[fgkz]/}" ;;
- export) use="${use//[fgkxz]/}" ;;
+ readonly) use="${use//[nr]/}" func=p ;;
+ local) use="${use//[fgkpz]/}" func=p ;;
+ export) use="${use//[fgknxz]/}" func=p ;;
+ nameref) use="gpur" func=p ;;
+ private) use="${use//[fgkpzT]/}" func=p ;;
esac
-[[ -z "${words[(r)-*[aA]*]}" ]] || func=p
+[[ -z "${words[(r)-*[AEFHLRTZaghinrx]*]}" ]] || func=p
[[ -z "${words[(r)-*f*]}" ]] || func=f
+[[ $service = nameref || -n "${words[(r)-*n*]}" ]] &&
+ allargs[up]='-u[reference the upper (calling function) scope]'
# This function uses whacky features of _arguments which means we
# need to look for options to the command beforehand.
diff --git a/Completion/Zsh/Command/_vared b/Completion/Zsh/Command/_vared
index aba64880a..e7072ca6d 100644
--- a/Completion/Zsh/Command/_vared
+++ b/Completion/Zsh/Command/_vared
@@ -10,5 +10,7 @@ _arguments -s -A "-*" \
'-f+[specify finish widget]:widget:_widgets' \
'-h[allow access to history]' \
'-e[exit on EOF (^D)]' \
+ '-M+[specify keymap to link to main]:keymap:compadd -a keymaps' \
+ '-m+[specify keymap to link to vicmd]:keymap:compadd -a keymaps' \
'1:parameter spec:_vars'
diff --git a/Completion/Zsh/Command/_zle b/Completion/Zsh/Command/_zle
index 0b8ef7a15..97ec8c875 100644
--- a/Completion/Zsh/Command/_zle
+++ b/Completion/Zsh/Command/_zle
@@ -23,6 +23,7 @@ _arguments -s -S \
\(${(j. .)opts:#-[La]}')-l+[list user-defined widgets]:*:-:->listing' \
\(${(j. .)opts:#-l}')-a[with -l, list all widgets]' \
"(: * ${(j. .)opts:#-[Lw]})-F[install file descriptor handler]:file descriptor:_file_descriptors::handler:_functions" \
+ "($opts)-I[invalidate the current zle display]" \
"!($opts)-K:keymap:compadd -a keymaps" \
"($opts)-M[display message]:message: " \
"($opts)-N[define new widget]:widget name:->widget-or-function ::widget shell function:->function" \
diff --git a/Completion/Zsh/Command/_zparseopts b/Completion/Zsh/Command/_zparseopts
index e13a91081..ae81937c1 100644
--- a/Completion/Zsh/Command/_zparseopts
+++ b/Completion/Zsh/Command/_zparseopts
@@ -10,8 +10,10 @@ _arguments -A '-*' : \
'-D[remove parsed options from positional parameters]' \
"-E[don't stop parsing at first parameter not described by specs]" \
'-F[abort parsing and print error at first option-like parameter not described by specs]' \
+ '-G[enable GNU-style parsing]' \
'-K[preserve contents of arrays/associations when specs are not matched]' \
'-M[enable mapping among equivalent options with opt1=opt2 spec form]' \
+ '-v+[specify array from which to parse options]:array:_parameters -g "*array*"' \
'(-)-[end zparseopts options; specs follow]' \
'*: :->spec' \
&& ret=0
diff --git a/Completion/Zsh/Context/_dynamic_directory_name b/Completion/Zsh/Context/_dynamic_directory_name
index f449c3b12..5e0d73a8d 100644
--- a/Completion/Zsh/Context/_dynamic_directory_name
+++ b/Completion/Zsh/Context/_dynamic_directory_name
@@ -1,15 +1,29 @@
#autoload
+local -a dirfuncs=(
+ ${(k)functions[zsh_directory_name]}
+ $zsh_directory_name_functions
+)
+local descr='dynamically named directory'
-local func
-integer ret=1
+if (( $#dirfuncs )); then
+ local -a expl
+ local -i ret
+ local func suf tag=dynamically-named-directories
-if [[ -n $functions[zsh_directory_name] || \
- ${+zsh_directory_name_functions} -ne 0 ]] ; then
- [[ -n $functions[zsh_directory_name] ]] && zsh_directory_name c && ret=0
- for func in $zsh_directory_name_functions; do
- $func c && ret=0
+ [[ $ISUFFIX != \]* ]] &&
+ suf=-S]
+
+ _tags "$tag"
+ while _tags; do
+ while _next_label "$tag" expl "$descr" $suf; do
+ for func in $dirfuncs; do
+ $func c && ret=0
+ done
+ done
+ (( ret )) || break
done
return ret
+
else
- _message 'dynamic directory name: implemented as zsh_directory_name c'
+ _message "${descr}: implement as zsh_directory_name c"
fi
diff --git a/Completion/Zsh/Context/_equal b/Completion/Zsh/Context/_equal
index 58a415d56..5cdeea264 100644
--- a/Completion/Zsh/Context/_equal
+++ b/Completion/Zsh/Context/_equal
@@ -1,3 +1,11 @@
#compdef -equal-
-_path_commands
+local -a match mbegin mend
+
+if _have_glob_qual $PREFIX; then
+ compset -p ${#match[1]}
+ compset -S '[^\)\|\~]#(|\))'
+ _globquals
+else
+ _path_commands
+fi
diff --git a/Completion/Zsh/Context/_parameter b/Completion/Zsh/Context/_parameter
index 7e7788535..b08d665f5 100644
--- a/Completion/Zsh/Context/_parameter
+++ b/Completion/Zsh/Context/_parameter
@@ -1,3 +1,8 @@
#compdef -parameter-
+if compset -P '*:'; then
+ _history_modifiers p
+ return
+fi
+
_parameters -e
diff --git a/Completion/Zsh/Context/_redirect b/Completion/Zsh/Context/_redirect
index e6da5d115..520a7666e 100644
--- a/Completion/Zsh/Context/_redirect
+++ b/Completion/Zsh/Context/_redirect
@@ -15,4 +15,5 @@ if [[ "$CURRENT" != "1" ]]; then
fi
fi
-_dispatch -redirect-,{${compstate[redirect]},-default-},${^strs}
+_dispatch -redirect-,${compstate[redirect]},$_comp_command \
+ -redirect-,{${compstate[redirect]},-default-},${^strs}
diff --git a/Completion/Zsh/Context/_subscript b/Completion/Zsh/Context/_subscript
index 25cedd193..67bad2862 100644
--- a/Completion/Zsh/Context/_subscript
+++ b/Completion/Zsh/Context/_subscript
@@ -98,6 +98,9 @@ elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then
while _tags; do
if _requested indexes; then
ind=( {1..${#${(P)${compstate[parameter]}}}} )
+ if [[ ${ind[-1]} -eq 0 ]]; then
+ ind=()
+ fi
if zstyle -T ":completion:${curcontext}:indexes" verbose; then
list=()
for i in "$ind[@]"; do
diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index 12cbd69c1..d445be06e 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -4,7 +4,7 @@
# complete only external commands and executable files. This and a
# `-' as the first argument is then removed from the arguments.
-local args defs expl ffilt
+local args defs expl ffilt verbose
zstyle -t ":completion:${curcontext}:commands" rehash && rehash
@@ -33,13 +33,19 @@ else
defs=( "$defs[@]"
'builtins:builtin command:compadd -Qk builtins'
"functions:shell function:compadd -k 'functions$ffilt'"
- 'aliases:alias:compadd -Qk aliases'
'suffix-aliases:suffix alias:_suffix_alias_files'
'reserved-words:reserved word:compadd -Qk reswords'
'jobs:: _jobs -t'
'parameters:: _parameters -g "^*(readonly|association)*" -qS= -r "\n\t\- =[+"'
'parameters:: _parameters -g "*association*~*readonly*" -qS\[ -r "\n\t\- =[+"'
)
+
+ if zstyle -T ":completion:${curcontext}:aliases" verbose; then
+ printf -v verbose %s:%s\ ${(@q+)${(kv)aliases}[@]//\:/\\:}
+ defs+=( "aliases:alias:(( $verbose ))" )
+ else
+ defs+=( 'aliases:alias:compadd -Qk aliases' )
+ fi
fi
args=( "$@" )
diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals
index bc3165eba..beb47ed30 100644
--- a/Completion/Zsh/Type/_globquals
+++ b/Completion/Zsh/Type/_globquals
@@ -268,6 +268,7 @@ case $state in
"P:prepend word"
"Y:+ at most ARG matches"
"[:+ range of files"
+ ",:logical OR"
"):end of qualifiers"
"\::modifier"
)
diff --git a/Completion/Zsh/Type/_module_math_func b/Completion/Zsh/Type/_module_math_func
index 5044bdf4c..e92b78b71 100644
--- a/Completion/Zsh/Type/_module_math_func
+++ b/Completion/Zsh/Type/_module_math_func
@@ -2,7 +2,7 @@
local mod
local -a funcs alts
-local -a modules=( example mathfunc system )
+local -a modules=( example mathfunc system random )
for mod in $modules; do
funcs=( ${${${(f)"$(zmodload -Fl zsh/$mod 2>/dev/null)"}:#^+f:*}##+f:} )
diff --git a/Completion/Zsh/Type/_parameters b/Completion/Zsh/Type/_parameters
index b5da45c58..7b7692a3c 100644
--- a/Completion/Zsh/Type/_parameters
+++ b/Completion/Zsh/Type/_parameters
@@ -6,11 +6,6 @@
# If you specify a -g option with a pattern, the pattern will be used to
# restrict the type of parameters matched.
-if compset -P '*:'; then
- _history_modifiers p
- return
-fi
-
local i pfilt
local -i nm=$compstate[nmatches]
local -a expl pattern=( -g \* ) normal described verbose faked fakes tmp
@@ -21,7 +16,7 @@ zstyle -t ":completion:${curcontext}:parameters" prefix-needed &&
_description parameters expl parameter
zparseopts -D -K -E g:=pattern
-if zstyle -t ":completion:${curcontext}:parameters" extra-verbose; then
+if zstyle -t ":completion:${curcontext}:parameters" verbose; then
described=(
"${(@M)${(@k)parameters[(R)$~pattern[2]~*(hideval|local|special)*]}:#$~pfilt*}"
)
diff --git a/Completion/Zsh/Type/_ps1234 b/Completion/Zsh/Type/_ps1234
index 0ea2cdda9..e4391dc00 100644
--- a/Completion/Zsh/Type/_ps1234
+++ b/Completion/Zsh/Type/_ps1234
@@ -1,17 +1,18 @@
-#compdef -value-,PROMPT,-default- -value-,PROMPT2,-default- -value-,PROMPT3,-default- -value-,PROMPT4,-default- -value-,RPROMPT,-default- -value-,RPROMPT2,-default- -value-,PS1,-default- -value-,PS2,-default- -value-,PS3,-default- -value-,PS4,-default- -value-,RPS1,-default- -value-,RPS2,-default- -value-,SPROMPT,-default-
+#compdef -value-,PROMPT,-default- -value-,PROMPT2,-default- -value-,PROMPT3,-default- -value-,PROMPT4,-default- -value-,RPROMPT,-default- -value-,RPROMPT2,-default- -value-,PS1,-default- -value-,PS2,-default- -value-,PS3,-default- -value-,PS4,-default- -value-,RPS1,-default- -value-,RPS2,-default- -value-,SPROMPT,-default- -value-,PROMPT_EOL_MARK,-default-
-local -a specs ccol
-local expl grp cols bs suf pre changed=1 ret=1
+local -a specs ccol suf
+local expl grp cols bs pre changed=1 ret=1
local -A ansi
[[ -z $compstate[quote] ]] && bs='\'
+suf=( -S '' )
# first strip off any complete prompt specifications leaving only the
# current, incomplete, one
while (( changed )); do
changed=0
- compset -P '%[DFK](\\|){[^}]#}' && changed=1 # formats with arg: %x{...}
- compset -P '%[0-9-\\]#[^DFK(0-9-<>\\\[]' && changed=1 # normal formats
+ compset -P '%[DFHK](\\|){[^}]#}' && changed=1 # formats with arg: %x{...}
+ compset -P '%[0-9-\\]#[^DFHK(0-9-<>\\\[]' && changed=1 # normal formats
compset -P '%[0-9-\\]#(<[^<]#<|>[^>]#>|\[[^\]]#\])' && changed=1 # truncations
compset -P '%[0-9-\\]#(\\|)\([0-9-]#[^0-9]?|[^%]' && changed=1 # start of ternary
compset -P '[^%]##' && changed=1 # sundry other characters
@@ -41,15 +42,15 @@ if compset -P '%[FK]'; then
grp="$expl[expl[(i)-J]+1]"
print -v ccol -f "($grp)=%s=%s" ${(kv)ansi}
_comp_colors+=( $ccol )
- compadd "$expl[@]" $suf $pre -k ansi && ret=0
- if (( $#suf )) && compset -P "(<->|%v)"; then
+ compadd "$expl[@]" "$suf[@]" $pre -k ansi && ret=0
+ if [[ $ISUFFIX != (\\|)}* ]] && compset -P "(<->|%v)"; then
_wanted ansi-colors expl 'closing brace' compadd -S '' \} && ret=0
elif (( $+terminfo[colors] )); then
(( cols = $terminfo[colors] - 1 ))
(( cols = cols > 255 ? 255 : cols ))
_description -V terminal-colors expl 'terminal color'
grp="$expl[expl[(i)-J]+1]"
- compadd "$expl[@]" $suf $pre {0..$cols}
+ compadd "$expl[@]" "$suf[@]" $pre {0..$cols}
for c in {0..$cols}; do
_comp_colors+=( "($grp)=${c}=${${${(%):-%F{$c\}}#?\[}%m}" )
done
@@ -93,11 +94,14 @@ elif compset -P '%[0-9-\\]#(\\|)\([0-9-]#'; then
'w:day of week (Sunday = 0)'
)
[[ $IPREFIX != *- ]] && _describe -t ternary-prompt-expressions \
- 'ternary prompt format test character' specs $suf && ret=0
+ 'ternary prompt format test character' specs "$suf[@]" && ret=0
_message -e numbers number
elif compset -P '%D(\\|){'; then
compset -S '(\\|)}*'
_date_formats zsh && ret=0
+elif compset -P '%H(\\|){'; then
+ compset -S '(\\|)}*' || suf=( -S "$bs}" )
+ _wanted highlight-groups expl 'highlight group' compadd "$suf[@]" -k .zle.hlgroups && ret=0
elif [[ -prefix '%' ]] ||
! zstyle -t ":completion:${curcontext}:prompt-format-specifiers" prefix-needed
then
@@ -152,6 +156,7 @@ then
'B:start bold'
'b:stop bold'
'E:clear to end of line'
+ 'H{:use highlight group'
'U:start underline'
'u:stop underline'
'S:start standout'
diff --git a/Completion/Zsh/Type/_suffix_alias_files b/Completion/Zsh/Type/_suffix_alias_files
index 1c2c8ebb5..b6fa4e7f5 100644
--- a/Completion/Zsh/Type/_suffix_alias_files
+++ b/Completion/Zsh/Type/_suffix_alias_files
@@ -16,6 +16,7 @@ else
tmpa=(${(kq)saliases})
pat="*.(${(kj.|.)tmpa})"
fi
+[[ -o autocd ]] || pat+='(#q^/)'
# _wanted is called for us by _command_names
_path_files "$@" -g $pat