OQIWNGD4Q7G5ZW7KTM6FUUEYX43DZ6LNP3Q5BXXLGE35QLU3LX5AC
VU32RUBVDALKOIZIBYU5HFDFFBP476UZNCNFBMZERMDVSLBGGU3AC
AUE2Y6HE5AIZVFO6EGLYNXKBDXGXJKDURTA4CFAEX6ZWRZKUCMUQC
GQBUV2XOMEPMTXMPCBQWGGIUXGQDX77VTGPFIG6YT7G64ASOYHXQC
PRSUR45QDYG7L27BQRCFA2ELO3FSQGOXTTYXSO6UB2JDWWZXPNBQC
SYUCEGP3UTN76WUUAO7E2BDEZFRZILUZBKB6LG5C2N54SFGDU5LAC
ETDSXJMCK2R5HLWABQZXUKNRGXXF4MDBGIOTHSMICJLDVTR3FYEQC
function command.link(rel)
if Grab_pane == nil then
print('link: needs something to be in the secondary "grab" cursor but found nothing')
return
end
if rel == nil then
rel = 'next'
end
if Cursor_pane.col < 1 then
print('no current note')
return
end
local pane = Surface[Cursor_pane.col][Cursor_pane.row]
if pane == nil then
print('no current note')
return
end
if Cache[pane.id].links[rel] then
print(('%s already has a %s note'):format(pane.id, rel))
return
end
print('connecting up links')
Cache[pane.id].links[rel] = Grab_pane.id
Cache[Grab_pane.id].links[Opposite[rel]] = pane.id
refresh_pane_height(pane) -- just in case this is the first link
refresh_pane_height(Grab_pane) -- just in case this is the first link
Grab_pane = nil
plan_draw()
end