mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
treewide: use mkWarnings where possible
This commit is contained in:
parent
abba4af10b
commit
12e658eca8
34 changed files with 309 additions and 225 deletions
|
@ -62,23 +62,28 @@ in
|
|||
{
|
||||
config = {
|
||||
warnings =
|
||||
lib.optionals (options.plugins.web-devicons.enable.highestPrio == 1490) [
|
||||
''
|
||||
Nixvim: `plugins.web-devicons` was enabled automatically because the following plugins are enabled.
|
||||
(lib.nixvim.mkWarnings "plugins.web-devicons" {
|
||||
when = options.plugins.web-devicons.enable.highestPrio == 1490;
|
||||
|
||||
message = ''
|
||||
This plugin was enabled automatically because the following plugins are enabled.
|
||||
This behaviour is deprecated. Please explicitly define `plugins.web-devicons.enable` or alternatively
|
||||
enable `plugins.mini.enable` with `plugins.mini.modules.icons` and `plugins.mini.mockDevIcons`.
|
||||
${lib.concatMapStringsSep "\n" (name: "plugins.${name}") (
|
||||
builtins.filter (name: config.plugins.${name}.enable) iconsPackagePlugins
|
||||
)}
|
||||
''
|
||||
]
|
||||
'';
|
||||
})
|
||||
++ lib.foldlAttrs (
|
||||
warnings: plugin: msg:
|
||||
warnings
|
||||
++ lib.optional config.plugins.${plugin}.enable ''
|
||||
Nixvim Warning: The `${plugin}` plugin has been deprecated.
|
||||
${msg}
|
||||
''
|
||||
++ (lib.nixvim.mkWarnings "plugins.${plugin}" {
|
||||
when = config.plugins.${plugin}.enable;
|
||||
message = ''
|
||||
This plugin has been deprecated.
|
||||
${msg}
|
||||
'';
|
||||
})
|
||||
) [ ] deprecated;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue