nano

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

commit ec4ee1c48916ee5bd525e5b3fcfb2d214d3a5abc
parent ebbb5b5d1e722dfdd45cd600fe296638f28eaa7b
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sat,  9 Jan 2016 20:21:29 +0000

Not going beyond the number of available rows in the edit window.
This fixes Savannah bug #42188.


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

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

diff --git a/ChangeLog b/ChangeLog @@ -2,6 +2,8 @@ * src/color.c (precalc_multicolorinfo), src/winio.c (edit_draw): Make sure to keep advancing also when matches are zero-length. This fixes Savannah bug #26977 reported by Tigrmesh. + * src/winio.c (update_line): For softwrap, don't go beyond the number + of available rows in the edit window. This fixes Savannah bug #42188. 2016-01-07 Benno Schulenberg <bensberg@justemail.net> * src/global.c (assign_keyinfo): Delete two unneeded #ifdefs: if diff --git a/src/winio.c b/src/winio.c @@ -2789,7 +2789,7 @@ int update_line(filestruct *fileptr, size_t index) #ifndef NANO_TINY } else { size_t full_length = strlenpt(fileptr->data); - for (index += COLS; index <= full_length && line < editwinrows; index += COLS) { + for (index += COLS; index <= full_length && line < editwinrows - 1; index += COLS) { line++; #ifdef DEBUG fprintf(stderr, "update_line(): softwrap code, moving to %d index %lu\n", line, (unsigned long)index);