summaryrefslogtreecommitdiff
path: root/more.c
diff options
context:
space:
mode:
Diffstat (limited to 'more.c')
-rw-r--r--more.c6
1 files 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();
}