vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 9af9fdefd5a91c0e49315cf3e044d3ffb78a86ca parent 4498e0fc1e41dc981320c73467a9634576313215 Author: Marc André Tanner <mat@brain-dump.org> Date: Wed, 4 May 2016 16:50:38 +0200 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:
| M | view.c | | | 6 | ------ |
1 file changed, 0 insertions(+), 6 deletions(-)
diff --git 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;