aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-05-04 16:50:38 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-05-04 17:45:11 +0200
commitefe5f155bf526be4448ed8b4a0cda9072e107a79 (patch)
tree957479a4fcc93fe429af945fbc4bbf984df8080a /view.c
parent6df3fa2b9016cf2627ea6d0d81d6171f21c08e04 (diff)
downloadvis-efe5f155bf526be4448ed8b4a0cda9072e107a79.tar.gz
vis-efe5f155bf526be4448ed8b4a0cda9072e107a79.tar.xz
view: simplify line up/down motions
As a consequence the general cursor placement code takes effect and always places the cursor in the middle of the window when moving out of the viewable range. Whether this behavior is desirable remains to be seen.
Diffstat (limited to 'view.c')
-rw-r--r--view.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/view.c b/view.c
index 289ec18..91df559 100644
--- a/view.c
+++ b/view.c
@@ -921,10 +921,6 @@ size_t view_scroll_down(View *view, int lines) {
}
size_t view_line_up(Cursor *cursor) {
- if (cursor->line && cursor->line->prev && cursor->line->prev->prev &&
- cursor->line->lineno != cursor->line->prev->lineno &&
- cursor->line->prev->lineno != cursor->line->prev->prev->lineno)
- return view_screenline_up(cursor);
int lastcol = cursor->lastcol;
if (!lastcol)
lastcol = cursor->col;
@@ -936,8 +932,6 @@ size_t view_line_up(Cursor *cursor) {
}
size_t view_line_down(Cursor *cursor) {
- if (cursor->line && (!cursor->line->next || cursor->line->next->lineno != cursor->line->lineno))
- return view_screenline_down(cursor);
int lastcol = cursor->lastcol;
if (!lastcol)
lastcol = cursor->col;