From eab3608651016936335f85c896faf0b3312e5be7 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Tue, 2 Oct 2018 00:08:30 +0200 Subject: [PATCH] Merge pull request #948 from ailin-nemui/invalid-startline invalidate startline and bottom_startline when hidden (cherry picked from commit 011372ecdd966531c1fd6638a3c5b239c27112ed) --- src/fe-text/textbuffer-view.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index b54f1c8e..de8079e1 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -1210,6 +1210,11 @@ static void view_remove_line(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line, if (is_last == 1) view->startline = NULL; } + + if (view->startline == line) { + view->startline = line->next; + view->subline = 0; + } } else { if (textbuffer_line_exists_after(view->bottom_startline, line)) { @@ -1219,6 +1224,11 @@ static void view_remove_line(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line, view->empty_linecount += linecount-realcount; } + if (view->bottom_startline == line) { + view->bottom_startline = view->bottom_startline->next; + view->bottom_subline = 0; + } + if (textbuffer_line_exists_after(view->startline, line)) { view_remove_line_update_startline(view, line,