color: push the resets further when start and end match are equal

When for a multiline syntax-coloring rule the starting regex matches at
the exact same spot as the ending regex, do a second round of resets, so
that reevaluation starts further back and gets a few more things right.

This mildly fixes https://savannah.gnu.org/bugs/?47420.
master
Benno Schulenberg 2016-07-03 16:21:03 +02:00
parent 528b79b5f3
commit 4af1da7d95
1 changed files with 5 additions and 0 deletions

View File

@ -376,6 +376,11 @@ void reset_multis(filestruct *fileptr, bool force)
/* If we got here, things have changed. */
reset_multis_for_id(fileptr, tmpcolor->id);
/* If start and end are the same, push the resets further. */
if (force == FALSE && !nobegin && !noend &&
startmatch.rm_so == endmatch.rm_so)
reset_multis_for_id(fileptr, tmpcolor->id);
}
}