Added ModuleLoad hook that uses the module name as the parameter
This commit is contained in:
parent
c3f694a28f
commit
7866d88131
|
@ -65,6 +65,8 @@ void CommandManager::load_module(StringView module_name, Context& context)
|
|||
module->value.loaded = true;
|
||||
execute(module->value.commands, context);
|
||||
module->value.commands.clear();
|
||||
|
||||
context.hooks().run_hook(Hook::ModuleLoad, module_name, context);
|
||||
}
|
||||
|
||||
struct parse_error : runtime_error
|
||||
|
|
|
@ -57,12 +57,13 @@ enum class Hook
|
|||
WinCreate,
|
||||
WinDisplay,
|
||||
WinResize,
|
||||
WinSetOption
|
||||
WinSetOption,
|
||||
ModuleLoad
|
||||
};
|
||||
|
||||
constexpr auto enum_desc(Meta::Type<Hook>)
|
||||
{
|
||||
return make_array<EnumDesc<Hook>, 41>({
|
||||
return make_array<EnumDesc<Hook>, 42>({
|
||||
{Hook::BufCreate, "BufCreate"},
|
||||
{Hook::BufNewFile, "BufNewFile"},
|
||||
{Hook::BufOpenFile, "BufOpenFile"},
|
||||
|
@ -104,6 +105,7 @@ constexpr auto enum_desc(Meta::Type<Hook>)
|
|||
{Hook::WinDisplay, "WinDisplay"},
|
||||
{Hook::WinResize, "WinResize"},
|
||||
{Hook::WinSetOption, "WinSetOption"},
|
||||
{Hook::ModuleLoad, "ModuleLoad"}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user