From 0eb85d39e56501914c021492ce69ec05a7ac73c8 Mon Sep 17 00:00:00 2001 From: Izaya Date: Fri, 13 Oct 2017 04:22:36 +1100 Subject: [PATCH] line wrapping works now --- modules/drivers/fastty.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/drivers/fastty.lua b/modules/drivers/fastty.lua index 5c9d013..5e6f827 100644 --- a/modules/drivers/fastty.lua +++ b/modules/drivers/fastty.lua @@ -30,7 +30,6 @@ function tty(gA,sA,sI,mx,my) elseif c == "\127" then cx=cx-1 if cx<1 then cx=1 end - --(" "):rep(2) sb[cy] = sb[cy]:sub(1,cx-1).." "..sb[cy]:sub(cx+2) else sb[cy] = sb[cy] or "" @@ -42,6 +41,9 @@ function tty(gA,sA,sI,mx,my) sb[cy] = sb[cy]:sub(1,sx) end cx=cx+unicode.charWidth(c) + if cx > sx then + cx,cy = 1, cy+1 + end end end end