line wrapping works now

This commit is contained in:
Izaya 2017-10-13 04:22:36 +11:00
parent c347f6daa4
commit 0eb85d39e5
1 changed files with 3 additions and 1 deletions

View File

@ -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