I'm seeing some strange errors in creating errors, like Cache['errors'] is sometimes going to nil.
WNILGROUH2LQ7GFGGWCHIE4YUWBQNU6QQETTL7UHGK3P5P7SEWCQC
function remove_edge(src, rel, target)
if array.find(Non_unique_edges, rel) then
local arr = Cache[src].links[rel]
assert(arr)
assert(type(arr) == 'table')
local pos = array.find(arr, target)
assert(pos)
table.remove(array, pos)
else
assert(Cache[src].links[rel] == target)
Cache[src].links[rel] = nil
end
end
-- TODO: non-unique
if Cache[target.id].links[Opposite[to]] then
add_error(('target %s already has a %s note'):format(target.id, Opposite[to]))
return
end
Cache[target.id].links[Opposite[to]] = Cache[target.id].links[Opposite[from]]
Cache[target.id].links[Opposite[from]] = nil
remove_edge(target, Opposite[from], pane.id)
add_edge(target, Opposite[to], pane.id)