mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-10 12:40:58 +02:00
69 lines
1.7 KiB
Text
69 lines
1.7 KiB
Text
#autoload
|
|
|
|
local val nm="$compstate[nmatches]"
|
|
|
|
if zstyle -a ":completion:${curcontext}:$1" list-colors val; then
|
|
zmodload -i zsh/complist
|
|
if [[ "$1" = default ]]; then
|
|
ZLS_COLORS="${(j.:.)${(@)val:gs/:/\\\:}}"
|
|
else
|
|
eval "ZLS_COLORS=\"(${1})\${(j.:(${1}).)\${(@)val:gs/:/\\\:}}:\${ZLS_COLORS}\""
|
|
fi
|
|
|
|
# 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"
|
|
|
|
fi
|
|
|
|
if zstyle -s ":completion:${curcontext}:$1" list-packed val; then
|
|
if [[ "$val" = (yes|true|1|on) ]]; then
|
|
compstate[list]="${compstate[list]} packed"
|
|
else
|
|
compstate[list]="${compstate[list]:gs/packed//}"
|
|
fi
|
|
else
|
|
compstate[list]="$_saved_list"
|
|
fi
|
|
|
|
if zstyle -s ":completion:${curcontext}:$1" list-rows-first val; then
|
|
if [[ "$val" = (yes|true|1|on) ]]; then
|
|
compstate[list]="${compstate[list]} rows"
|
|
else
|
|
compstate[list]="${compstate[list]:gs/rows//}"
|
|
fi
|
|
else
|
|
compstate[list]="$_saved_list"
|
|
fi
|
|
|
|
if zstyle -s ":completion:${curcontext}:$1" last-prompt val; then
|
|
if [[ "$val" = (yes|true|1|on) ]]; then
|
|
compstate[last_prompt]=yes
|
|
else
|
|
compstate[last_prompt]=''
|
|
fi
|
|
else
|
|
compstate[last_prompt]="$_saved_lastprompt"
|
|
fi
|
|
|
|
if zstyle -s ":completion:${curcontext}:$1" accept-exact val; then
|
|
if [[ "$val" = (yes|true|1|on) ]]; then
|
|
compstate[exact]=accept
|
|
else
|
|
compstate[exact]=''
|
|
fi
|
|
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
|