diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 23804e88f..0a5291d84 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -17,6 +17,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] === New features +* core: fully evaluate commands bound to keys in cursor and mouse contexts * core: add option weechat.completion.command_inline (task #12491) * core: add bar item "mouse_status", new options weechat.look.item_mouse_status and weechat.color.status_mouse (closes #247) 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); } }