diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-04-29 16:21:37 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-04-29 16:21:37 +0200 |
| commit | 9b68bc512d942c8e7a3625517f929bb7abaafb59 (patch) | |
| tree | ab2559228d21cc6a9879d1d0a7e23c4cd090cc85 /view.c | |
| parent | 78ea0cd428d2349f11d3f1f4abd00218a4b0f152 (diff) | |
| download | vis-9b68bc512d942c8e7a3625517f929bb7abaafb59.tar.gz vis-9b68bc512d942c8e7a3625517f929bb7abaafb59.tar.xz | |
view: improve view sliding down
Close #216
Diffstat (limited to 'view.c')
| -rw-r--r-- | view.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -897,9 +897,11 @@ size_t view_slide_up(View *view, int lines) { size_t view_slide_down(View *view, int lines) { Cursor *cursor = view->cursor; + bool lastline = cursor->line == view->lastline; + size_t col = cursor->col; if (view_viewport_up(view, lines)) { - if (cursor->line == view->lastline) - cursor_set(cursor, view->lastline, cursor->col); + if (lastline) + cursor_set(cursor, view->lastline, col); else view_cursor_to(view, cursor->pos); } else { |
