mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-25 22:04:39 +00:00
mappings: deprecate vim.maps
This commit is contained in:
parent
36c88a31f6
commit
caef79e398
1 changed files with 13 additions and 3 deletions
|
|
@ -1,13 +1,14 @@
|
||||||
{
|
{
|
||||||
|
options,
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkMerge;
|
inherit (lib.modules) mkMerge;
|
||||||
inherit (lib.options) mkOption literalMD;
|
inherit (lib.options) mkOption literalMD showFiles;
|
||||||
inherit (lib.types) either str listOf attrsOf nullOr submodule;
|
inherit (lib.types) either str listOf attrsOf nullOr submodule;
|
||||||
inherit (lib.attrsets) mapAttrsToList;
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
inherit (lib.lists) flatten;
|
inherit (lib.lists) flatten optional;
|
||||||
inherit (lib.trivial) pipe;
|
inherit (lib.trivial) pipe;
|
||||||
inherit (lib.options) mkEnableOption;
|
inherit (lib.options) mkEnableOption;
|
||||||
inherit (lib.nvim.config) mkBool;
|
inherit (lib.nvim.config) mkBool;
|
||||||
|
|
@ -63,10 +64,10 @@
|
||||||
legacyMapOption = mode:
|
legacyMapOption = mode:
|
||||||
mkOption {
|
mkOption {
|
||||||
description = "Mappings for ${mode} mode";
|
description = "Mappings for ${mode} mode";
|
||||||
|
visible = false;
|
||||||
type = attrsOf (submodule {
|
type = attrsOf (submodule {
|
||||||
options = mapConfigOptions;
|
options = mapConfigOptions;
|
||||||
});
|
});
|
||||||
default = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
legacyMapModes = {
|
legacyMapModes = {
|
||||||
|
|
@ -152,5 +153,14 @@ in {
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# 2026-06-12
|
||||||
|
warnings = mkMerge (mapAttrsToList (
|
||||||
|
name: option:
|
||||||
|
optional
|
||||||
|
option.isDefined
|
||||||
|
"The option `vim.maps.${name}` defined in ${showFiles option.files} is deprecated, please use `vim.keymaps` instead. "
|
||||||
|
)
|
||||||
|
options.vim.maps);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue