From eec5803c11c752da54d012b34218dfbc40b84515 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Sun, 2 Apr 2017 15:12:49 -0400 Subject: [PATCH] jumpto now uses sync view to ensure we dont overscroll. Eventually sync_view should be made more efficient by doing a quick jump to an offset and then slide into place from there. for now this will be usable on all but the largest files --- lib/view.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/view.c b/lib/view.c index b5d840b..ff04d6a 100644 --- a/lib/view.c +++ b/lib/view.c @@ -148,8 +148,6 @@ static void sync_view(View* view, size_t csr) { first = scroll_up(view); while (csr > last && last < buf_end(&(view->buffer))) last = scroll_dn(view); - while (buf_end(&(view->buffer)) && last > buf_end(&(view->buffer))) - last = scroll_up(view); view->sync_needed = false; if (view->sync_center) { sync_center(view, csr); @@ -604,9 +602,5 @@ void view_indent(View* view, int dir) { } void view_jumpto(View* view, size_t off) { - size_t csrx, csry; - if (!view->nrows) return; - view->rows[0]->off = off; - view_update(view, &csrx, &csry); sync_view(view, off); } -- 2.49.0