aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-12-29 08:57:45 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-12-29 08:57:45 +0100
commit51736d5d4468330cb2ffe45bb6fdf1119786195c (patch)
tree2d70265b4e32745680eaa3e6a3f7f4f817f27e6f /view.c
parent2f4b69cc67e8863e5789817ed5097158e6163621 (diff)
downloadvis-51736d5d4468330cb2ffe45bb6fdf1119786195c.tar.gz
vis-51736d5d4468330cb2ffe45bb6fdf1119786195c.tar.xz
view: improve cursor handling at end of file
Holding down <Backspace> at the end of the file should not keep the cursor on the middle line of the window.
Diffstat (limited to 'view.c')
-rw-r--r--view.c2
1 files changed, 1 insertions, 1 deletions
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);