1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-04 10:41:11 +02:00

completion cleanup, mostly _wanted and $expl (11049)

This commit is contained in:
Sven Wischnowsky 2000-05-02 08:23:31 +00:00
parent 3d088f16aa
commit 753cc6b22a
9 changed files with 20 additions and 16 deletions

View file

@ -1,5 +1,11 @@
2000-05-02 Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
* 11049: Completion/Base/_arguments, Completion/Base/_first,
Completion/Builtins/_hash, Completion/Core/_expand,
Completion/User/_gprof, Completion/User/_mount,
Completion/User/_socket, Completion/User/_urls: completion
cleanup, mostly _wanted and $expl
* 11048: Completion/Base/_first, Completion/Core/_complete,
Completion/Core/_path_files: make completion-in-vared complete
parameter values as default; cleanup for _path_files

View file

@ -298,14 +298,15 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then
if comparguments -s single; then
_description options expl option
if [[ "$single" = direct ]]; then
compadd "$expl[@]" -QS '' - "${PREFIX}${SUFFIX}"
_all_labels options expl option \
compadd -QS '' - "${PREFIX}${SUFFIX}"
elif [[ "$single" = next ]]; then
compadd "$expl[@]" -Q - "${PREFIX}${SUFFIX}"
_all_labels options expl option \
compadd -Q - "${PREFIX}${SUFFIX}"
elif [[ "$single" = equal ]]; then
compadd "$expl[@]" -QqS= - "${PREFIX}${SUFFIX}"
_all_labels options expl option \
compadd -QqS= - "${PREFIX}${SUFFIX}"
else
tmp1=( "$next[@]" "$direct[@]" "$odirect[@]" "$equal[@]" )
tmp3=( "${(M@)tmp1:#[-+]?[^:]*}" )

View file

@ -33,7 +33,7 @@
# opt=-V
# fi
# if _wanted "$opt" history-words expl "history ($n)" \
# compadd "$expl[@]" -Q - \
# compadd -Q - \
# "${(@)${(@)historywords:#[\$'\"]*}[1,i*10]}"; then
# # We have found at least one matching word, so we switch
# # on menu-completion and make sure that no other

View file

@ -10,7 +10,7 @@ if [[ "$words[2]" = -*d* ]]; then
compadd -q -S '=' - "${(@k)nameddirs}"
fi
elif compset -P 1 '*='; then
_wanted -C value values expl 'executable file' _files "$expl[@]" -g '*(-*)'
_wanted -C value values expl 'executable file' _files -g '*(-*)'
else
_wanted -C name commands expl command compadd -q -S '=' - "${(@k)commands}"
fi

View file

@ -94,10 +94,8 @@ if [[ -z "$compstate[insert]" ]] ;then
else
_tags all-expansions expansions original
if _requested all-expansions; then
_description all-expansions expl 'all expansions'
compadd "$expl[@]" -UQ -qS "$suf" - "$exp"
fi
_requested all-expansions expl 'all expansions' &&
compadd "$expl[@]" -UQ -qS "$suf" - "$exp"
if [[ $#exp -gt 1 ]] && _requested expansions; then
local i normal dir

View file

@ -49,7 +49,7 @@ if [[ -n "$state" ]]; then
expl=function
fi
_wanted functions expl "$expl" \
compadd "$expl[@]" -M 'r:|_=* r:|=*' - "$_gprof_funcs[@]" && ret=0
compadd -M 'r:|_=* r:|=*' - "$_gprof_funcs[@]" && ret=0
else
return 1
fi

View file

@ -540,7 +540,7 @@ fstype)
compset -P '*,'
_wanted types expl 'file system type' \
compadd "$expl[@]" -qS, -M 'L:|no=' - "$fss[@]" && ret=0
compadd -qS, -M 'L:|no=' - "$fss[@]" && ret=0
;;
fsopt)
_tags options || return 1

View file

@ -11,8 +11,7 @@ typeset -A opt_args
[[ $CURRENT -eq 2 ]] &&
{ ! zstyle -T ":completion:${curcontext}:options" prefix-needed ||
[[ "$PREFIX" = -* ]] } &&
_wanted options expl option \
compadd -M 'r:|[_-]=* r:|=*' "$expl[@]" - -version
_wanted options expl option compadd - -version
_arguments -C -s \
'-b[background]' \

View file

@ -104,7 +104,7 @@ case "$scheme" in
while _next_label files expl 'bookmark'; do
_path_files -W "$urls_path/$scheme" "$expl[@]" -S '' -g '*(^/)' &&
ret=0
_path_files -W "$urls_path/$scheme" -S/ -r '/' -/ && ret=0
_path_files -W "$urls_path/$scheme" "$expl[@]" -S/ -r '/' -/ && ret=0
done
(( ret )) || return 0
done