mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-10 01:04:34 +02:00
lib/keymap-helpers: refactor mkMapOptionSubmodule
Make the `key` and `action` options optional, and allow configuring whether `action` can be a raw type.
This commit is contained in:
parent
87d6654a9f
commit
df3aa86713
2 changed files with 53 additions and 35 deletions
|
@ -36,7 +36,14 @@ in
|
|||
keymaps = mapAttrs (
|
||||
action: defaults:
|
||||
helpers.mkNullOrOption (
|
||||
with types; either str (helpers.keymaps.mkMapOptionSubmodule defaults)
|
||||
with types;
|
||||
either str (
|
||||
helpers.keymaps.mkMapOptionSubmodule {
|
||||
inherit defaults;
|
||||
hasKey = true;
|
||||
hasAction = true;
|
||||
}
|
||||
)
|
||||
) "Keymap for the ${action} action."
|
||||
) defaultKeymaps;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue