scroll

scrollbackbuffer program for st
git clone git://git.suckless.org//gitrepos
Log | Files | Refs

commit 82d78a619aa999309956871b65c63e2e845b2f15
parent 0ae52bc1bc31481966cc21e0b540b76ed9d61a2e
Author: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date:   Mon, 17 Feb 2020 20:30:16 +0100

Fix scrolling offset

Diffstat:
Mscroll.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scroll.c b/scroll.c @@ -172,7 +172,7 @@ scrollup(void) if (bottom == NULL) bottom = TAILQ_LAST(&head, tailhead); - if (rows - ws.ws_row <= 0) { + if (rows - ws.ws_row < 0) { bottom = TAILQ_FIRST(&head); return; } @@ -197,7 +197,7 @@ scrolldown(void) int rows = ws.ws_row; /* print one page */ - for (; rows >= 0 && TAILQ_PREV(bottom, tailhead, entries) != NULL; rows--) { + for (; rows > 0 && TAILQ_PREV(bottom, tailhead, entries) != NULL; rows--) { bottom = TAILQ_PREV(bottom, tailhead, entries); write(STDOUT_FILENO, bottom->buf, bottom->size); }