]> git.mdlowis.com Git - projs/tide.git/commitdiff
make sure the cursor syncs to the bottom of the screen if it is located later in...
authorMichael D. Lowis <mike@mdlowis.com>
Sun, 6 May 2018 01:55:10 +0000 (21:55 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Sun, 6 May 2018 01:55:10 +0000 (21:55 -0400)
lib/view.c

index fb1d17fbacfcc6e180c6cb2305fa749d2f5307be..61761e88310eb6cf3cbe59b22555135734df0007 100644 (file)
@@ -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;
     }