From fd3eac1f9501619f9802cc01229ad80fe46687be Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Sat, 5 May 2018 21:55:10 -0400 Subject: [PATCH] make sure the cursor syncs to the bottom of the screen if it is located later in the document --- lib/view.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/view.c b/lib/view.c index fb1d17f..61761e8 100644 --- a/lib/view.c +++ b/lib/view.c @@ -172,7 +172,10 @@ void view_update(View* view, size_t* csrx, size_t* csry) { resize(view, view->width, view->nrows, CSRPOS); view_scroll(view, UP * (view->nvisible/2)); } else { + Row* lastrow = view->rows[view->nrows-1]; view_scrollto(view, CSRPOS); + if (lastrow->cols[lastrow->len-1].off < CSRPOS) + view_scroll(view, UP * (view->nvisible-1)); } view->sync_flags = 0; } -- 2.49.0