feat(render): dim housekeeping commits by default

use `LazyComment` highlight group for commits with
housekeeping types, i.e. chore/ci/doc
This commit is contained in:
kylo252 2023-03-02 13:43:01 +01:00
commit 52c02266b2

View file

@ -456,14 +456,20 @@ function M:log(task)
self:diagnostic({ message = "Breaking Changes", severity = vim.diagnostic.severity.WARN }) self:diagnostic({ message = "Breaking Changes", severity = vim.diagnostic.severity.WARN })
end end
self:append(ref:sub(1, 7) .. " ", "LazyCommit", { indent = 6 }) self:append(ref:sub(1, 7) .. " ", "LazyCommit", { indent = 6 })
self:append(vim.trim(msg)):highlight({ if msg:match([[^chore]]) or msg:match([[^ci]]) or msg:match([[^doc]]) then
["#%d+"] = "LazyCommitIssue", self:append(vim.trim(msg)):highlight({
["^%S+:"] = "LazyCommitType", ["."] = "LazyComment",
["^%S+(%(.*%)):"] = "LazyCommitScope", })
["`.-`"] = "@text.literal.markdown_inline", else
["%*.-%*"] = "Italic", self:append(vim.trim(msg)):highlight({
["%*%*.-%*%*"] = "Bold", ["#%d+"] = "LazyCommitIssue",
}) ["^%S+:"] = "LazyCommitType",
["^%S+(%(.*%)):"] = "LazyCommitScope",
["`.-`"] = "@text.literal.markdown_inline",
["%*.-%*"] = "Italic",
["%*%*.-%*%*"] = "Bold",
})
end
-- string.gsub -- string.gsub
self:append(" " .. time, "LazyComment") self:append(" " .. time, "LazyComment")
self:nl() self:nl()