1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-10 00:31:07 +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> 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, * 11048: Completion/Base/_first, Completion/Core/_complete,
Completion/Core/_path_files: make completion-in-vared complete Completion/Core/_path_files: make completion-in-vared complete
parameter values as default; cleanup for _path_files parameter values as default; cleanup for _path_files

View file

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

View file

@ -33,7 +33,7 @@
# opt=-V # opt=-V
# fi # fi
# if _wanted "$opt" history-words expl "history ($n)" \ # if _wanted "$opt" history-words expl "history ($n)" \
# compadd "$expl[@]" -Q - \ # compadd -Q - \
# "${(@)${(@)historywords:#[\$'\"]*}[1,i*10]}"; then # "${(@)${(@)historywords:#[\$'\"]*}[1,i*10]}"; then
# # We have found at least one matching word, so we switch # # We have found at least one matching word, so we switch
# # on menu-completion and make sure that no other # # 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}" compadd -q -S '=' - "${(@k)nameddirs}"
fi fi
elif compset -P 1 '*='; then 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 else
_wanted -C name commands expl command compadd -q -S '=' - "${(@k)commands}" _wanted -C name commands expl command compadd -q -S '=' - "${(@k)commands}"
fi fi

View file

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

View file

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

View file

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

View file

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

View file

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