diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-04-21 17:48:44 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-04-21 17:48:44 +0200 |
commit | 890b2ed23a1311c9051cceb1675b9bb27cf45c70 (patch) | |
tree | 1a23dd3b00a3e026f63b6cfa17be393f2e243b64 /src | |
parent | 7bed0ec48541eda79384fda9275769692846be91 (diff) | |
download | weechat-890b2ed23a1311c9051cceb1675b9bb27cf45c70.zip |
Add new option weechat.look.jump_current_to_previous_buffer
Diffstat (limited to 'src')
-rw-r--r-- | src/core/wee-config.c | 8 | ||||
-rw-r--r-- | src/core/wee-config.h | 1 | ||||
-rw-r--r-- | src/gui/gui-buffer.c | 12 |
3 files changed, 19 insertions, 2 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 94ccb915b..307a6558d 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -82,6 +82,7 @@ struct t_config_option *config_look_hotlist_names_level; struct t_config_option *config_look_hotlist_short_names; struct t_config_option *config_look_hotlist_sort; struct t_config_option *config_look_item_time_format; +struct t_config_option *config_look_jump_current_to_previous_buffer; struct t_config_option *config_look_nickmode; struct t_config_option *config_look_nickmode_empty; struct t_config_option *config_look_paste_max_lines; @@ -1144,6 +1145,13 @@ config_weechat_init_options () "item_time_format", "string", N_("time format for \"time\" bar item"), NULL, 0, 0, "%H:%M", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_jump_current_to_previous_buffer = config_file_new_option ( + weechat_config_file, ptr_section, + "jump_current_to_previous_buffer", "boolean", + N_("jump to previous buffer displayed when jumping to current buffer " + "number (to easyly switch to another buffer, then come back to " + "current buffer)"), + NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); config_look_nickmode = config_file_new_option ( weechat_config_file, ptr_section, "nickmode", "boolean", diff --git a/src/core/wee-config.h b/src/core/wee-config.h index f8754ae2e..4f8fb0c9c 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -88,6 +88,7 @@ extern struct t_config_option *config_look_hotlist_names_level; extern struct t_config_option *config_look_hotlist_short_names; extern struct t_config_option *config_look_hotlist_sort; extern struct t_config_option *config_look_item_time_format; +extern struct t_config_option *config_look_jump_current_to_previous_buffer; extern struct t_config_option *config_look_nickmode; extern struct t_config_option *config_look_nickmode_empty; extern struct t_config_option *config_look_paste_max_lines; diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index c93818ff2..68cd3bac5 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -1380,8 +1380,16 @@ gui_buffer_switch_by_number (struct t_gui_window *window, int number) return; /* buffer is currently displayed ? then jump to previous buffer */ - if ((number == window->buffer->number) && gui_previous_buffer) - number = gui_previous_buffer->number; + if (number == window->buffer->number) + { + if (CONFIG_BOOLEAN(config_look_jump_current_to_previous_buffer) + && gui_previous_buffer) + { + number = gui_previous_buffer->number; + } + else + return; + } /* search for buffer in the list */ for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer) |