mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-28 14:22:22 +01:00
33942: always block to fix ZLS_COLORS
Ensures we get the right state of $ZLS_COLORS at the end of _main_complete even if there's an interrupt. However, the "right state" is a bit messy as it depends on styles.
This commit is contained in:
parent
9987b3034d
commit
42120c197b
1 changed files with 13 additions and 8 deletions
|
@ -43,6 +43,8 @@ local -a precommands
|
|||
|
||||
typeset -U _lastdescr _comp_ignore _comp_colors
|
||||
|
||||
{
|
||||
|
||||
[[ -z "$curcontext" ]] && curcontext=:::
|
||||
|
||||
zstyle -s ":completion:${curcontext}:" insert-tab tmp || tmp=yes
|
||||
|
@ -349,17 +351,20 @@ fi
|
|||
( "$_comp_force_list" = ?* && nm -ge _comp_force_list ) ]] &&
|
||||
compstate[list]="${compstate[list]//messages} force"
|
||||
|
||||
if [[ "$compstate[old_list]" = keep ]]; then
|
||||
if [[ $_saved_colors_set = 1 ]]; then
|
||||
ZLS_COLORS="$_saved_colors"
|
||||
} always {
|
||||
# Stuff we always do to clean up.
|
||||
if [[ "$compstate[old_list]" = keep ]]; then
|
||||
if [[ $_saved_colors_set = 1 ]]; then
|
||||
ZLS_COLORS="$_saved_colors"
|
||||
else
|
||||
unset ZLS_COLORS
|
||||
fi
|
||||
elif (( $#_comp_colors )); then
|
||||
ZLS_COLORS="${(j.:.)_comp_colors}"
|
||||
else
|
||||
unset ZLS_COLORS
|
||||
fi
|
||||
elif (( $#_comp_colors )); then
|
||||
ZLS_COLORS="${(j.:.)_comp_colors}"
|
||||
else
|
||||
unset ZLS_COLORS
|
||||
fi
|
||||
}
|
||||
|
||||
# Now call the post-functions.
|
||||
|
||||
|
|
Loading…
Reference in a new issue