From 51736d5d4468330cb2ffe45bb6fdf1119786195c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 29 Dec 2015 08:57:45 +0100 Subject: view: improve cursor handling at end of file Holding down at the end of the file should not keep the cursor on the middle line of the window. --- view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'view.c') diff --git a/view.c b/view.c index 8d5ae46..81716e7 100644 --- a/view.c +++ b/view.c @@ -1137,7 +1137,7 @@ void view_cursors_to(Cursor *c, size_t pos) { c->mark = text_mark_set(view->text, pos); size_t max = text_size(view->text); - if (pos == max && view->end != max) { + if (pos == max && view->end < max) { /* do not display an empty screen when shoviewg the end of the file */ view->start = pos; view_viewport_up(view, view->height / 2); -- cgit v1.2.3