summaryrefslogtreecommitdiff
path: root/src/fe-text/textbuffer-view.c
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2006-09-14 22:11:19 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2006-09-14 22:11:19 +0000
commit9c835d33b55b416bab37187ad68a2753dd4c1090 (patch)
tree6098675d221d59894503e5ce17308950d5903946 /src/fe-text/textbuffer-view.c
parent9bd7272d47b7f9e724813e2ed5a0e6bbf6952d18 (diff)
downloadirssi-9c835d33b55b416bab37187ad68a2753dd4c1090.zip
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
Diffstat (limited to 'src/fe-text/textbuffer-view.c')
-rw-r--r--src/fe-text/textbuffer-view.c4
1 files changed, 4 insertions, 0 deletions
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,