modules/keymaps: fix false-positive lua warning

This commit is contained in:
Matt Sturgeon 2024-05-31 20:38:53 +01:00
parent db32a4ebda
commit 29922e13f7
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 12 additions and 4 deletions

View file

@ -44,10 +44,15 @@ with lib;
config =
let
# TODO remove `normalizeMapping` once `lua` option is gone
normalizeMapping = keyMapping: {
inherit (keyMapping) mode key options;
action = if keyMapping.lua then helpers.mkRaw keyMapping.action else keyMapping.action;
action =
if keyMapping.lua != null && keyMapping.lua then
helpers.mkRaw keyMapping.action
else
keyMapping.action;
};
in
{
@ -59,7 +64,7 @@ with lib;
luaDefs = pipe options.keymaps.definitionsWithLocations [
(map (def: {
inherit (def) file;
value = filter (hasAttr "lua") def.value;
value = filter (v: (v.lua or null) != null) def.value;
}))
(filter (def: def.value != [ ]))
(map (