nano

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

commit 0596b875f02c6b7124d124127c825487e3c379a9
parent b94dcfd34b092bc3b83d6437eb09ca6f1bb6f2af
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 18 Feb 2021 16:46:41 +0100

painting: trigger a refresh when a second start match appears on a line

When a line is marked as JUSTONTHIS, there should be no second start
match on that line, because otherwise the line would have been marked
as STARTSHERE (unless there is also a second end match -- but it's
fine to do unnecessary refreshes in this unlikely case, as long as
the necessary refreshes are made).

This fixes https://savannah.gnu.org/bugs/?60074.

Bug existed since version 2.5.0, but has been masked (for the C syntax)
by unnecessary refreshes since version 4.1, commit c9605e73.

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

diff --git a/src/color.c b/src/color.c @@ -269,7 +269,8 @@ void check_the_multis(linestruct *line) if (!astart && !anend) continue; } else if (line->multidata[ink->id] == JUSTONTHIS) { - if (astart && anend && startmatch.rm_so < endmatch.rm_so) + if (astart && anend && regexec(ink->start, line->data + endmatch.rm_eo, + 1, &startmatch, 0) != 0) continue; } else if (line->multidata[ink->id] == STARTSHERE) { if (astart && !anend)