lazy: add assertions against common problems (#476)

* lazy: allow null package

* lazy: add assertions for common pitfalls

* lazy: pass plugin name to custom load function

* lazy: format description

Co-authored-by: raf <raf@notashelf.dev>

---------

Co-authored-by: raf <raf@notashelf.dev>
This commit is contained in:
Ching Pei Yang 2024-11-29 00:16:17 +01:00 committed by GitHub
commit fee1b46924
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 8 deletions

View file

@ -66,8 +66,12 @@
lznPluginType = submodule {
options = {
package = mkOption {
type = pluginType;
description = "Plugin package";
type = nullOr pluginType;
description = ''
Plugin package.
If null, a custom load function must be provided
'';
};
setupModule = mkOption {
@ -173,7 +177,7 @@
description = ''
Lua code to override the `vim.g.lz_n.load()` function for a single plugin.
This will be wrapped in a function.
This will be wrapped in a `function(name) ... end`.
'';
};
};