plugins: cleanup most extraConfig args

- Remove `cfg` where it is unused.
- Use `opts` where necessary.
This commit is contained in:
Matt Sturgeon 2024-11-19 15:47:49 +00:00
parent 63cfc84abe
commit 7b94afceaf
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
22 changed files with 98 additions and 99 deletions

View file

@ -1,15 +1,9 @@
{
lib,
options,
...
}:
{ lib, ... }:
with lib;
let
inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts mkRaw toLuaObject;
opt = options.plugins.which-key;
specExamples = [
# Basic group with custom icon
{
@ -583,12 +577,12 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
# TODO: introduced 2024-07-29: remove after 24.11
# NOTE: this may be upgraded to a mkRemoveOptionModule when which-key removes support
extraConfig =
cfg:
lib.mkIf opt.registrations.isDefined {
cfg: opts:
lib.mkIf opts.registrations.isDefined {
warnings = [
''
nixvim (plugins.which-key):
The option definition `plugins.which-key.registrations' in ${showFiles opt.registrations.files} has been deprecated in which-key v3; please remove it.
The option definition `plugins.which-key.registrations' in ${showFiles opts.registrations.files} has been deprecated in which-key v3; please remove it.
You should use `plugins.which-key.settings.spec' instead.
Note: the spec format has changed in which-key v3
@ -596,7 +590,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
''
];
plugins.which-key.luaConfig.content = lib.optionalString opt.registrations.isDefined ''
plugins.which-key.luaConfig.content = lib.optionalString opts.registrations.isDefined ''
require("which-key").register(${toLuaObject cfg.registrations})
'';
};