mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-23 05:40:44 +00:00
lib.binds: update lzn util functions
This commit is contained in:
parent
945b9e6500
commit
cb99286189
1 changed files with 7 additions and 7 deletions
|
@ -3,7 +3,6 @@
|
||||||
inherit (lib.modules) mkIf mkDefault;
|
inherit (lib.modules) mkIf mkDefault;
|
||||||
inherit (lib.types) nullOr str;
|
inherit (lib.types) nullOr str;
|
||||||
inherit (lib.attrsets) isAttrs mapAttrs;
|
inherit (lib.attrsets) isAttrs mapAttrs;
|
||||||
inherit (lib.generators) mkLuaInline;
|
|
||||||
|
|
||||||
binds = rec {
|
binds = rec {
|
||||||
mkLuaBinding = key: action: desc:
|
mkLuaBinding = key: action: desc:
|
||||||
|
@ -69,19 +68,20 @@
|
||||||
|
|
||||||
pushDownDefault = attr: mapAttrs (_: mkDefault) attr;
|
pushDownDefault = attr: mapAttrs (_: mkDefault) attr;
|
||||||
|
|
||||||
mkLznBinding = mode: lhs: rhs: desc: {
|
mkLznBinding = mode: key: action: desc: {
|
||||||
inherit mode lhs rhs desc;
|
inherit mode desc key action;
|
||||||
};
|
};
|
||||||
|
|
||||||
mkSetLznBinding = binding: action: {
|
mkSetLznBinding = binding: action: {
|
||||||
lhs = binding.value;
|
inherit action;
|
||||||
rhs = action;
|
key = binding.value;
|
||||||
desc = binding.description;
|
desc = binding.description;
|
||||||
};
|
};
|
||||||
|
|
||||||
mkSetLuaLznBinding = binding: action: {
|
mkSetLuaLznBinding = binding: action: {
|
||||||
lhs = binding.value;
|
inherit action;
|
||||||
rhs = mkLuaInline "function() ${action} end";
|
key = binding.value;
|
||||||
|
lua = true;
|
||||||
desc = binding.description;
|
desc = binding.description;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue