scroll

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

commit be054f2de62b5f2fc7eaf79660060e1316031489
parent f9780ebc81ccdc1d41416257d2e3d5fcf2ef9e71
Author: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date:   Mon, 17 Feb 2020 20:52:57 +0100

draw current input line at end of scrolldown

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

diff --git a/scroll.c b/scroll.c @@ -192,7 +192,7 @@ scrollup(void) } void -scrolldown(void) +scrolldown(char *buf, size_t size) { int rows = ws.ws_row; @@ -201,8 +201,10 @@ scrolldown(void) bottom = TAILQ_PREV(bottom, tailhead, entries); write(STDOUT_FILENO, bottom->buf, bottom->size); } - if (bottom == TAILQ_FIRST(&head)) + if (bottom == TAILQ_FIRST(&head)) { write(STDOUT_FILENO, "\033[?25h", 6); + write(STDOUT_FILENO, buf, size); + } } int @@ -280,7 +282,7 @@ main(int argc, char *argv[]) if (c == 17) /* ^Q */ scrollup(); else if (c == 18) /* ^R */ - scrolldown(); + scrolldown(buf, pos); else if (write(mfd, &c, 1) == -1) die("write:"); }