mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-14 19:24:34 +02:00
plugins: cleanup most extraConfig
args
- Remove `cfg` where it is unused. - Use `opts` where necessary.
This commit is contained in:
parent
63cfc84abe
commit
7b94afceaf
22 changed files with 98 additions and 99 deletions
|
@ -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})
|
||||
'';
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue