From 8cb74f5dbeb5e9e703bab3db5d8add76da16ceff Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Sun, 2 Jun 2024 03:16:18 +0200 Subject: [PATCH] Fix alighRight off by one --- winhlp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winhlp.lua b/winhlp.lua index af6ce32..656db8b 100644 --- a/winhlp.lua +++ b/winhlp.lua @@ -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