scrolling: properly compensate for the onscreen chunks
If edittop is partially offscreen before we scroll, and it gets scrolled more offscreen, we do need to compensate for the chunks between firstcolumn and leftedge -- that is: the chunks between the top row and the cursor row. This fixes https://savannah.gnu.org/bugs/?50691.master
parent
c3830517cc
commit
f9a8d6ff4e
10
src/winio.c
10
src/winio.c
|
@ -2920,10 +2920,12 @@ void edit_scroll(scroll_dir direction, int nrows)
|
||||||
go_forward_chunks(editwinrows - nrows, &line, &leftedge);
|
go_forward_chunks(editwinrows - nrows, &line, &leftedge);
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* Compensate for the earlier onscreen chunks of a softwrapped line
|
/* Compensate for the earlier chunks of a softwrapped line. */
|
||||||
* when the first blank row happens to be in the middle of that line. */
|
nrows += leftedge / editwincols;
|
||||||
if (ISSET(SOFTWRAP) && line != openfile->edittop)
|
|
||||||
nrows += leftedge / editwincols;
|
/* Don't compensate for the chunks that are offscreen. */
|
||||||
|
if (line == openfile->edittop)
|
||||||
|
nrows -= openfile->firstcolumn / editwincols;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Draw new content on the blank rows inside the scrolled region
|
/* Draw new content on the blank rows inside the scrolled region
|
||||||
|
|
Loading…
Reference in New Issue