summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-11-21 14:16:31 +0000
committerache <ache@FreeBSD.org>1994-11-21 14:16:31 +0000
commit1d76dd7613270ec93a191cb7fc5e4f9e395db1ff (patch)
treecbccd2c518d76482a779a351817b0321460edddf /lib
parenteb309661659065f1faf3ce5d4bd8e88c9abbbec0 (diff)
downloadFreeBSD-src-1d76dd7613270ec93a191cb7fc5e4f9e395db1ff.zip
FreeBSD-src-1d76dd7613270ec93a191cb7fc5e4f9e395db1ff.tar.gz
Fix scroll bug bringed by 'vi <several_small_files>'
and :n command then. :prev bug still exists because it syscons bug itself, I work on it.
Diffstat (limited to 'lib')
-rw-r--r--lib/libcurses/refresh.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/libcurses/refresh.c b/lib/libcurses/refresh.c
index 4cb87a3..5b091f9 100644
--- a/lib/libcurses/refresh.c
+++ b/lib/libcurses/refresh.c
@@ -750,7 +750,8 @@ scrolln(starts, startw, curs, bot, top)
if (n == 1)
goto f_nl1;
tputs(__tscroll(SF, n, 0), n, __cputchar);
- __mvcur(curscr->maxy - 1, 0, bot - n + 1, 0, 1);
+ __mvcur(curscr->maxy - 1, 0, oy, ox, 1);
+ return;
}
else if (DL != NULL && top != 0) {
__mvcur(oy, ox, top, 0, 1);
@@ -775,6 +776,10 @@ scrolln(starts, startw, curs, bot, top)
tputs(NL, 1, __cputchar);
else
putchar('\n');
+ if (bot == curscr->maxy - 1) {
+ __mvcur(curscr->maxy - 1, 0, oy, ox, 1);
+ return;
+ }
__mvcur(curscr->maxy - 1, 0, bot - n + 1, 0, 1);
}
else
@@ -800,12 +805,15 @@ scrolln(starts, startw, curs, bot, top)
* n < 0
*/
/* Scroll down the screen. */
- if (!DA && SR != NULL && bot == curscr->maxy - 1 && top == 0) {
+ if (!DA && (SR != NULL || sr != NULL) && bot == curscr->maxy - 1 && top == 0) {
__mvcur(oy, ox, 0, 0, 1);
- if (sr != NULL && -n == 1)
- goto b_sr1;
- tputs(__tscroll(SR, -n, 0), -n, __cputchar);
- __mvcur(0, 0, top, 0, 1);
+ if (SR == NULL || sr != NULL && -n == 1) {
+ for (i = n; i < 0; i++)
+ tputs(sr, 1, __cputchar);
+ } else
+ tputs(__tscroll(SR, -n, 0), -n, __cputchar);
+ __mvcur(0, 0, oy, ox, 1);
+ return;
}
else if (DL != NULL) {
__mvcur(oy, ox, bot + n + 1, 0, 1);
@@ -821,13 +829,6 @@ scrolln(starts, startw, curs, bot, top)
tputs(dl, 1, __cputchar);
__mvcur(bot + n + 1, 0, top, 0, 1);
}
- else if (sr != NULL && bot == curscr->maxy - 1) {
- __mvcur(oy, ox, 0, 0, 1);
- b_sr1:
- for (i = n; i < 0; i++)
- tputs(sr, 1, __cputchar);
- __mvcur(0, 0, top, 0, 1);
- }
else
abort();
OpenPOWER on IntegriCloud