mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat: git log
This commit is contained in:
parent
54d5ff18f5
commit
3218c2d9ec
7 changed files with 83 additions and 6 deletions
|
@ -16,7 +16,7 @@ function Text.new()
|
|||
end
|
||||
|
||||
---@param str string
|
||||
---@param hl string|table
|
||||
---@param hl? string|table
|
||||
function Text:append(str, hl)
|
||||
if #self._lines == 0 then
|
||||
self:nl()
|
||||
|
@ -84,4 +84,19 @@ function Text:trim()
|
|||
end
|
||||
end
|
||||
|
||||
function Text:row()
|
||||
return #self._lines == 0 and 1 or #self._lines
|
||||
end
|
||||
|
||||
function Text:col()
|
||||
if #self._lines == 0 then
|
||||
return 0
|
||||
end
|
||||
local width = 0
|
||||
for _, segment in ipairs(self._lines[#self._lines]) do
|
||||
width = width + vim.fn.strlen(segment.str)
|
||||
end
|
||||
return width
|
||||
end
|
||||
|
||||
return Text
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue