From bd9f014a7108d0a0293ee4c44332ec5659c64313 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 19 Apr 2022 21:06:33 -0400 Subject: mostly fix backward scrolling --- more.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/more.c b/more.c index b9508ac..b3bbfb6 100644 --- a/more.c +++ b/more.c @@ -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(); } -- cgit v1.2.1