Generalize window_lastlog_clear in textbuffer_view_remove_lines_by_level.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4419 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2007-02-17 15:31:10 +00:00 committed by exg
commit 541fa72f46
3 changed files with 20 additions and 21 deletions

View file

@ -1201,6 +1201,24 @@ void textbuffer_view_remove_line(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line)
textbuffer_remove(view->buffer, line);
}
void textbuffer_view_remove_lines_by_level(TEXT_BUFFER_VIEW_REC *view, int level)
{
LINE_REC *line, *next;
term_refresh_freeze();
line = textbuffer_view_get_lines(view);
while (line != NULL) {
next = line->next;
if (line->info.level & level)
textbuffer_view_remove_line(view, line);
line = next;
}
textbuffer_view_redraw(view);
term_refresh_thaw();
}
static int g_free_true(void *data)
{
g_free(data);