Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] complist: Turn off colors before clearing to end of line
- X-seq: zsh-workers 49291
- From: Marlon Richert <marlon.richert@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] complist: Turn off colors before clearing to end of line
- Date: Thu, 19 Aug 2021 22:28:41 +0300
- Archived-at: <https://zsh.org/workers/49291>
- In-reply-to: <CAH+w=7Y8uNJCJQZCj+eenwBrmaoT2pj_FM+kXkRFohpsyt2Sww@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDs2vceZZo94_qGWoAPaOWwkc6KKcD1w_E4v1nK=j6RiaQ@mail.gmail.com> <CAH+w=7Y8uNJCJQZCj+eenwBrmaoT2pj_FM+kXkRFohpsyt2Sww@mail.gmail.com>
On Wed, Aug 18, 2021 at 7:07 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Tue, Aug 17, 2021 at 1:58 AM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> >
> > <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.>
>
> And the zcoff() is never needed in the compprintfmt() branch?
Hm, good point. How about this patch instead?
From 555dbb68a30bef5e224a5e01b9c3210884fd4a61 Mon Sep 17 00:00:00 2001
From: Marlon Richert <marlonrichert@xxxxxxxxxxxxxxxxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author