feat: git log

This commit is contained in:
Folke Lemaitre 2022-11-22 21:12:50 +01:00
parent 54d5ff18f5
commit 3218c2d9ec
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
7 changed files with 83 additions and 6 deletions

View file

@ -119,6 +119,25 @@ function M:plugin(plugin)
self:nl()
end
end
elseif task.type == "log" then
local log = vim.trim(task.output)
if log ~= "" then
local lines = vim.split(log, "\n")
for l, line in ipairs(lines) do
if l == 1 then
self:nl()
end
local ref, msg, time = line:match("^(%w+) (.*) (%(.*%))$")
self:append(" " .. ref .. " ", "@variable.builtin")
local col = self:col()
self:append(msg)
-- string.gsub
self:append(" " .. time, "Comment")
if l ~= #lines then
self:nl()
end
end
end
end
end
end