more draw call optimisation

This commit is contained in:
Izaya 2020-06-11 14:03:54 +10:00
parent 642eb9adf1
commit f9749ac181
1 changed files with 1 additions and 3 deletions

View File

@ -261,7 +261,7 @@ function buffer:read(...)
io.write("\27[s\27[8m") io.write("\27[s\27[8m")
local pos, buffer = 1, "" local pos, buffer = 1, ""
local function redraw() local function redraw()
io.write("\27[u"..buffer.." \27[u\27["..tostring((#buffer-pos)+1).."C") io.write(string.format("\27[u%s \27[u\27[%iC",buffer,(#buffer-pos)+1))
end end
while true do while true do
char = readBytesOrChars(1) char = readBytesOrChars(1)
@ -270,14 +270,12 @@ function buffer:read(...)
local args = {""} local args = {""}
repeat repeat
char = readBytesOrChars(1) char = readBytesOrChars(1)
--[[
if char:match("%d") then if char:match("%d") then
args[#args] = args[#args]..char args[#args] = args[#args]..char
else else
args[#args] = tonumber(args[#args]) args[#args] = tonumber(args[#args])
args[#args+1] = "" args[#args+1] = ""
end end
]]
until not char:match("[%d;]") until not char:match("[%d;]")
if char == "C" then -- right if char == "C" then -- right
if pos > 1 then if pos > 1 then