on_require handler in under 100 lines #25
Closed
BirdeeHub
started this conversation in
Show and tell
Replies: 1 comment
-
Closing, because this example is outdated and does not work with the current version of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If anyone wants something that will run when specific lua modules are required, this handler will add a field that allows you to specify some.
If you saved it in lua/on_require.lua then you could put
require('lz.n').register_handler(require("on_require"))
at the start of your config.Then when you want something to load on require, you can put into the plugin spec the top level modules that you would like to lazy load the plugin on.
This is not well tested, if anyone experiences any bugs, fix them and tell us about it if you want. Its your code now XD
This is mostly just a complicated demo of the new register_handler feature
A much simpler example is here #18 (comment)
For example:
Here it is:
Beta Was this translation helpful? Give feedback.
All reactions