From d9bf6afc0afa57850ca9b1e44b4e6c555a3d0f7e Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 21 May 2001 22:45:49 +0000 Subject: [PATCH] removing line from the top of the screen crashed irssi git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1507 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/textbuffer-view.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index 9480d259..2199a887 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -905,17 +905,19 @@ static void view_remove_line(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line, if (line == view->buffer->lines->data) { /* first line in the buffer - this is the most commonly removed line.. */ - if (line == view->bottom_startline->data) { + if (view->bottom_startline->data == line) { /* very small scrollback.. */ view->bottom_startline = view->bottom_startline->next; view->bottom_subline = 0; + } - if (view->startline->data == line) { - view->startline = view->startline->next; - view->subline = 0; - view->empty_linecount += linecount; - view->ypos -= linecount; - } + if (view->startline->data == line) { + /* removing the first line in screen */ + realcount = view_scroll(view, &view->startline, + &view->subline, + linecount, TRUE); + view->ypos -= realcount; + view->empty_linecount += linecount-realcount; } } else if (g_list_find(view->bottom_startline, line) != NULL) { realcount = view_scroll(view, &view->bottom_startline,