diff --git a/src/winio.c b/src/winio.c index 245ddb1b1536410efd0486e7cae28848b5b41d81..7c1453682c2a873374a45c83c9840b6349a6daa7 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2920,10 +2920,12 @@ void edit_scroll(scroll_dir direction, int nrows) go_forward_chunks(editwinrows - nrows, &line, &leftedge); #ifndef NANO_TINY - /* Compensate for the earlier onscreen chunks of a softwrapped line - * when the first blank row happens to be in the middle of that line. */ - if (ISSET(SOFTWRAP) && line != openfile->edittop) - nrows += leftedge / editwincols; + /* Compensate for the earlier chunks of a softwrapped line. */ + nrows += leftedge / editwincols; + + /* Don't compensate for the chunks that are offscreen. */ + if (line == openfile->edittop) + nrows -= openfile->firstcolumn / editwincols; #endif /* Draw new content on the blank rows inside the scrolled region