1
0
mirror of https://github.com/20kdc/OC-KittenOS.git synced 2024-12-25 02:18:07 +11:00

And with that done, nuke a particularly memory-heavy GPU-optimisation in textedit

This commit is contained in:
20kdc 2018-03-22 23:40:49 +00:00
parent d8c4378ec1
commit 7b9f1a2776

View File

@ -54,8 +54,6 @@ local sW, sH = 37, #lines + 2
local window = neo.requestAccess("x.neo.pub.window")(sW, sH)
local flush
local screenCache = {}
local function splitCur()
local s = lines[cursorY]
local st = unicode.sub(s, 1, cursorX - 1)
@ -378,14 +376,9 @@ local function ev_clipboard(t)
end
flush = function ()
local newCache = {}
for i = 1, sH do
newCache[i] = getline(i)
if newCache[i] ~= screenCache[i] then
window.span(1, i, newCache[i], 0xFFFFFF, 0)
end
window.span(1, i, getline(i), 0xFFFFFF, 0)
end
screenCache = newCache
end
local flash
flash = function ()
@ -393,9 +386,7 @@ flash = function ()
-- reverse:
--local rY = (y + cursorY) - math.ceil(sH / 2)
local csY = math.ceil(sH / 2)
local l = getline(csY)
screenCache[csY] = l
window.span(1, csY, l, 0xFFFFFF, 0)
window.span(1, csY, getline(csY), 0xFFFFFF, 0)
event.runAt(os.uptime() + 0.5, flash)
end
event.runAt(os.uptime() + 0.5, flash)