diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2007-05-23 16:07:31 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2007-05-23 16:07:31 +0000 |
commit | fb3fd5b0eb58db1f53aad2236d4ca25f7a695065 (patch) | |
tree | 6fe155fc4dbe4f4ec659708fea7aa02eb8860d3b | |
parent | c0762e3b13686440dfc3e6e10ceee525fc7c2111 (diff) | |
download | weechat-fb3fd5b0eb58db1f53aad2236d4ca25f7a695065.zip |
Improved key bindings: now possible to bind a key on many commands, separated by semicolon (task #5444)
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/gui/gui-keyboard.c | 17 | ||||
-rw-r--r-- | weechat/ChangeLog | 4 | ||||
-rw-r--r-- | weechat/src/gui/gui-keyboard.c | 17 |
4 files changed, 34 insertions, 8 deletions
@@ -1,10 +1,12 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2007-05-22 +ChangeLog - 2007-05-23 Version 0.2.5 (under dev!): + * improved key bindings: now possible to bind a key on many commands, + separated by semicolon (task #5444) * improved IRC long message split: use word boundary (task #6685) * removed ":" for unknown IRC commands before arguments (bug #19929) * fixed "%C" completion: now completes with all channels of all servers diff --git a/src/gui/gui-keyboard.c b/src/gui/gui-keyboard.c index bf617011c..2c77eae7a 100644 --- a/src/gui/gui-keyboard.c +++ b/src/gui/gui-keyboard.c @@ -552,6 +552,7 @@ gui_keyboard_pressed (char *key_str) int first_key; t_gui_key *ptr_key; char *buffer_before_key; + char **commands, **ptr_cmd; /* add key to buffer */ first_key = (gui_key_buffer[0] == '\0'); @@ -576,9 +577,19 @@ gui_keyboard_pressed (char *key_str) strdup (gui_current_window->buffer->input_buffer) : strdup (""); gui_key_buffer[0] = '\0'; if (ptr_key->command) - user_command (SERVER(gui_current_window->buffer), - CHANNEL(gui_current_window->buffer), - ptr_key->command, 0); + { + commands = split_multi_command (ptr_key->command, ';'); + if (commands) + { + for (ptr_cmd = commands; *ptr_cmd; ptr_cmd++) + { + user_command (SERVER(gui_current_window->buffer), + CHANNEL(gui_current_window->buffer), + *ptr_cmd, 0); + } + free_multi_command (commands); + } + } else (void)(ptr_key->function)(gui_current_window, ptr_key->args); #ifdef PLUGINS diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 135d65bc7..603bc5c7f 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,10 +1,12 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2007-05-22 +ChangeLog - 2007-05-23 Version 0.2.5 (under dev!): + * improved key bindings: now possible to bind a key on many commands, + separated by semicolon (task #5444) * improved IRC long message split: use word boundary (task #6685) * removed ":" for unknown IRC commands before arguments (bug #19929) * fixed "%C" completion: now completes with all channels of all servers diff --git a/weechat/src/gui/gui-keyboard.c b/weechat/src/gui/gui-keyboard.c index bf617011c..2c77eae7a 100644 --- a/weechat/src/gui/gui-keyboard.c +++ b/weechat/src/gui/gui-keyboard.c @@ -552,6 +552,7 @@ gui_keyboard_pressed (char *key_str) int first_key; t_gui_key *ptr_key; char *buffer_before_key; + char **commands, **ptr_cmd; /* add key to buffer */ first_key = (gui_key_buffer[0] == '\0'); @@ -576,9 +577,19 @@ gui_keyboard_pressed (char *key_str) strdup (gui_current_window->buffer->input_buffer) : strdup (""); gui_key_buffer[0] = '\0'; if (ptr_key->command) - user_command (SERVER(gui_current_window->buffer), - CHANNEL(gui_current_window->buffer), - ptr_key->command, 0); + { + commands = split_multi_command (ptr_key->command, ';'); + if (commands) + { + for (ptr_cmd = commands; *ptr_cmd; ptr_cmd++) + { + user_command (SERVER(gui_current_window->buffer), + CHANNEL(gui_current_window->buffer), + *ptr_cmd, 0); + } + free_multi_command (commands); + } + } else (void)(ptr_key->function)(gui_current_window, ptr_key->args); #ifdef PLUGINS |