From: Marlon Richert <marlon.richert@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: [PATCH] complist: Turn off colors before clearing to end of line
Date: Tue, 17 Aug 2021 11:57:12 +0300 [thread overview]
Message-ID: <CAHLkEDs2vceZZo94_qGWoAPaOWwkc6KKcD1w_E4v1nK=j6RiaQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 464 bytes --]
Try the following without and with the patch, to see what this fixes:
% zmodload zsh/complist
% autoload compinit
% compinit
% bindkey '^I' menu-select
% ping -<TAB><TAB>
<Default selection highlight (reverse video) stops at the end of the match.>
% zstyle '*' list-colors 'ma=97;44'
% ping -<TAB><TAB>
<Without the patch, when changing selection, highlight continues until
end of line.>
<With the patch, it stops at the end of the match, just like the default.>
[-- Attachment #2: 0001-complist-Turn-off-colors-before-clearing-to-end-of-l.txt --]
[-- Type: text/plain, Size: 1174 bytes --]
From 555dbb68a30bef5e224a5e01b9c3210884fd4a61 Mon Sep 17 00:00:00 2001
From: Marlon Richert <marlonrichert@users.noreply.github.com>
Date: Tue, 17 Aug 2021 11:43:06 +0300
Subject: [PATCH] complist: Turn off colors before clearing to end of line
---
Src/Zle/complist.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 353cb3562..4d015991f 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1306,6 +1306,7 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop)
if (dopr) {
if (!(cc % zterm_columns))
fputs(" \010", shout);
+ zcoff();
if (mlbeg >= 0 && tccan(TCCLEAREOL))
tcout(TCCLEAREOL);
}
@@ -1785,14 +1786,14 @@ clprintm(Cmgroup g, Cmatch *mp, int mc, int ml, int lastc, int width)
zcputs(g->name, COL_DU);
else
subcols = putmatchcol(g->name, m->disp);
- if (subcols)
+ if (subcols) {
ret = clprintfmt(m->disp, ml);
- else {
+ zcoff();
+ } else {
compprintfmt(m->disp, 0, 1, 0, ml, &stop);
if (stop)
ret = 1;
}
- zcoff();
} else {
int mx, modec;
--
2.32.0
next reply other threads:[~2021-08-17 8:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-17 8:57 Marlon Richert [this message]
2021-08-18 4:07 ` Bart Schaefer
2021-08-19 19:28 ` Marlon Richert
2021-08-20 6:39 ` Marlon Richert
2021-08-20 23:42 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHLkEDs2vceZZo94_qGWoAPaOWwkc6KKcD1w_E4v1nK=j6RiaQ@mail.gmail.com' \
--to=marlon.richert@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).