commit ba4826d4ce5010706d36bcf586defc62511d3c03
Author: Jochen Sprickerhof <[email protected]>
AuthorDate: Sun Apr 12 23:13:47 2020 +0200
Commit: Jochen Sprickerhof <[email protected]>
CommitDate: Sun Apr 12 23:13:47 2020 +0200
Fix line length
diff --git a/scroll.c b/scroll.c
index 698c9cd..2c28b31 100644
--- 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;
}
}