23 lines
556 B
Lua
23 lines
556 B
Lua
local function get_hunks()
|
|
if not vim.g.loaded_gitgutter then return '' end
|
|
local summary = vim.fn.GitGutterGetHunkSummary()
|
|
return table.concat({
|
|
string.format('+%d', summary[1]), ' ',
|
|
string.format('~%d', summary[2]), ' ',
|
|
string.format('-%d', summary[3]), ' ',
|
|
})
|
|
end
|
|
|
|
local function get_branch()
|
|
if not vim.g.loaded_gitgutter then return '' end
|
|
return string.format('(%s)', vim.fn.FugitiveHead())
|
|
end
|
|
|
|
local function get_item()
|
|
return table.concat({' ', get_hunks(), get_branch(), ' '})
|
|
end
|
|
|
|
return {
|
|
get_item = get_item,
|
|
}
|