vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 6b84157d1a1ff32411dc2dfbbbc4a564bae7f1a3
parent 9160b85edda838fc84a6ad9e163559384b0d34d2
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sun,  6 Nov 2016 21:31:03 +0100

view: make viewport adjustment more robust

Make sure that the view_cursors_scroll_to function does not enter
an infinite loop.

Diffstat:
Mview.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/view.c b/view.c @@ -615,7 +615,7 @@ static size_t cursor_set(Cursor *cursor, Line *line, int col) { bool view_viewport_down(View *view, int n) { Line *line; - if (view->end == text_size(view->text)) + if (view->end >= text_size(view->text)) return false; if (n >= view->height) { view->start = view->end;