diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-12-29 08:57:45 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-12-29 08:57:45 +0100 |
| commit | 51736d5d4468330cb2ffe45bb6fdf1119786195c (patch) | |
| tree | 2d70265b4e32745680eaa3e6a3f7f4f817f27e6f | |
| parent | 2f4b69cc67e8863e5789817ed5097158e6163621 (diff) | |
| download | vis-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.
| -rw-r--r-- | view.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |
