From 6fa7b38e5fb0bddbc65eceea1e9603f7cfdc1b4e Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Thu, 19 Apr 2018 22:02:07 -0400 Subject: [PATCH] fixed inifinite scrolling bug --- lib/view.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/view.c b/lib/view.c index 422a247..2d9756c 100644 --- a/lib/view.c +++ b/lib/view.c @@ -110,6 +110,8 @@ static void resize(View* view, size_t width, size_t nrows, size_t off) { view->nvisible = nrows; view->index = 0; off = buf_bol(&(view->buffer), off); + if (off > buf_end(&(view->buffer))) + off = buf_end(&(view->buffer)); bool first_line_done = false; for (size_t i = 0; nrows > 0; i++) { view->nrows++; -- 2.49.0