mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
modules/lazyload: warn enabling a lazy loading provider
This commit is contained in:
parent
0997b371c7
commit
76b567b43c
1 changed files with 28 additions and 0 deletions
|
@ -26,5 +26,33 @@ in
|
|||
'';
|
||||
}
|
||||
];
|
||||
warnings =
|
||||
let
|
||||
ignoredPackages = [
|
||||
# removed
|
||||
"treesitter-playground"
|
||||
# renamed
|
||||
"surround"
|
||||
"null-ls"
|
||||
"wilder-nvim"
|
||||
];
|
||||
|
||||
pluginsWithLazyLoad = builtins.filter (
|
||||
x:
|
||||
!(lib.elem x ignoredPackages)
|
||||
&& lib.hasAttr "lazyLoad" config.plugins.${x}
|
||||
&& config.plugins.${x}.lazyLoad.enable
|
||||
) (builtins.attrNames config.plugins);
|
||||
count = builtins.length pluginsWithLazyLoad;
|
||||
in
|
||||
lib.optionals (count > 0 && !config.plugins.lz-n.enable) [
|
||||
''
|
||||
You have enabled lazy loading support for the following plugins but have not enabled a lazy loading provider.
|
||||
${lib.concatImapStringsSep "\n" (i: x: "${toString i}. plugins.${x}") pluginsWithLazyLoad}
|
||||
|
||||
Currently supported lazy providers:
|
||||
- lz-n
|
||||
''
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue