diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2014-02-13 11:21:30 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2014-02-13 11:21:30 +0100 |
commit | 8ffba2ad9e113b81acb046e559754b85158ffdd7 (patch) | |
tree | ce0ea0bf19526d397c1faa19c5a215265697301b | |
parent | 4f0be6edb37e986815732f0731ec191923e7d5f6 (diff) | |
download | weechat-8ffba2ad9e113b81acb046e559754b85158ffdd7.zip |
trigger: add the name of buffer on trigger monitor when executing a command
-rw-r--r-- | src/plugins/trigger/trigger-callback.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/plugins/trigger/trigger-callback.c b/src/plugins/trigger/trigger-callback.c index f58df497e..42b6aeb12 100644 --- a/src/plugins/trigger/trigger-callback.c +++ b/src/plugins/trigger/trigger-callback.c @@ -202,6 +202,13 @@ trigger_callback_run_command (struct t_trigger *trigger, if (!trigger->commands) return; + if (!buffer) + { + buffer = weechat_buffer_search_main (); + if (!buffer) + return; + } + for (i = 0; trigger->commands[i]; i++) { command_eval = weechat_string_eval_expression (trigger->commands[i], @@ -213,8 +220,18 @@ trigger_callback_run_command (struct t_trigger *trigger, if (trigger_buffer) { weechat_printf_tags (trigger_buffer, "no_trigger", - "\t running command \"%s\"", - command_eval); + _("%s running command %s\"%s%s%s\"%s " + "on buffer %s%s%s"), + "\t", + weechat_color ("chat_delimiters"), + weechat_color ("reset"), + command_eval, + weechat_color ("chat_delimiters"), + weechat_color ("reset"), + weechat_color ("chat_buffer"), + weechat_buffer_get_string (buffer, + "full_name"), + weechat_color ("reset")); } weechat_command (buffer, command_eval); trigger->hook_count_cmd++; |