nano

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

commit 26ae9dbd12638f638e03240b5a8239e9080f0789
parent d49c267f91ef5f37de056c9d5e621f0b306a9c90
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sun, 14 Jun 2015 18:06:36 +0000

Not bothering to look for any starting matches on the current line
when the whole line has already been coloured.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5248 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 3+++
Msrc/winio.c | 6+++++-
2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -4,6 +4,9 @@ * src/winio.c (edit_draw): Start and end regexes can be very similar; so if a found start has been qualified as an end earlier, believe it and skip to the next step. This helps with Python's docstrings. + * src/winio.c (edit_draw): When the whole line has been coloured, + don't bother looking for any more starts. This prevents some lines + from being erroneously marked as CENDAFTER instead of CWHOLELINE. 2015-06-11 Benno Schulenberg <bensberg@justemail.net> * src/winio.c (get_key_buffer): Add some debugging code to make it diff --git a/src/winio.c b/src/winio.c @@ -2492,7 +2492,7 @@ void edit_draw(filestruct *fileptr, const char *converted, int for (; tmpcolor != NULL; tmpcolor = tmpcolor->next) { int x_start; /* Starting column for mvwaddnstr. Zero-based. */ - int paintlen; + int paintlen = 0; /* Number of chars to paint on this line. There are * COLS characters on a whole line. */ size_t index; @@ -2673,6 +2673,10 @@ void edit_draw(filestruct *fileptr, const char *converted, int #endif } mvwaddnstr(edit, line, 0, converted, paintlen); + /* If the whole line has been painted, don't bother + * looking for any more starts. */ + if (paintlen < 0) + goto end_of_loop; step_two: /* Second step, we look for starts on this line. */ start_col = 0;