feat: fix test rendering
This commit is contained in:
parent
b735af6a25
commit
92ffa41ed0
2 changed files with 126 additions and 53 deletions
|
|
@ -10,4 +10,21 @@ function M.clearcol(bufnr)
|
|||
end
|
||||
end
|
||||
|
||||
function M.pad_right(text, width)
|
||||
local pad = width - #text
|
||||
if pad <= 0 then
|
||||
return text
|
||||
end
|
||||
return text .. string.rep(' ', pad)
|
||||
end
|
||||
|
||||
function M.center(text, width)
|
||||
local pad = width - #text
|
||||
if pad <= 0 then
|
||||
return text
|
||||
end
|
||||
local left = math.ceil(pad / 2)
|
||||
return string.rep(' ', left) .. text .. string.rep(' ', pad - left)
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue