From 52c02266b2bb6dd184ed73e0f42a255c6b6fdf4e Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Thu, 2 Mar 2023 13:43:01 +0100 Subject: [PATCH] feat(render): dim housekeeping commits by default use `LazyComment` highlight group for commits with housekeeping types, i.e. chore/ci/doc --- lua/lazy/view/render.lua | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lua/lazy/view/render.lua b/lua/lazy/view/render.lua index b84fb0f..e4b4224 100644 --- a/lua/lazy/view/render.lua +++ b/lua/lazy/view/render.lua @@ -456,14 +456,20 @@ function M:log(task) self:diagnostic({ message = "Breaking Changes", severity = vim.diagnostic.severity.WARN }) end self:append(ref:sub(1, 7) .. " ", "LazyCommit", { indent = 6 }) - self:append(vim.trim(msg)):highlight({ - ["#%d+"] = "LazyCommitIssue", - ["^%S+:"] = "LazyCommitType", - ["^%S+(%(.*%)):"] = "LazyCommitScope", - ["`.-`"] = "@text.literal.markdown_inline", - ["%*.-%*"] = "Italic", - ["%*%*.-%*%*"] = "Bold", - }) + if msg:match([[^chore]]) or msg:match([[^ci]]) or msg:match([[^doc]]) then + self:append(vim.trim(msg)):highlight({ + ["."] = "LazyComment", + }) + else + self:append(vim.trim(msg)):highlight({ + ["#%d+"] = "LazyCommitIssue", + ["^%S+:"] = "LazyCommitType", + ["^%S+(%(.*%)):"] = "LazyCommitScope", + ["`.-`"] = "@text.literal.markdown_inline", + ["%*.-%*"] = "Italic", + ["%*%*.-%*%*"] = "Bold", + }) + end -- string.gsub self:append(" " .. time, "LazyComment") self:nl()