mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 10:49:08 +00:00
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:   After:  
This commit is contained in:
parent
65907f75ba
commit
d897ead2b7
1 changed files with 2 additions and 1 deletions
|
@ -129,9 +129,10 @@ function M.git_log(item, picker)
|
|||
if item.date then
|
||||
ret[#ret + 1] = { a(item.date, 16), "SnacksPickerGitDate" }
|
||||
end
|
||||
ret[#ret + 1] = { " " }
|
||||
|
||||
local msg = item.msg ---@type string
|
||||
local type, scope, breaking, body = msg:match("^(%S+)(%(.-%))(!?):%s*(.*)$")
|
||||
local type, scope, breaking, body = msg:match("^(%S+)%s*(%(.-%))(!?):%s*(.*)$")
|
||||
if not type then
|
||||
type, breaking, body = msg:match("^(%S+)(!?):%s*(.*)$")
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue