From 9c835d33b55b416bab37187ad68a2753dd4c1090 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Thu, 14 Sep 2006 22:11:19 +0000 Subject: [PATCH] Set view->startline to NULL when the line to delete is the first of the view buffer and there are no more lines in the view. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4350 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/textbuffer-view.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index 51a9561c..175bd4f6 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -1143,11 +1143,15 @@ static void view_remove_line(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line, if (view->startline == line) { /* removing the first line in screen */ + int is_last = view->startline->next == NULL; + realcount = view_scroll(view, &view->startline, &view->subline, linecount, FALSE); view->ypos -= realcount; view->empty_linecount += linecount-realcount; + if (is_last == 1) + view->startline = NULL; } } else { if (textbuffer_line_exists_after(view->bottom_startline,