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.
This commit is contained in:
Benno Schulenberg 2021-02-18 16:46:41 +01:00
parent b94dcfd34b
commit 0596b875f0
1 changed files with 2 additions and 1 deletions

View File

@ -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)