aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
Diffstat (limited to 'view.c')
-rw-r--r--view.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/view.c b/view.c
index e7f9d4d..0491c78 100644
--- a/view.c
+++ b/view.c
@@ -707,11 +707,9 @@ void view_redraw_bottom(View *view) {
Line *line = view->cursor->line;
if (line == view->lastline)
return;
- int linenr = 0;
size_t pos = view->cursor->pos;
- for (Line *cur = view->topline; cur && cur != line; cur = cur->next)
- linenr++;
- view_slide_down(view, view->height - linenr - 1);
+ view_viewport_up(view, view->height);
+ while (pos > view->end && view_viewport_down(view, 1));
view_cursor_to(view, pos);
}