From 8ffba2ad9e113b81acb046e559754b85158ffdd7 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Thu, 13 Feb 2014 11:21:30 +0100 Subject: trigger: add the name of buffer on trigger monitor when executing a command --- src/plugins/trigger/trigger-callback.c | 21 +++++++++++++++++++-- 1 file 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++; -- cgit v1.2.3