feat(ui): fix alignment
This commit is contained in:
parent
92ffa41ed0
commit
038fcd36f8
3 changed files with 42 additions and 25 deletions
|
|
@ -18,6 +18,14 @@ function M.pad_right(text, width)
|
|||
return text .. string.rep(' ', pad)
|
||||
end
|
||||
|
||||
function M.pad_left(text, width)
|
||||
local pad = width - #text
|
||||
if pad <= 0 then
|
||||
return text
|
||||
end
|
||||
return string.rep(' ', pad) .. text
|
||||
end
|
||||
|
||||
function M.center(text, width)
|
||||
local pad = width - #text
|
||||
if pad <= 0 then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue