modules/highlights: added a wrapper around vim.fn.matchadd

This commit is contained in:
Gaetan Lepage 2023-01-12 16:44:02 +01:00
parent b9a4f0ca19
commit 82fa648e04

View file

@ -15,6 +15,17 @@ with lib;
}; };
''; '';
}; };
match = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Define match groups";
example = ''
match = {
ExtraWhitespace = '\\s\\+$';
};
'';
};
}; };
config = mkIf (config.highlight != { }) { config = mkIf (config.highlight != { }) {
@ -28,6 +39,16 @@ with lib;
end end
end end
-- }} -- }}
-- Match groups {{
do
local match = ${helpers.toLuaObject config.match}
for k,v in pairs(match) do
vim.fn.matchadd(k, v)
end
end
-- }}
''; '';
}; };
} }