mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-10 09:14:31 +02:00
lib/keymaps: refactor mkMapOptionSubmodule
again
Allow passing in `key` and `action` as either bool or an attrset. If `false`, the option is omitted. If `true` or an attrset, the option is included. If an attrset is used, it will update the default `mkOption` args. This is useful for overriding `type` or adding an `example`.
This commit is contained in:
parent
c16533b3f7
commit
302262304e
3 changed files with 11 additions and 21 deletions
|
@ -36,14 +36,7 @@ in
|
|||
keymaps = mapAttrs (
|
||||
action: defaults:
|
||||
helpers.mkNullOrOption (
|
||||
with types;
|
||||
either str (
|
||||
helpers.keymaps.mkMapOptionSubmodule {
|
||||
inherit defaults;
|
||||
hasKey = true;
|
||||
hasAction = true;
|
||||
}
|
||||
)
|
||||
with types; either str (helpers.keymaps.mkMapOptionSubmodule { inherit defaults; })
|
||||
) "Keymap for the ${action} action."
|
||||
) defaultKeymaps;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue