diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-02-23 20:45:25 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-02-23 20:45:25 +0100 |
| commit | 138bc80f5bec0f192cdba189b6ad8920050eb5cf (patch) | |
| tree | 9e5c9091f419102b8244e1c76131d8ce2954b307 | |
| parent | d42a0df8f1b5e1438f8bb317410b995c8e72efa4 (diff) | |
| download | vis-138bc80f5bec0f192cdba189b6ad8920050eb5cf.tar.gz vis-138bc80f5bec0f192cdba189b6ad8920050eb5cf.tar.xz | |
view: make sure viewport remains valid when scrolling up
In a file with windows style \r\n line endings scrolling
up would wrap around to the end of the file.
| -rw-r--r-- | view.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -664,7 +664,7 @@ bool view_viewport_up(View *view, int n) { } while (text_iterator_byte_prev(&it, &c)); if (c == '\r') off++; - view->start -= off; + view->start -= MIN(view->start, off); view_draw(view); return true; } |
