diff --git a/ChangeLog b/ChangeLog index 17d9bbfa..c17e970b 100644 --- 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 * src/global.c (assign_keyinfo): Delete two unneeded #ifdefs: if diff --git a/src/winio.c b/src/winio.c index 06d8889f..78dd30e4 100644 --- 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);