mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 03:40:16 +02:00
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:
parent
1a195da685
commit
541fa72f46
3 changed files with 20 additions and 21 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue