1999-12-03 17:43:20 +01:00
|
|
|
#autoload
|
|
|
|
|
2000-04-01 22:43:43 +02:00
|
|
|
local val nm="$compstate[nmatches]"
|
|
|
|
|
2000-06-19 10:47:43 +02:00
|
|
|
[[ $# -eq 1 ]] && 2="$1"
|
|
|
|
|
2000-04-01 22:43:43 +02:00
|
|
|
if zstyle -a ":completion:${curcontext}:$1" list-colors val; then
|
|
|
|
zmodload -i zsh/complist
|
|
|
|
if [[ "$1" = default ]]; then
|
2000-06-22 10:42:36 +02:00
|
|
|
_comp_colors=( "$val[@]" )
|
2000-04-01 22:43:43 +02:00
|
|
|
else
|
2000-06-22 10:42:36 +02:00
|
|
|
_comp_colors=( "$_comp_colors[@]"
|
2000-06-28 15:59:21 +02:00
|
|
|
"(${2})${(@)^val:#(|\(*\)*)}" "${(M@)val:#\(*\)*}" )
|
1999-12-03 17:43:20 +01:00
|
|
|
fi
|
2000-04-01 22:43:43 +02:00
|
|
|
|
|
|
|
# Here is the problem mentioned in _main_complete.
|
|
|
|
|
|
|
|
# elif [[ "$1" = default && -n "$ZLS_COLORS$ZLS_COLOURS" ]]; then
|
|
|
|
# zmodload -i zsh/complist
|
|
|
|
# ZLS_COLORS="$ZLS_COLORS$ZLS_COLOURS"
|
|
|
|
|
2000-06-19 10:47:43 +02:00
|
|
|
elif [[ "$1" = default ]]; then
|
|
|
|
ZLS_COLORS=
|
2000-04-01 22:43:43 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if zstyle -t ":completion:${curcontext}:$1" list-packed; then
|
|
|
|
compstate[list]="${compstate[list]} packed"
|
|
|
|
elif [[ $? -eq 1 ]]; then
|
|
|
|
compstate[list]="${compstate[list]:gs/packed//}"
|
|
|
|
else
|
|
|
|
compstate[list]="$_saved_list"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if zstyle -t ":completion:${curcontext}:$1" list-rows-first; then
|
|
|
|
compstate[list]="${compstate[list]} rows"
|
|
|
|
elif [[ $? -eq 1 ]]; then
|
|
|
|
compstate[list]="${compstate[list]:gs/rows//}"
|
|
|
|
else
|
|
|
|
compstate[list]="$_saved_list"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if zstyle -t ":completion:${curcontext}:$1" last-prompt; then
|
|
|
|
compstate[last_prompt]=yes
|
|
|
|
elif [[ $? -eq 1 ]]; then
|
|
|
|
compstate[last_prompt]=''
|
|
|
|
else
|
|
|
|
compstate[last_prompt]="$_saved_lastprompt"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if zstyle -t ":completion:${curcontext}:$1" accept-exact; then
|
|
|
|
compstate[exact]=accept
|
|
|
|
elif [[ $? -eq 1 ]]; then
|
|
|
|
compstate[exact]=''
|
|
|
|
else
|
|
|
|
compstate[exact]="$_saved_exact"
|
|
|
|
fi
|
|
|
|
|
|
|
|
[[ _last_nmatches -ge 0 && _last_nmatches -ne nm ]] &&
|
|
|
|
_menu_style=( "$_last_menu_style[@]" "$_menu_style[@]" )
|
|
|
|
|
|
|
|
if zstyle -a ":completion:${curcontext}:$1" menu val; then
|
|
|
|
_last_nmatches=$nm
|
|
|
|
_last_menu_style=( "$val[@]" )
|
|
|
|
else
|
|
|
|
_last_nmatches=-1
|
|
|
|
fi
|
2000-05-08 10:16:32 +02:00
|
|
|
|
|
|
|
[[ "$_comp_force_list" != always ]] &&
|
|
|
|
zstyle -s ":completion:${curcontext}:$1" force-list val &&
|
|
|
|
[[ "$val" = always ||
|
|
|
|
( "$val" = [0-9]## &&
|
2000-05-31 11:56:12 +02:00
|
|
|
( -z "$_comp_force_list" || _comp_force_list -gt val ) ) ]] &&
|
2000-05-08 10:16:32 +02:00
|
|
|
_comp_force_list="$val"
|