summaryrefslogtreecommitdiff
path: root/src/gui/gui-buffer.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-08-04 17:24:53 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-08-04 17:24:53 +0200
commit6442302f3fc297b592cd16d2bfb41535532405cd (patch)
tree0ac20d7a123101dd38ff2398b019ef0ecdf5a2df /src/gui/gui-buffer.c
parentd7a46135ee6770d9aabc395988bbb867499cf2a4 (diff)
downloadweechat-6442302f3fc297b592cd16d2bfb41535532405cd.zip
core: add option -all for command /buffer unmerge
Diffstat (limited to 'src/gui/gui-buffer.c')
-rw-r--r--src/gui/gui-buffer.c27
1 files changed, 27 insertions, 0 deletions
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
@@ -2581,6 +2581,33 @@ gui_buffer_unmerge (struct t_gui_buffer *buffer, int number)
}
/*
+ * 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)
*/