modules/highlights: fix mkIf

This commit is contained in:
Pedro Alves 2023-01-21 17:09:32 +00:00
parent 82fa648e04
commit be4e083fd2

View file

@ -28,8 +28,8 @@ with lib;
};
};
config = mkIf (config.highlight != { }) {
extraConfigLuaPost = ''
config = mkIf (config.highlight != { } || config.matches != { }) {
extraConfigLuaPost = (optionalString (config.highlight != { }) ''
-- Highlight groups {{
do
local highlights = ${helpers.toLuaObject config.highlight}
@ -39,7 +39,8 @@ with lib;
end
end
-- }}
'') ++
(optionalString (config.matches != { }) ''
-- Match groups {{
do
local match = ${helpers.toLuaObject config.match}
@ -49,6 +50,7 @@ with lib;
end
end
-- }}
'';
'');
};
}