From efe5f155bf526be4448ed8b4a0cda9072e107a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 4 May 2016 16:50:38 +0200 Subject: 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. --- view.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'view.c') 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; -- cgit v1.2.3