user defined hooks can access the hook parameter in shell with $kak_hook_param

This commit is contained in:
Maxime Coste 2013-03-20 19:06:15 +01:00
parent d99fe87b43
commit 3883bffacc

View File

@ -346,7 +346,8 @@ void add_hook(const CommandParameters& params, Context& context)
String command = params[3];
auto hook_func = [=](const String& param, Context& context) {
if (boost::regex_match(param.begin(), param.end(), regex))
CommandManager::instance().execute(command, context);
CommandManager::instance().execute(command, context, {},
{ { "hook_param", param } });
};
const String& scope = params[0];