I'm starting to notice the duplication in create_column.
ZU3HJ6NH26LFY2NWRCCRMXECNEPVR25OJNOFEK5XJ3KYFJUCKQXAC
Y4FEETX3F7BJMFON3CJIGB45F4ZLMH6FOUJRYW3DO3ZV3J72ETMAC
I46AJ2J35CDUUTRGKJAEANZIIOAR63ZKT3LMEPXNLNV54YXL6TNAC
XV52L22IDM4Y22GLHJOPWWCEXRGJVUJWXDHSFS2UQNX66CE55VJQC
OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC
AUE2Y6HE5AIZVFO6EGLYNXKBDXGXJKDURTA4CFAEX6ZWRZKUCMUQC
GQBUV2XOMEPMTXMPCBQWGGIUXGQDX77VTGPFIG6YT7G64ASOYHXQC
4PPQU5WW2BHKO32CY24KGQXM6GHZQCIWQYQ2JATKJWYIE3HMMX5QC
5O356ZWY6DCM3Y6VFZPYQY5AIHIN6JGZDGLXU5DL6LWTFNDDFPFQC
V6JHPHYNDGOBF3OKHPYJ6IQEU5PSLWNUCQBGVW4TG7TYL6OLF3QAC
elseif string.match(column_name, 'neighbors of %S+') then
local start_id = string.match(column_name, 'neighbors of (%S+)')
initialize_cache_if_necessary(start_id)
local column = {name=('neighbors of %s'):format(start_id)}
table.insert(column, load_pane_from_file(start_id))
for rel,target in pairs(Cache[start_id].links) do
table.insert(column, load_pane_from_file(target))
end
table.insert(Surface, column)
function command.neighbors()
local pane = Surface[Cursor_pane.col][Cursor_pane.row]
local column = {name=('neighbors of %s'):format(pane.id)}
table.insert(column, load_pane_from_file(pane.id))
for rel,target in pairs(Cache[pane.id].links) do
table.insert(column, load_pane_from_file(target))
end
if #Surface[Cursor_pane.col] == 1 then
assert(Cursor_pane.row == 1)
Surface[Cursor_pane.col] = column
else
table.insert(Surface, Cursor_pane.col+1, column)
Cursor_pane.col = Cursor_pane.col+1
Cursor_pane.row = 1
end
bring_cursor_column_on_screen()
update_pane_bounds()
end