76EMLHMQNNS7BIJ5OKBSYWX7ZS4WUK7BXGW6QBOMOZKCZ6DXEHWQC
3UHJT4EGHGFEKDPUO4JEEP4BKXM7KK6RFZTNP5FT7TWCUVNZMXPAC
GAD7OJC2Y6CZTLAQVQKJRB7HVBNFRF2PR3P64PSDBCNMLKMCC5TQC
IFPV5C6EJUWOBQUBIF4FUQ6AUYQSZ56CQLJPYZIPOWH6Y3HF4N2QC
T5WVPVZORUUJWO5L2XT5CQQEKC7VK2ZMXKKJR4H4H33HONFWECIQC
RXMHAZ6VL4EJMYEZM32G4W54EPF3BPWPIGASJ7ND45FJ5F6TJCZAC
R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC
73OCE2MCBJJZZMN2KYPJTBOUCKBZAOQ2QIAMTGCNOOJ2AJAXFT2AC
VJ77YABHVJZWJKLHAGIPC562GYM73AUGRLCP4JLKP5JPWPT2RIHAC
4Z4XY6TK3DU775XME2V2FVDN7O3D3W6DO6N4OGLGVIL6M6RPCKPQC
A3XJXFLE7IX524G4HWJKMQYKJCMR3N2MVFFSW7ILAEDROTOUNF3QC
LK4ZW4BBDD5LC4JK4XK5DJESSDFAIRVFPDM324S7SCAUXEXYVTLQC
7ZXZGVHM2THAGJABJZLKW56VG72AD3Z6DINZ7XBWOYDJX4J77PMQC
BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC
R2ASHK5CEE3PTRLS37GP4PXJ7HIGJ6UD72KKBI57UDJI7VRROQGQC
2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC
-- https://stackoverflow.com/questions/640642/how-do-you-copy-a-lua-table-by-value/26367080#26367080
function deepcopy(obj, seen)
if type(obj) ~= 'table' then return obj end
if seen and seen[obj] then return seen[obj] end
local s = seen or {}
local result = setmetatable({}, getmetatable(obj))
s[obj] = result
for k,v in pairs(obj) do
result[deepcopy(k, s)] = deepcopy(v, s)
end
return result
end
function minmax(a, b)
return math.min(a,b), math.max(a,b)
end
table.insert(event.lines, deepcopy(State.lines[i]))
-- https://stackoverflow.com/questions/640642/how-do-you-copy-a-lua-table-by-value/26367080#26367080
function deepcopy(obj, seen)
if type(obj) ~= 'table' then return obj end
if seen and seen[obj] then return seen[obj] end
local s = seen or {}
local result = setmetatable({}, getmetatable(obj))
s[obj] = result
for k,v in pairs(obj) do
result[deepcopy(k, s)] = deepcopy(v, s)
end
return result
end
function minmax(a, b)
return math.min(a,b), math.max(a,b)
end
Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks
Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks