nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit b94dcfd34b092bc3b83d6437eb09ca6f1bb6f2af
parent 42385646731b526a74a7d37dca43f88201f4675b
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 18 Feb 2021 12:02:25 +0100

painting: trigger fewer unneeded full-screen refreshes

When a line is marked as NOTHING, then the existence or the appearance
of an end match is irrelevant: there is no unpaired start match, so no
recoloring would occur, so there is no need to refresh.

When a line is marked as WOULDBE, then the existence or the appearance
of a start match is irrelevant (for the lines after the first WOULDBE
line): there already is an unpaired start match, so another one will
not change anything, so no refresh is needed.  Only the appearance of
an end match would recolor things and thus require a refresh.  However,
start and end regexes could match the same thing, so an end might get
misinterpreted as a start.  So the rule has to check for the absence
of both a start and an end match, like for WHOLELINE.

This addresses https://savannah.gnu.org/bugs/?60072.

Diffstat:
Msrc/color.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/color.c b/src/color.c @@ -262,7 +262,10 @@ void check_the_multis(linestruct *line) anend = (regexec(ink->end, afterstart, 1, &endmatch, 0) == 0); /* Check whether the multidata still matches the current situation. */ - if (line->multidata[ink->id] & (NOTHING|WHOLELINE)) { + if (line->multidata[ink->id] == NOTHING) { + if (!astart) + continue; + } else if (line->multidata[ink->id] & (WHOLELINE|WOULDBE)) { if (!astart && !anend) continue; } else if (line->multidata[ink->id] == JUSTONTHIS) {