summaryrefslogtreecommitdiffstats
path: root/lib/libcurses/refresh.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-10-27 22:36:56 +0000
committerache <ache@FreeBSD.org>1994-10-27 22:36:56 +0000
commitfc43e3161605eb847146163c136cbe02740aeed1 (patch)
tree89c05a1989e52e66c74f534f70ddf97999543332 /lib/libcurses/refresh.c
parent1ca2f392e18c355a8108c5c84aa5e4705aedc786 (diff)
downloadFreeBSD-src-fc43e3161605eb847146163c136cbe02740aeed1.zip
FreeBSD-src-fc43e3161605eb847146163c136cbe02740aeed1.tar.gz
Fix scroll bug bringed by vi(1), from phk's flame
(I still wait for apologies)
Diffstat (limited to 'lib/libcurses/refresh.c')
-rw-r--r--lib/libcurses/refresh.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libcurses/refresh.c b/lib/libcurses/refresh.c
index b6d432b..4cb87a3 100644
--- a/lib/libcurses/refresh.c
+++ b/lib/libcurses/refresh.c
@@ -744,8 +744,8 @@ scrolln(starts, startw, curs, bot, top)
}
if (n > 0) {
- /* Scroll up the block. */
- if (SF != NULL && top == 0) {
+ /* Scroll up the screen. */
+ if ((!DB && SF != NULL || n == 1) && bot == curscr->maxy - 1 && top == 0) {
__mvcur(oy, ox, curscr->maxy - 1, 0, 1);
if (n == 1)
goto f_nl1;
@@ -799,8 +799,8 @@ scrolln(starts, startw, curs, bot, top)
* !!!
* n < 0
*/
- /* Preserve the bottom lines. */
- if (SR != NULL && bot == curscr->maxy - 1) {
+ /* Scroll down the screen. */
+ if (!DA && SR != NULL && bot == curscr->maxy - 1 && top == 0) {
__mvcur(oy, ox, 0, 0, 1);
if (sr != NULL && -n == 1)
goto b_sr1;
OpenPOWER on IntegriCloud