summaryrefslogtreecommitdiff
path: root/src/fe-text/textbuffer-view.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-05-21 22:45:49 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-05-21 22:45:49 +0000
commitd9bf6afc0afa57850ca9b1e44b4e6c555a3d0f7e (patch)
tree61375054c07b67c24afaec8dadad3296ab784e29 /src/fe-text/textbuffer-view.c
parentc7d4b81069f9e68a2b8004ef07f49d8a78185353 (diff)
downloadirssi-d9bf6afc0afa57850ca9b1e44b4e6c555a3d0f7e.zip
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
Diffstat (limited to 'src/fe-text/textbuffer-view.c')
-rw-r--r--src/fe-text/textbuffer-view.c16
1 files 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,