From: Michael D. Lowis Date: Tue, 3 Jul 2018 17:56:27 +0000 (-0400) Subject: fixed a bug when attempting to scroll tag line with only one line present X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=606517c920ae9c4b87c9e9254ba4e9640821c167;p=projs%2Ftide.git fixed a bug when attempting to scroll tag line with only one line present --- 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;