commit 18ba7f60c165d271d7734cc18a4c5001cb9efb32
parent 5c3e00d70ae7cb7e2e52baf6edf913db462757b3
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 8 Mar 2022 09:39:40 +0100
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.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/color.c b/src/color.c
@@ -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 +