mirror of
https://github.com/irssi/irssi.git
synced 2026-08-19 00:22:17 +02:00
Merge pull request #1136 from ailin-nemui/lines
Make sure the bottom_startline is not lost when removing lines
(cherry picked from commit bf3565a720)
This commit is contained in:
parent
da12a0361b
commit
07472fc569
1 changed files with 8 additions and 3 deletions
|
|
@ -1204,14 +1204,14 @@ static void view_remove_line(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line,
|
||||||
LINE_REC *prevline;
|
LINE_REC *prevline;
|
||||||
|
|
||||||
prevline = view->buffer->first_line == line ? NULL :
|
prevline = view->buffer->first_line == line ? NULL :
|
||||||
textbuffer_line_last(view->buffer);
|
textbuffer_line_last(view->buffer)->prev;
|
||||||
view->cache->last_linecount = prevline == NULL ? 0 :
|
view->cache->last_linecount = prevline == NULL ? 0 :
|
||||||
view_get_linecount(view, prevline);
|
view_get_linecount(view, prevline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* first line in the buffer - this is the most commonly
|
||||||
|
removed line.. */
|
||||||
if (view->buffer->first_line == line) {
|
if (view->buffer->first_line == line) {
|
||||||
/* first line in the buffer - this is the most commonly
|
|
||||||
removed line.. */
|
|
||||||
if (view->bottom_startline == line) {
|
if (view->bottom_startline == line) {
|
||||||
/* very small scrollback.. */
|
/* very small scrollback.. */
|
||||||
view->bottom_startline = view->bottom_startline->next;
|
view->bottom_startline = view->bottom_startline->next;
|
||||||
|
|
@ -1288,6 +1288,11 @@ void textbuffer_view_remove_line(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line)
|
||||||
}
|
}
|
||||||
|
|
||||||
textbuffer_remove(view->buffer, line);
|
textbuffer_remove(view->buffer, line);
|
||||||
|
if (view->bottom_startline == NULL) {
|
||||||
|
/* We may have removed the bottom_startline, make sure
|
||||||
|
that scroll doesn't get stuck */
|
||||||
|
textbuffer_view_init_bottom(view);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void textbuffer_view_remove_lines_by_level(TEXT_BUFFER_VIEW_REC *view, int level)
|
void textbuffer_view_remove_lines_by_level(TEXT_BUFFER_VIEW_REC *view, int level)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue