diff --git a/code/apps/sys-icecap.lua b/code/apps/sys-icecap.lua index b1eba7e..3cb4846 100644 --- a/code/apps/sys-icecap.lua +++ b/code/apps/sys-icecap.lua @@ -54,11 +54,11 @@ nexus = { nexus.create(40, #txl, ti, function (w, ev, a) if ev == "line" then if not pcall(w.span, 1, a, txl[a], 0xFFFFFF, 0) then - everestWindows[dw.id] = nil + everestWindows[w.id] = nil end elseif ev == "close" then w.close() - everestWindows[dw.id] = nil + everestWindows[w.id] = nil end end) end diff --git a/code/init.lua b/code/init.lua index 1f292f5..664fbe2 100644 --- a/code/init.lua +++ b/code/init.lua @@ -132,13 +132,13 @@ function wrapMeta(t) __call = function (_, ...) return t(...) end, - __pairs = function (a) + __pairs = function () return function (x, key) local k, v = next(t, k) if k then return k, wrapMeta(v) end end, 9, nil end, - __ipairs = function (a) + __ipairs = function () return function (x, key) key = key + 1 if t[key] then @@ -146,6 +146,9 @@ function wrapMeta(t) end end, 9, 0 end, + __len = function () + return #t + end, __metatable = uniqueNEOProtectionObject -- Don't protect this table - it'll make things worse })