kakoune/test/hooks/module-loaded/rc
Maxime Coste 458e3ef20a Immediately execute ModuleLoaded hooks for already loaded modules
This is trickier than expected because ModuleLoaded hooks can (as
any other hooks) use arbitrary regular expressions for their filter.

Fixes #4841
2023-02-14 21:31:29 +11:00

11 lines
511 B
Plaintext

provide-module foo %{ }
provide-module foobar %{ }
hook global ModuleLoaded foo %{ set-register a %reg{a} literal }
hook global ModuleLoaded f.* %{ set-register a %reg{a} regex }
hook -once global ModuleLoaded f.* %{ set-register a %reg{a} regex-once }
require-module foo
require-module foobar
hook global ModuleLoaded foo %{ set-register a %reg{a} literal-late }
hook global ModuleLoaded f.* %{ set-register a %reg{a} late-regex }
hook -once global ModuleLoaded f.* %{ set-register a %reg{a} late-regex-once }