1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-30 07:10:58 +02:00

46036: fix colouring in prompt completion

This commit is contained in:
Oliver Kiddle 2020-06-11 22:34:41 +02:00
parent cce88bdb0c
commit 1ee8ecd8ea
2 changed files with 6 additions and 3 deletions

View file

@ -1,5 +1,8 @@
2020-06-11 Oliver Kiddle <okiddle@yahoo.co.uk>
* 46036: Completion/Zsh/Type/_ps1234: fix colouring in prompt
completion
* users/24892: Completion/Unix/Type/_files,
Completion/Zsh/Command/_zstyle: fix local declaration with
recursive-files style and complete it for zstyle

View file

@ -38,7 +38,7 @@ if compset -P '%[FK]'; then
)
_description -V ansi-colors expl 'ansi color'
grp="$expl[expl[(i)-V]+1]"
grp="$expl[expl[(i)-J]+1]"
print -v ccol -f "($grp)=%s=%s" ${(kv)ansi}
_comp_colors+=( $ccol )
compadd "$expl[@]" $suf $pre -k ansi && ret=0
@ -48,10 +48,10 @@ if compset -P '%[FK]'; then
(( cols = $terminfo[colors] - 1 ))
(( cols = cols > 255 ? 255 : cols ))
_description -V terminal-colors expl 'terminal color'
grp="$expl[expl[(i)-V]+1]"
grp="$expl[expl[(i)-J]+1]"
compadd "$expl[@]" $suf $pre {0..$cols}
for c in {0..$cols}; do
_comp_colors+=( "($grp)=${c}=${${$(print -P "%F{$c}")#?\[}%m}" )
_comp_colors+=( "($grp)=${c}=${${${(%):-%F{$c\}}#?\[}%m}" )
done
else
_message -e terminal-colors "number"