scroll

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

commit 38a8477973fc8fa69512e5e079c060b67c9eccd6
parent 5fbd1cc536b0efae2e0dcec8515e8c6e7082b772
Author: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date:   Tue, 31 Mar 2020 22:03:56 +0200

Don't modify bottom if there is less then a page

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

diff --git a/scroll.c b/scroll.c @@ -248,6 +248,7 @@ void scrollup(void) { int rows = 0, start = 0; + struct line *bottom_old = bottom; /* account for last line */ if(bottom != NULL && TAILQ_PREV(bottom, tailhead, entries) == NULL) @@ -260,7 +261,7 @@ scrollup(void) bottom = TAILQ_NEXT(bottom, entries); if (rows <= ws.ws_row) { - bottom = TAILQ_LAST(&head, tailhead); + bottom = bottom_old; return; }