diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-12-20 08:07:13 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-12-20 08:07:13 +0100 |
commit | 0b2be21f1f42c2a1b0c200b339d7d2e59595da4c (patch) | |
tree | b9c37d385beaccfc22a45e85ecd5ba5680607700 /src/gui | |
parent | 280784dcddcdb94328211041688582c35912fd1e (diff) | |
download | weechat-0b2be21f1f42c2a1b0c200b339d7d2e59595da4c.zip |
core: fully evaluate commands bound to keys in cursor and mouse contexts
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui-key.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c index 24f914da7..a84c85391 100644 --- a/src/gui/gui-key.c +++ b/src/gui/gui-key.c @@ -31,6 +31,7 @@ #include "../core/weechat.h" #include "../core/wee-config.h" +#include "../core/wee-eval.h" #include "../core/wee-hashtable.h" #include "../core/wee-hdata.h" #include "../core/wee-hook.h" @@ -1029,7 +1030,7 @@ gui_key_focus_command (const char *key, int context, struct t_hashtable **hashtable_focus) { struct t_gui_key *ptr_key; - int i, errors, matching, debug, rc; + int i, matching, debug, rc; long unsigned int value; char *command, **commands; const char *str_buffer; @@ -1131,25 +1132,19 @@ gui_key_focus_command (const char *key, int context, } else { - command = string_replace_with_callback (commands[i], - "${", "}", - &gui_key_focus_command_replace_cb, - hashtable, - &errors); + command = eval_expression (commands[i], NULL, + hashtable, NULL); if (command) { - if (errors == 0) + if (debug) { - if (debug) - { - gui_chat_printf (NULL, - _("Executing command: \"%s\" " - "on buffer \"%s\""), - command, - ptr_buffer->full_name); - } - (void) input_data (ptr_buffer, command); + gui_chat_printf (NULL, + _("Executing command: \"%s\" " + "on buffer \"%s\""), + command, + ptr_buffer->full_name); } + (void) input_data (ptr_buffer, command); free (command); } } |