1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

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
This commit is contained in:
Emanuele Giaquinta 2006-09-14 22:11:19 +00:00 committed by exg
parent 9bd7272d47
commit 9c835d33b5

View File

@ -1143,11 +1143,15 @@ static void view_remove_line(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
if (view->startline == line) { if (view->startline == line) {
/* removing the first line in screen */ /* removing the first line in screen */
int is_last = view->startline->next == NULL;
realcount = view_scroll(view, &view->startline, realcount = view_scroll(view, &view->startline,
&view->subline, &view->subline,
linecount, FALSE); linecount, FALSE);
view->ypos -= realcount; view->ypos -= realcount;
view->empty_linecount += linecount-realcount; view->empty_linecount += linecount-realcount;
if (is_last == 1)
view->startline = NULL;
} }
} else { } else {
if (textbuffer_line_exists_after(view->bottom_startline, if (textbuffer_line_exists_after(view->bottom_startline,