From 606517c920ae9c4b87c9e9254ba4e9640821c167 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 3 Jul 2018 13:56:27 -0400 Subject: [PATCH] fixed a bug when attempting to scroll tag line with only one line present --- TODO.md | 3 ++- lib/view.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/TODO.md b/TODO.md index 54fab8e..32643f0 100644 --- a/TODO.md +++ b/TODO.md @@ -2,8 +2,9 @@ BUGS: +* Undo/Redo not implemented +* gap buffer does not handle UTF-8 currently * Repeatedly pasting eventually causes an assertion -* Segfault while scrolling through testdocs/sherlock.txt * Middle click on selected command does not execute Up Next: diff --git a/lib/view.c b/lib/view.c index 0d0cfb7..492dfda 100644 --- a/lib/view.c +++ b/lib/view.c @@ -344,6 +344,7 @@ static void scroll_up(View* view) { } static void scroll_dn(View* view) { + if (view->nrows <= 1) return; size_t nleft = (view->nrows - view->index); if (nleft <= view->nvisible) { size_t off = view->rows[view->index+1]->off; -- 2.49.0