Fix missing y in setCursorPos in winhlp.alignRight

This commit is contained in:
Ben 2024-06-02 01:10:16 +02:00
parent e414f229db
commit 10fda87de5
Signed by: ben
GPG key ID: 0F54A7ED232D3319

View file

@ -10,9 +10,9 @@ local function contains(window, x, y)
end
local function alignRight(termlike, length)
local tw,th = termlike.getSize()
local x,y = termlike.getCursorPos()
termlike.setCursorPos(math.min(x, tw-length+1))
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)
end