Skip to content

Commit d897ead

Browse files
authored
fix(picker.git_log): add extra space between the date and the message (#885)
## Description Add additional space between the date of the commit and the commit message so that the message is more readable. Also added support for spaces between the type and the scope of the commit. ## Screenshots Before: ![image](https://github.com/user-attachments/assets/446480cd-0165-4421-9e63-29bfc7188011) ![image](https://github.com/user-attachments/assets/d75fbe6c-394e-4d97-aad9-ca3e7d3cd35c) After: ![image](https://github.com/user-attachments/assets/8f1ac512-d723-4f5b-81de-000d794ad7a4) ![image](https://github.com/user-attachments/assets/273a0cac-c927-4ad2-9b51-737daa60c56a)
1 parent 65907f7 commit d897ead

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/snacks/picker/format.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,10 @@ function M.git_log(item, picker)
129129
if item.date then
130130
ret[#ret + 1] = { a(item.date, 16), "SnacksPickerGitDate" }
131131
end
132+
ret[#ret + 1] = { " " }
132133

133134
local msg = item.msg ---@type string
134-
local type, scope, breaking, body = msg:match("^(%S+)(%(.-%))(!?):%s*(.*)$")
135+
local type, scope, breaking, body = msg:match("^(%S+)%s*(%(.-%))(!?):%s*(.*)$")
135136
if not type then
136137
type, breaking, body = msg:match("^(%S+)(!?):%s*(.*)$")
137138
end

0 commit comments

Comments
 (0)