From cff6ed5b6986cc22fe78288a9c7486026578ab47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 31 Dec 2015 17:21:15 +0100 Subject: view: fix regression This reverts 2f4b69cc67e8863e5789817ed5097158e6163621. There are likely still some problems left when editing the end of a file at end of the visual area. --- view.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/view.c b/view.c index 81716e7..db39de7 100644 --- 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 -- cgit v1.2.3