display: don't compensate for chunks before firstcolumn

The number of rows to draw shouldn't be compensated for the chunks
of edittop that are before firstcolumn, because they are offscreen.

This completes the fix for https://savannah.gnu.org/bugs/?50621.
master
David Lawrence Ramsey 2017-03-28 08:45:59 -05:00 committed by Benno Schulenberg
parent 66ef8f45a3
commit 93c6248956
1 changed files with 2 additions and 2 deletions

View File

@ -2921,8 +2921,8 @@ void edit_scroll(scroll_dir direction, int nrows)
while (i > 0 && line != NULL) { while (i > 0 && line != NULL) {
#ifndef NANO_TINY #ifndef NANO_TINY
/* If the first blank row is in the middle of a softwrapped line, /* If the first blank row is in the middle of a softwrapped line,
* compensate for the earlier chunks of that line. */ * compensate for the earlier onscreen chunks of that line. */
if (ISSET(SOFTWRAP) && i == nrows) if (ISSET(SOFTWRAP) && i == nrows && line != openfile->edittop)
i += strnlenpt(line->data, leftedge) / editwincols; i += strnlenpt(line->data, leftedge) / editwincols;
#endif #endif
i -= update_line(line, (line == openfile->current) ? i -= update_line(line, (line == openfile->current) ?