From c76bc60a20dd7f334802f2d634d883384b1a3138 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Wed, 13 Sep 2017 13:06:17 +1000 Subject: [PATCH] some cleaning up --- modules/drivers/vt52.lua | 2 +- modules/lib/buffer.lua | 31 ------------------------------- strip.lua | 2 +- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/modules/drivers/vt52.lua b/modules/drivers/vt52.lua index 7ffc5ee..4cf1617 100644 --- a/modules/drivers/vt52.lua +++ b/modules/drivers/vt52.lua @@ -53,7 +53,7 @@ function tty(gA,sA,sI,fg,bg) elseif c == "\r" then cx=1 elseif c == "\f" then cx=1 cy=1 gP.fill(1, 1, sx, sy, " ") elseif c == "\t" then cx=(cx+8-((cx+8)%8))+1 - elseif c == "\127" then cx=cx-1 gP.set(cx,cy," ") + elseif c == "\127" then cx=cx-1 gP.set(cx,cy,(" "):rep(2)) else gP.set(cx,cy,c) cx=cx+1 end end cv() diff --git a/modules/lib/buffer.lua b/modules/lib/buffer.lua index 6dac478..436c7f4 100644 --- a/modules/lib/buffer.lua +++ b/modules/lib/buffer.lua @@ -1,35 +1,4 @@ _G.buffer = {} ---[[function buffer.create(w,c) -- worker, close - local t={} - t.b="" - function t.w(s,d) - s.b=s.b..tostring(d) - end - t.write = t.w - function t.r(s,l) - if type(l) == "number" then - local ns,bs=s.b:sub(1,l+1),s.b:sub(l+2) - s.b=bs - return ns - elseif type(l) == "string" then - local oS=s.b - if l == "*a" then - s.b="" - return oS - elseif l == "*l" then - S=s.b:find("\n") or #s.b - s.b=s.b:sub(S+1) - rS = oS:sub(1,S-1) - if rS:len() < 1 then return nil end - return rS - end - end - end - t.read = t.r - t.close = c - w(t) - return t -end]]-- function buffer.ucreate() local b = {} b.b,b.s = "","open" diff --git a/strip.lua b/strip.lua index dfb79f0..4eeb6a9 100644 --- a/strip.lua +++ b/strip.lua @@ -31,7 +31,7 @@ for k,v in ipairs(replacements) do no=no+1 end end -print("\nBefore: "..sl.."\nAfter: "..tostring(ss:len()).."\n"..tostring(no).." optimisations made.\n") +print("\nBefore: "..sl.."\nAfter: "..tostring(ss:len()).."\nDelta: "..tostring(sl-ss:len())) f=io.open(tA[2],"wb") f:write(ss)