Fix alighRight off by one

This commit is contained in:
Ben 2024-06-02 03:16:18 +02:00
parent 67c418f597
commit 8cb74f5dbe
Signed by: ben
GPG key ID: 0F54A7ED232D3319

View file

@ -13,7 +13,7 @@ local function alignRight(termlike, length)
local tw, th = termlike.getSize()
local x, y = termlike.getCursorPos()
termlike.setCursorPos(math.min(x, tw-length+1), y)
return math.max(0, tw-length-x)
return math.max(0, tw-length-x+1)
end