modules/lazyload: fix provider warning detection

Check the existing lazyLoad option when collecting plugins that request lazy loading without an enabled provider. The previous lowercase lookup skipped the warning entirely.

Add a regression test that expects the missing-provider warning.
This commit is contained in:
Austin Horstman 2026-04-24 15:41:18 -05:00 committed by Gaétan Lepage
parent b684241888
commit 3a831afd07
2 changed files with 28 additions and 2 deletions

View file

@ -38,8 +38,8 @@ in
pluginsWithLazyLoad = builtins.filter (
x:
lib.isOption (options.plugins.${x}.lazyload or null)
&& isVisible options.plugins.${x}.lazyload
lib.isOption (options.plugins.${x}.lazyLoad or null)
&& isVisible options.plugins.${x}.lazyLoad
&& config.plugins.${x}.lazyLoad.enable
) (builtins.attrNames config.plugins);
count = builtins.length pluginsWithLazyLoad;

View file

@ -180,6 +180,32 @@ in
];
};
warn-when-lazy-loading-without-provider = {
test = {
runNvim = false;
warnings = expect: [
(expect "count" 1)
(expect "any" "You have enabled lazy loading support")
];
};
plugins.neotest = {
enable = true;
lazyLoad = {
enable = true;
settings = {
keys = [
{
__unkeyed-1 = "<leader>nt";
__unkeyed-3 = "<CMD>Neotest summary<CR>";
desc = "Summary toggle";
}
];
};
};
};
};
lazy-load-colorscheme-properly =
{ config, lib, ... }:
{