scroll

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

commit 7d747070288a92a10c54e6e1101ea1cceac43f05
parent 87c2a2924522e9903f826115b760ebdcc8d74d5d
Author: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date:   Mon, 17 Feb 2020 20:22:43 +0100

Remove special handling of first line

Not needed anymore due to \r\n at the beginning of the buffer.

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

diff --git a/scroll.c b/scroll.c @@ -165,11 +165,6 @@ void scrollup(void) { int rows = 0; - int first = 0; - - /* check if the input line is on the bottom of the screen */ - if (TAILQ_FIRST(&head) == bottom) - first = 1; /* wind back bottom pointer by two pages */ for (rows = 0; bottom != NULL && rows < 2 * ws.ws_row; rows++) @@ -190,7 +185,7 @@ scrollup(void) write(STDOUT_FILENO, "\033[?25l", 6); /* print one page */ - for (; rows > ws.ws_row - first;rows--) { + for (; rows > ws.ws_row; rows--) { if (TAILQ_PREV(bottom, tailhead, entries) == NULL) break; bottom = TAILQ_PREV(bottom, tailhead, entries); @@ -204,9 +199,8 @@ scrolldown(void) { int rows = ws.ws_row; - write(STDOUT_FILENO, "\r\n", 2); /* print one page */ - for (; rows >= 0;rows--) { + for (; rows >= 0; rows--) { if (TAILQ_PREV(bottom, tailhead, entries) == NULL) break; bottom = TAILQ_PREV(bottom, tailhead, entries);