summaryrefslogtreecommitdiff
path: root/src/gui/gui-buffer.c
diff options
context:
space:
mode:
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 9e32c7f23..e9fca3933 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -4494,6 +4494,33 @@ gui_buffer_jump_smart (struct t_gui_window *window)
}
/*
+ * Jumps to last buffer that is visible (not hidden).
+ */
+
+void
+gui_buffer_jump_last_visible_number (struct t_gui_window *window)
+{
+ struct t_gui_buffer *ptr_buffer;
+ int number;
+
+ if (!window)
+ return;
+
+ /* search last non-hidden buffer */
+ for (ptr_buffer = last_gui_buffer; ptr_buffer;
+ ptr_buffer = ptr_buffer->prev_buffer)
+ {
+ if (!ptr_buffer->hidden)
+ break;
+ }
+
+ number = (ptr_buffer) ?
+ ptr_buffer->number : ((last_gui_buffer) ? last_gui_buffer->number : -1);
+ if (number > 0)
+ gui_buffer_switch_by_number (gui_current_window, number);
+}
+
+/*
* Jumps to last buffer displayed (before last jump to a buffer).
*/