From 6442302f3fc297b592cd16d2bfb41535532405cd Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Thu, 4 Aug 2011 17:24:53 +0200 Subject: core: add option -all for command /buffer unmerge --- src/gui/gui-buffer.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/gui/gui-buffer.c') diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index cc2f2ef3b..766ef87f2 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -2580,6 +2580,33 @@ gui_buffer_unmerge (struct t_gui_buffer *buffer, int number) WEECHAT_HOOK_SIGNAL_POINTER, buffer); } +/* + * gui_buffer_unmerge_all: unmerge all merged buffers + */ + +void +gui_buffer_unmerge_all () +{ + int number, count_merged, i; + struct t_gui_buffer *ptr_buffer; + + number = 1; + while (number <= last_gui_buffer->number) + { + count_merged = gui_buffer_count_merged_buffers (number); + if (count_merged > 1) + { + for (i = 0; i < count_merged - 1; i++) + { + ptr_buffer = gui_buffer_search_by_number (number); + if (ptr_buffer) + gui_buffer_unmerge (ptr_buffer, -1); + } + } + number++; + } +} + /* * gui_buffer_undo_snap: do a "snapshot" of buffer input (save content and * position) -- cgit v1.2.3