nano

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

commit 4af1da7d95d64bf85a8b9ee4e1c9c69c62f69e27
parent 528b79b5f399f9a3aec6617de460e19771f46e95
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sun,  3 Jul 2016 16:21:03 +0200

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.

Diffstat:
Msrc/color.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/color.c b/src/color.c @@ -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); } }