scroll

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

commit ba4826d4ce5010706d36bcf586defc62511d3c03
parent ab23a4943ff4f20693f4c43fb31409368ccc045d
Author: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date:   Sun, 12 Apr 2020 23:13:47 +0200

Fix line length

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

diff --git a/scroll.c b/scroll.c @@ -296,7 +296,7 @@ scrollup(int n) int rows = 2; struct line *scrollend = bottom; - if (n < 0) /* scroll by fraction of window rows, but at least one line */ + if (n < 0) /* scroll by fraction of ws.ws_row, but at least one line */ n = ws.ws_row > (-n) ? ws.ws_row / (-n) : 1; /* wind back scrollend pointer by one page plus n */ @@ -339,7 +339,7 @@ scrolldown(char *buf, size_t size, int n) if (bottom == NULL || bottom == TAILQ_FIRST(&head)) return; - if (n < 0) /* scroll by fraction of window rows, but at least one line */ + if (n < 0) /* scroll by fraction of ws.ws_row, but at least one line */ n = ws.ws_row > (-n) ? ws.ws_row / (-n) : 1; bottom = TAILQ_PREV(bottom, tailhead, entries); @@ -491,7 +491,8 @@ main(int argc, char *argv[]) if (rules[i].event == SCROLL_UP) scrollup(rules[i].lines); if (rules[i].event == SCROLL_DOWN) - scrolldown(buf, pos, rules[i].lines); + scrolldown(buf, pos, + rules[i].lines); goto out; } }