Fix redraw if cursor is not at the bottom - scroll - scrollbackbuffer program f… | |
git clone git://git.suckless.org/scroll | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 8eccc7198b45b63e990c56809015140f4380f272 | |
parent a4faed60e37174f43dce47e099a8b55b1f1a5556 | |
Author: Jochen Sprickerhof <[email protected]> | |
Date: Sat, 18 Apr 2020 23:05:09 +0200 | |
Fix redraw if cursor is not at the bottom | |
Diffstat: | |
M scroll.c | 6 ++++-- | |
1 file changed, 4 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/scroll.c b/scroll.c | |
@@ -259,9 +259,9 @@ redraw() | |
getcursorposition(&x, &y); | |
- /* wind back bottom pointer by one page */ | |
+ /* wind back bottom pointer by shown history */ | |
for (; bottom != NULL && TAILQ_NEXT(bottom, entries) != NULL && | |
- rows < x - 1; rows++) | |
+ rows < x - 2; rows++) | |
bottom = TAILQ_NEXT(bottom, entries); | |
if (rows == 0) | |
@@ -282,6 +282,8 @@ redraw() | |
bottom = TAILQ_PREV(bottom, tailhead, entries); | |
write(STDOUT_FILENO, bottom->buf, bottom->size); | |
} | |
+ /* add new line in front of the shell prompt */ | |
+ write(STDOUT_FILENO, "\n", 1); | |
} | |
void |