When performing a scroll, check the last line of the region is the same
on virtscr and curscr because the indexes past are supposed to be one *past* the last matching line (they may actually match if the line is at the bottom of the screen). Iff they don't match reduce the scroll region size by one so we don't scroll non-matching lines, also check if the region is then 0 after the decrement and just return if it was.
This commit is contained in:
parent
efcd8443e2
commit
dabdb153f2
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: refresh.c,v 1.124 2022/10/19 06:09:27 blymn Exp $ */
|
||||
/* $NetBSD: refresh.c,v 1.125 2022/11/30 06:19:15 blymn Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1981, 1993, 1994
|
||||
|
@ -34,7 +34,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)refresh.c 8.7 (Berkeley) 8/13/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: refresh.c,v 1.124 2022/10/19 06:09:27 blymn Exp $");
|
||||
__RCSID("$NetBSD: refresh.c,v 1.125 2022/11/30 06:19:15 blymn Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -1852,6 +1852,13 @@ scrolln(int starts, int startw, int curs, int bot, int top)
|
|||
ox = curscr->curx;
|
||||
n = starts - startw;
|
||||
|
||||
if (!lineeq(__virtscr->alines[startw]->line,
|
||||
curscr->alines[starts]->line, (size_t) __virtscr->maxx))
|
||||
n--;
|
||||
|
||||
if (n == 0)
|
||||
return;
|
||||
|
||||
/*
|
||||
* XXX
|
||||
* The initial tests that set __noqch don't let us reach here unless
|
||||
|
|
Loading…
Reference in New Issue