Merge remote-tracking branch 'codesoap/rename_moduleload'

This commit is contained in:
Maxime Coste 2019-06-29 09:52:20 +10:00
commit eae92c9ae3
6 changed files with 9 additions and 9 deletions

View File

@ -28,8 +28,8 @@ released versions.
`require-module` commands that allows for lazily loading language
support files with dependency resolution.
* Added a new hook `ModuleLoad` which is run when a module is loaded,
allowing for module specific configuration.
* Added a new hook `ModuleLoaded` which is run after a module is
loaded, allowing for module specific configuration.
* Shell quoting of lists is not automatic anymore, `$kak_quoted_...`
makes it opt-in, and works for all option types.

View File

@ -176,8 +176,8 @@ name. Hooks with no description will always use an empty string.
*RawKey* `key`::
Triggered whenever a key is pressed by the user
*ModuleLoad* `module`::
Triggered when a module is evaluated by the first `require-module` call
*ModuleLoaded* `module`::
Triggered after a module is evaluated by the first `require-module` call
Note that some hooks will not consider underlying scopes depending on what
context they are bound to be run into, e.g. the `BufWritePost` hook is a buffer

View File

@ -1,7 +1,7 @@
# http://tmux.github.io/
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
hook global ModuleLoad tmux %{
hook global ModuleLoaded tmux %{
require-module tmux-repl
}

View File

@ -1,4 +1,4 @@
hook global ModuleLoad x11 %{
hook global ModuleLoaded x11 %{
require-module x11-repl
}

View File

@ -67,7 +67,7 @@ void CommandManager::load_module(StringView module_name, Context& context)
execute(module->value.commands, empty_context);
module->value.commands.clear();
context.hooks().run_hook(Hook::ModuleLoad, module_name, context);
context.hooks().run_hook(Hook::ModuleLoaded, module_name, context);
}
struct parse_error : runtime_error

View File

@ -57,7 +57,7 @@ enum class Hook
WinDisplay,
WinResize,
WinSetOption,
ModuleLoad
ModuleLoaded
};
constexpr auto enum_desc(Meta::Type<Hook>)
@ -103,7 +103,7 @@ constexpr auto enum_desc(Meta::Type<Hook>)
{Hook::WinDisplay, "WinDisplay"},
{Hook::WinResize, "WinResize"},
{Hook::WinSetOption, "WinSetOption"},
{Hook::ModuleLoad, "ModuleLoad"}
{Hook::ModuleLoaded, "ModuleLoaded"}
});
}