vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit acdf99d48b85c18368ec396511a1f26ce9f5a168
parent 8ad133eadadfb82b989d1ea426ec138a69fdd1cf
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu, 31 Dec 2015 17:21:15 +0100

view: fix regression

This reverts 8514310fd7cd6a7c6043323f4cb0931fcf8fa208. There are
likely still some problems left when editing the end of a file
at end of the visual area.

Diffstat:
Mview.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/view.c b/view.c @@ -383,7 +383,7 @@ static bool view_addch(View *view, Cell *cell) { if (view->line) view->line->lineno = lineno + 1; view->col = 0; - return view->line; + return true; default: if ((unsigned char)cell->data[0] < 128 && !isprint((unsigned char)cell->data[0])) { /* non-printable ascii char, represent it as ^(char + 64) */ @@ -1145,6 +1145,8 @@ void view_cursors_to(Cursor *c, size_t pos) { /* make sure we redraw changes to the very first character of the window */ if (view->start == pos) view->start_last = 0; + if (view->end == pos) + view_viewport_down(view, 1); /* set the start of the viewable region to the start of the line on which * the cursor should be placed. if this line requires more space than * available in the view then simply start displaying text at the new