diff options
author | Jakob Kaivo <jkk@ung.org> | 2022-04-19 21:06:33 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2022-04-19 21:06:33 -0400 |
commit | bd9f014a7108d0a0293ee4c44332ec5659c64313 (patch) | |
tree | 4da6ab7c837794a7f5e12cf10d84b878aa39c9d2 | |
parent | 95f01124b30bd8ed7aa1a85658836890bcc4c228 (diff) |
mostly fix backward scrolling
-rw-r--r-- | more.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -169,7 +169,9 @@ static int more_printline(char *s) static void more_refresh(struct more_file *mf) { int printed = 0; - for (size_t i = 0; i + printed < mf->topline + LINES; i++) { + wmove(more_win, 0, 0); + + for (size_t i = mf->topline; i + printed < mf->topline + LINES; i++) { /* FIXME: account for long lines */ if (more_getline(mf, i) == -1) { @@ -185,7 +187,7 @@ static void more_scroll(struct more_file *mf, int count, int multiple) { int by = count ? count * multiple : multiple; - if (more_clear) { + if (more_clear && abs(by) > LINES) { clear(); } |