-- Delete any columns dedicated to just this note, and update cursor pane if necessary.
local delete_cursor_column = Surface[Cursor_pane.col].name == pane.id
for i=#Surface,Cursor_pane.col+1,-1 do
local column = Surface[i]
if column.name == pane.id then
table.remove(Surface, i)
end
end
local num_deleted = 0
for i=Cursor_pane.col,1,-1 do
local column = Surface[i]
if column.name == pane.id then
table.remove(Surface, i)
num_deleted = num_deleted+1
end
end
if num_deleted > 0 then
Cursor_pane.col = Cursor_pane.col - num_deleted
if delete_cursor_column then
Cursor_pane.row = 1
end
else
assert(not delete_cursor_column)
end