1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-19 13:33:52 +01:00

*** empty log message ***

This commit is contained in:
Sven Wischnowsky 2000-10-10 14:12:41 +00:00
parent b9f6bdf162
commit 7b35c8639c
4 changed files with 38 additions and 15 deletions

@ -6,20 +6,12 @@
local ret=1
if [[ $PREFIX = *\[* ]]; then
local var=${PREFIX%%\[*}
local elt="${PREFIX#*\]}${SUFFIX%\]}"
local addclose
compstate[parameter]=${PREFIX%%(|\\)\[*}
compset -p $(( ${#var} + 1 ))
if ! compset -S \]; then
addclose=(-S "${${QIPREFIX:+]}:-\]}")
fi
if [[ ${(tP)var} = assoc* ]]; then
local expl
IPREFIX=${PREFIX%%\[*}\[
PREFIX=${PREFIX#*\[}
_wanted -C subscript association-keys expl 'association key' \
compadd $addclose -k "$var"
fi
_subscript -q
else
_parameters -g '^a*' "$@" && ret=0

@ -25,6 +25,7 @@ styles=(
domains c:
expand c:
fake c:fake
fake-parameters c:fake-params
file-patterns c:filepat
file-sort c:fsort
force-list c:
@ -269,6 +270,10 @@ while [[ -n $state ]]; do
_message 'prefix and names'
;;
fake-params)
_message 'name and optional type'
;;
ignline)
_wanted values expl boolean compadd true false current current-shown other
;;

@ -6,10 +6,25 @@
# If you specify a -g option with a pattern, the pattern will be used to
# restrict the type of parameters matched.
local expl pattern
local expl pattern fakes faked tmp
pattern=(-g \*)
zparseopts -D -K -E g:=pattern
_wanted parameters expl parameter compadd "$@" \
-Q -k "parameters[(R)${pattern[2]}~*local*]"
fakes=()
faked=()
if zstyle -a ":completion:${curcontext}:" fake-parameters tmp; then
for i in "$tmp[@]"; do
if [[ "$i" = *:* ]]; then
faked=( "$faked[@]" "$i" )
else
fakes=( "$fakes[@]" "$i" )
fi
done
fi
_wanted parameters expl parameter \
compadd "$@" -Q - \
"${(@k)parameters[(R)${pattern[2]}~*local*]}" \
"$fakes[@]" \
"${(@)${(@M)faked:#${~pattern[2]}}%%:*}"

@ -1020,6 +1020,17 @@ such files really exist.
This can be useful on systems that support special filesystems whose
top-level pathnames can not be listed or generated with glob patterns.
)
kindex(fake-parameters, completion style)
item(tt(fake-parameters))(
This is used by the completion function generating parameter names as
matches. Its values are names of parameters which might not yet be
set, but which should be completed nonetheless. Each name may also be
followed by a colon and a string specifying the type of the parameter
(like `tt(scalar)', `tt(array)' or `tt(integer)'). If such a type is
given, the name will only be completed if parameters of that type are
requested in the particular context. Names for which no type is
specified will always be completed.
)
kindex(file-patterns, completion style)
item(tt(file-patterns))(
In most places where filenames are completed, the function tt(_files)