commit dfb4d933d9fa99fe9f58bb2f5f35662518077755
parent 88612294334b82e8b7b3e07e51023698a1025353
Author: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Wed, 25 Mar 2020 21:31:03 +0100
WIP
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scroll.c b/scroll.c
@@ -251,7 +251,7 @@ scrollup(void)
for (; TAILQ_NEXT(bottom, entries) != NULL && rows < 2 * ws.ws_row; rows++)
bottom = TAILQ_NEXT(bottom, entries);
- if (rows < ws.ws_row) {
+ if (rows <= ws.ws_row) {
bottom = TAILQ_LAST(&head, tailhead);
return;
}
@@ -264,7 +264,7 @@ scrollup(void)
write(STDOUT_FILENO, "\033[?25l", 6);
/* print one page */
- for (; rows > ws.ws_row && TAILQ_PREV(bottom, tailhead, entries) != NULL; rows--) {
+ for (rows = 0; rows < ws.ws_row; rows++) {
bottom = TAILQ_PREV(bottom, tailhead, entries);
write(STDOUT_FILENO, bottom->buf, bottom->size);
}