scroll

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

commit c74dc9e7463ccac3a8a9d49737637419a1ab3ac6
parent de79f8faad5df3735f2e53d7881a5782379efc2a
Author: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date:   Tue, 31 Mar 2020 22:28:01 +0200

Print first line as well

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

diff --git a/scroll.c b/scroll.c @@ -252,7 +252,7 @@ scrollup(void) /* account for last line */ if(bottom != NULL && TAILQ_PREV(bottom, tailhead, entries) == NULL) - start = 1; + start = 2; /* wind back bottom pointer by two pages */ for (; bottom != NULL && @@ -274,8 +274,8 @@ scrollup(void) /* print one page */ for (rows = 0; rows < ws.ws_row + start; rows++) { - bottom = TAILQ_PREV(bottom, tailhead, entries); write(STDOUT_FILENO, bottom->buf, bottom->size); + bottom = TAILQ_PREV(bottom, tailhead, entries); } }