From 3a831afd078c9890ba8919ee8b40001b897073ca Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 24 Apr 2026 15:41:18 -0500 Subject: [PATCH] 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. --- modules/lazyload.nix | 4 +-- .../test-sources/plugins/lazyloading/lz-n.nix | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/modules/lazyload.nix b/modules/lazyload.nix index 9061a996..7f18b518 100644 --- a/modules/lazyload.nix +++ b/modules/lazyload.nix @@ -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; diff --git a/tests/test-sources/plugins/lazyloading/lz-n.nix b/tests/test-sources/plugins/lazyloading/lz-n.nix index f5a50a91..8605bc97 100644 --- a/tests/test-sources/plugins/lazyloading/lz-n.nix +++ b/tests/test-sources/plugins/lazyloading/lz-n.nix @@ -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 = "nt"; + __unkeyed-3 = "Neotest summary"; + desc = "Summary toggle"; + } + ]; + }; + }; + }; + }; + lazy-load-colorscheme-properly = { config, lib, ... }: {