painting: tighten the check for a lacking end match on a colored line

As it's possible for the start regex to match what is actually the end
match of a multiline thing (see the Python triple quotes, for example),
make sure that such a detected start match is *not* an end match, just
to avoid a needless full-screen refresh.
This commit is contained in:
Benno Schulenberg 2022-03-08 09:39:40 +01:00
parent 5c3e00d70a
commit 18ba7f60c1

View File

@ -262,7 +262,9 @@ void check_the_multis(linestruct *line)
if (!astart)
continue;
} else if (line->multidata[ink->id] & (WHOLELINE|WOULDBE)) {
if (!astart && !anend)
/* Ensure that a detected start match is not actually an end match. */
if (!anend && (!astart || regexec(ink->end, line->data, 1,
&endmatch, 0) != 0))
continue;
} else if (line->multidata[ink->id] == JUSTONTHIS) {
if (astart && anend && regexec(ink->start, line->data + startmatch.rm_eo +