Skip to content

Commit 42a8ecf

Browse files
committed
improv: add highlighting if picker is snacks
1 parent e205f4f commit 42a8ecf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/tinygit/shared/highlights.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ function M.inlineCodeAndIssueNumbers()
77
end
88

99
function M.commitType()
10-
local commitTypePattern = [[\v^\s*\w+(\(.{-}\))?!?]]
10+
-- not restricted to start of string, so prefixes like the numbering from the
11+
-- snacks-ui-select do not prevent the highlight
12+
local commitTypePattern = [[\v\w+(\(.{-}\))?!?]]
13+
1114
local type = commitTypePattern .. [[\ze: ]] -- `\ze`: end of match
1215
local colonAfterType = commitTypePattern .. [[\zs: ]] -- `\zs`: start of match
1316
vim.fn.matchadd("Title", type)

0 commit comments

Comments
 (0)