summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-04-15 21:08:49 +0200
committerSebastien Helleu <flashcode@flashtux.org>2009-04-15 21:08:49 +0200
commit46dee68d5777f3c84069f5693c426288a7b39f80 (patch)
tree189e6215e868fbbc0be615329cf818d151d70519
parent9679cd4fbf94da890ad33edca2956c5d5d1189d3 (diff)
downloadweechat-46dee68d5777f3c84069f5693c426288a7b39f80.zip
Jump to last displayed buffer when jumping to current buffer number
For example, if you are on buffer #2, and press alt-1 twice, you'll come back to buffer #2.
-rw-r--r--src/gui/gui-buffer.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index 9a9858e56..c93818ff2 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -62,9 +62,6 @@ char *gui_buffer_notify_string[GUI_BUFFER_NUM_NOTIFY] =
{ "none", "highlight", "message", "all" };
-void gui_buffer_switch_previous (struct t_gui_window *window);
-
-
/*
* gui_buffer_find_pos: find position for buffer in list
*/
@@ -1382,9 +1379,9 @@ gui_buffer_switch_by_number (struct t_gui_window *window, int number)
if (number < 0)
return;
- /* buffer is currently displayed ? */
- if (number == window->buffer->number)
- return;
+ /* buffer is currently displayed ? then jump to previous buffer */
+ if ((number == window->buffer->number) && gui_previous_buffer)
+ number = gui_previous_buffer->number;
/* search for buffer in the list */
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)