I've cleaned up a few 'child' and 'cross' links in my notes that were scalars until now.
Still a few places in the code that need non-unique support. I've tried to add TODOs for them.
T62BH5VBLTDYHIEGFPJ7PB77J4JDX3D7RRI3RALZ2PWHJXW5TW3AC
L5PFUVUA535GHGS33DPYVXDYJTBPASXSBXQP4NA5RB4GTPQHHTOQC
WO73G45YHL27GXZIQRLFPMIZSOTO7UOUXPOFKBP7APKYLEGYHL7AC
JC64ZBDKHZ54FRG2HZ76PFVQYK4EIFLNU36KDQ762KMT2DG7M4HQC
JMUE7GSN6QDQZ6NDRB55MRJMKJN6LBD6MVQPKROYPDOIXM7I3XNQC
KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC
IZAQ4C7DZ3OTGUPDYVRYJPHO6HT67HL7DZLPNIPWINBHNNLK42OAC
AUE2Y6HE5AIZVFO6EGLYNXKBDXGXJKDURTA4CFAEX6ZWRZKUCMUQC
GQBUV2XOMEPMTXMPCBQWGGIUXGQDX77VTGPFIG6YT7G64ASOYHXQC
7JAODGVLU6GEMEJTJL34QMYOCKWPFX22A4UH5SLSDGSIVIRETO7QC
F7JBFZFRALHRUTYYHJ2J7OBBB5WYPJBDTLDLZAMTVC3FUVJ7MAIAC
32UWO2J35LPPYVWLGE6QUKPU7CY7PNM4NMNQOMWUXF7I34XIUSGAC
QMWB3N3NKEACQBGY7JRFW5J74Z74CBLKJC2EDJJEDV7NKM2NQCGQC
V6JHPHYNDGOBF3OKHPYJ6IQEU5PSLWNUCQBGVW4TG7TYL6OLF3QAC
DRYBR6MIVT6MQEI4B6GJMOY4WRZ42ALNWO4BEVMUBP4GV326KOHQC
OQIWNGD4Q7G5ZW7KTM6FUUEYX43DZ6LNP3Q5BXXLGE35QLU3LX5AC
QWWOAZ3P73XN74JBLI23YKM7KKRUCH55EMD7I6VPKG7B6DWZXB2QC
6SEECG7ACIN6ZK72ED3DKYZKBNM5M5OMTD4M6HLNMAH376NYNAEAC
CMGIWHDA5EQY22VK7GJMDMCONMVYKJ7HCB6QISHTMVZGUBIPAYFQC
UJ27PGBNBE7ARCKWT7O7BX6RVU5DDEYLKYRQYFBUWHLDMYKZ2CZQC
47RPC7ATVC6VSS7X6EPD4NB6PHZ5OU4KR62N2PV5WDDIJPQMO4UQC
4PPQU5WW2BHKO32CY24KGQXM6GHZQCIWQYQ2JATKJWYIE3HMMX5QC
SOWKJG6CUNU7ZON5XWWX7WULX5Q5BU2ZUTQ322KQYPKZVHEXMHCQC
print('connecting up links')
Cache[pane.id].links[rel] = new_pane.id
Cache[new_pane.id].links[Opposite[rel]] = pane.id
if #Surface[Cursor_pane.col] == 1 then
-- connect up links
add_edge(pane.id, rel, new_pane.id)
add_edge(new_pane.id, Opposite[rel], pane.id)
if #Surface[Cursor_pane.col] == 1 and not array.find(Non_unique_edges, rel) then
end
-- Can we add an edge called 'rel' from src to target?
-- Precondition: both ids are already in Cache.
function can_add_edge(src, rel, target)
if array.find(Non_unique_edges, rel) then
-- check if already present
for _,id in ipairs(Cache[src].links[rel]) do
if id == target then
add_error(('%s is already a %s of %s'):format(target, rel, src))
return false
end
end
else
-- check for conflict
if Cache[src].links[rel] then
add_error(('%s already has a %s note'):format(src, rel))
return false
end
end
return true
end
function add_edge(src, rel, target)
if array.find(Non_unique_edges, rel) then
if Cache[src].links[rel] == nil then
Cache[src].links[rel] = {target}
else
table.insert(Cache[src].links[rel], target)
end
else
Cache[src].links[rel] = target
end
command.open_file_in_next_column(Cache[pane.id].links[rel])
if array.find(Non_unique_edges, rel) then
local column = {name=(('%s of %s'):format(rel, pane.id))}
populate_step_column(column, pane.id, rel)
add_column_to_right_of_cursor(column)
plan_draw()
else
command.open_file_in_next_column(Cache[pane.id].links[rel])
end
end
function populate_step_column(column, start_id, rel)
local n = #Cache[start_id].links[rel]
for i, id in ipairs(Cache[start_id].links[rel]) do
local pane = load_pane(id)
add_title(pane, ('%d/%d'):format(i, n))
table.insert(column, pane)
end