Merge remote-tracking branch 'codesoap/rename_moduleload'
This commit is contained in:
commit
eae92c9ae3
|
@ -28,8 +28,8 @@ released versions.
|
||||||
`require-module` commands that allows for lazily loading language
|
`require-module` commands that allows for lazily loading language
|
||||||
support files with dependency resolution.
|
support files with dependency resolution.
|
||||||
|
|
||||||
* Added a new hook `ModuleLoad` which is run when a module is loaded,
|
* Added a new hook `ModuleLoaded` which is run after a module is
|
||||||
allowing for module specific configuration.
|
loaded, allowing for module specific configuration.
|
||||||
|
|
||||||
* Shell quoting of lists is not automatic anymore, `$kak_quoted_...`
|
* Shell quoting of lists is not automatic anymore, `$kak_quoted_...`
|
||||||
makes it opt-in, and works for all option types.
|
makes it opt-in, and works for all option types.
|
||||||
|
|
|
@ -176,8 +176,8 @@ name. Hooks with no description will always use an empty string.
|
||||||
*RawKey* `key`::
|
*RawKey* `key`::
|
||||||
Triggered whenever a key is pressed by the user
|
Triggered whenever a key is pressed by the user
|
||||||
|
|
||||||
*ModuleLoad* `module`::
|
*ModuleLoaded* `module`::
|
||||||
Triggered when a module is evaluated by the first `require-module` call
|
Triggered after a module is evaluated by the first `require-module` call
|
||||||
|
|
||||||
Note that some hooks will not consider underlying scopes depending on what
|
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
|
context they are bound to be run into, e.g. the `BufWritePost` hook is a buffer
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# http://tmux.github.io/
|
# http://tmux.github.io/
|
||||||
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
||||||
|
|
||||||
hook global ModuleLoad tmux %{
|
hook global ModuleLoaded tmux %{
|
||||||
require-module tmux-repl
|
require-module tmux-repl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
hook global ModuleLoad x11 %{
|
hook global ModuleLoaded x11 %{
|
||||||
require-module x11-repl
|
require-module x11-repl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ void CommandManager::load_module(StringView module_name, Context& context)
|
||||||
execute(module->value.commands, empty_context);
|
execute(module->value.commands, empty_context);
|
||||||
module->value.commands.clear();
|
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
|
struct parse_error : runtime_error
|
||||||
|
|
|
@ -57,7 +57,7 @@ enum class Hook
|
||||||
WinDisplay,
|
WinDisplay,
|
||||||
WinResize,
|
WinResize,
|
||||||
WinSetOption,
|
WinSetOption,
|
||||||
ModuleLoad
|
ModuleLoaded
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr auto enum_desc(Meta::Type<Hook>)
|
constexpr auto enum_desc(Meta::Type<Hook>)
|
||||||
|
@ -103,7 +103,7 @@ constexpr auto enum_desc(Meta::Type<Hook>)
|
||||||
{Hook::WinDisplay, "WinDisplay"},
|
{Hook::WinDisplay, "WinDisplay"},
|
||||||
{Hook::WinResize, "WinResize"},
|
{Hook::WinResize, "WinResize"},
|
||||||
{Hook::WinSetOption, "WinSetOption"},
|
{Hook::WinSetOption, "WinSetOption"},
|
||||||
{Hook::ModuleLoad, "ModuleLoad"}
|
{Hook::ModuleLoaded, "ModuleLoaded"}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user