summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-10-26 12:33:54 +0100
committerSebastien Helleu <flashcode@flashtux.org>2008-10-26 12:33:54 +0100
commitc1fc320025179f81038cbe4d4bdc4c1e188b139c (patch)
tree723fde86036db68608cdcdcd89bc8625686a8466 /src/gui
parentda5e8135363b0186e7e83f3407b1ffd572b960cd (diff)
downloadweechat-c1fc320025179f81038cbe4d4bdc4c1e188b139c.zip
Do not clear buffer content with /buffer clear for buffers with free content
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui-buffer.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index d66f918c4..76f56061e 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -1134,24 +1134,27 @@ gui_buffer_clear (struct t_gui_buffer *buffer)
if (!buffer)
return;
- /* remove buffer from hotlist */
- gui_hotlist_remove_buffer (buffer);
-
- /* remove all lines */
- gui_chat_line_free_all (buffer);
-
- /* remove any scroll for buffer */
- for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
+ if (buffer->type == GUI_BUFFER_TYPE_FORMATED)
{
- if (ptr_win->buffer == buffer)
+ /* remove buffer from hotlist */
+ gui_hotlist_remove_buffer (buffer);
+
+ /* remove all lines */
+ gui_chat_line_free_all (buffer);
+
+ /* remove any scroll for buffer */
+ for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
- ptr_win->first_line_displayed = 1;
- ptr_win->start_line = NULL;
- ptr_win->start_line_pos = 0;
+ if (ptr_win->buffer == buffer)
+ {
+ ptr_win->first_line_displayed = 1;
+ ptr_win->start_line = NULL;
+ ptr_win->start_line_pos = 0;
+ }
}
+
+ gui_buffer_ask_chat_refresh (buffer, 2);
}
-
- gui_buffer_ask_chat_refresh (buffer, 2);
}
/*
@@ -1163,7 +1166,8 @@ gui_buffer_clear_all ()
{
struct t_gui_buffer *ptr_buffer;
- for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
+ for (ptr_buffer = gui_buffers; ptr_buffer;
+ ptr_buffer = ptr_buffer->next_buffer)
{
gui_buffer_clear (ptr_buffer);
}