line wrapping works now

This commit is contained in:
Izaya 2017-10-13 04:22:36 +11:00
parent c347f6daa4
commit 0eb85d39e5

View File

@ -30,7 +30,6 @@ function tty(gA,sA,sI,mx,my)
elseif c == "\127" then elseif c == "\127" then
cx=cx-1 cx=cx-1
if cx<1 then cx=1 end if cx<1 then cx=1 end
--(" "):rep(2)
sb[cy] = sb[cy]:sub(1,cx-1).." "..sb[cy]:sub(cx+2) sb[cy] = sb[cy]:sub(1,cx-1).." "..sb[cy]:sub(cx+2)
else else
sb[cy] = sb[cy] or "" sb[cy] = sb[cy] or ""
@ -42,6 +41,9 @@ function tty(gA,sA,sI,mx,my)
sb[cy] = sb[cy]:sub(1,sx) sb[cy] = sb[cy]:sub(1,sx)
end end
cx=cx+unicode.charWidth(c) cx=cx+unicode.charWidth(c)
if cx > sx then
cx,cy = 1, cy+1
end
end end
end end
end end