From: Michael D. Lowis Date: Sun, 6 May 2018 01:55:10 +0000 (-0400) Subject: make sure the cursor syncs to the bottom of the screen if it is located later in... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=fd3eac1f9501619f9802cc01229ad80fe46687be;p=projs%2Ftide.git make sure the cursor syncs to the bottom of the screen if it is located later in the document --- 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; }