From 8684ccb45c267fdeaaa779fce9323047aa5a9e38 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Fri, 28 Sep 2018 11:40:50 +0200 Subject: [PATCH] invalidate startline and bottom_startline when hidden this was overlooked when adding hidden line support. if the lines are removed, Irssi has to update the startline. It does that by "scrolling" the lines to the proper place. The scroll function was adjusted to calculate 0 for hidden lines, thus it would miss them. --- 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 e85381e0..e5141430 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -1230,6 +1230,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)) { @@ -1239,6 +1244,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,