Being smart about the y coordinate is difficult, so they just bounce to top of column for now. That way we're guaranteed the cursor pane will be on screen.
R4O525CXK4IYQNXKIOAE6AI32AUP3MDQ3A7S5PANJKUX4RSKALAAC
XD43MI5HTDBO7HD4D2KD4U3UUAOJEMDVSJXJR54ZPW2FHCFB7X5AC
6AOE67ORA4UISCORG7NRSUMCFYRVLGY3FBQHQOPZFXG3CN6JDMFQC
JMUE7GSN6QDQZ6NDRB55MRJMKJN6LBD6MVQPKROYPDOIXM7I3XNQC
KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC
AUE2Y6HE5AIZVFO6EGLYNXKBDXGXJKDURTA4CFAEX6ZWRZKUCMUQC
VU32RUBVDALKOIZIBYU5HFDFFBP476UZNCNFBMZERMDVSLBGGU3AC
GQBUV2XOMEPMTXMPCBQWGGIUXGQDX77VTGPFIG6YT7G64ASOYHXQC
5O356ZWY6DCM3Y6VFZPYQY5AIHIN6JGZDGLXU5DL6LWTFNDDFPFQC
RQ37HOBMOPOATWRTCEYIRSSGO6P63SQTGFUQM32QFJXKQI5NYDMQC
T62BH5VBLTDYHIEGFPJ7PB77J4JDX3D7RRI3RALZ2PWHJXW5TW3AC
D3FRDRWOY6VGMAOGR35GPX7QYBEHDT6J4JKUZCGDEFDPWXGHD3YQC
QWWOAZ3P73XN74JBLI23YKM7KKRUCH55EMD7I6VPKG7B6DWZXB2QC
-- imperfect commands for left/right navigation
-- these can be improved
function command.right_one_column()
if Cursor_pane.col >= #Surface then
return
end
Cursor_pane.col = Cursor_pane.col + 1
Cursor_pane.row = 1 -- always bounce back to top of column
Display_settings.y = 0
local xlo = left_edge_sx(Cursor_pane.col) - Margin_left - Padding_horizontal
Display_settings.x = math.max(xlo, Display_settings.x)
local xmax = left_edge_sx(Cursor_pane.col+1) - App.screen.width
Display_settings.x = math.min(xmax, Display_settings.x)
Display_settings.x = math.max(0, Display_settings.x)
plan_draw()
end
function command.left_one_column()
if Cursor_pane.col <= 1 then
return
end
Cursor_pane.col = Cursor_pane.col - 1
Cursor_pane.row = 1 -- always bounce back to top of column
Display_settings.y = 0
local xlo = left_edge_sx(Cursor_pane.col) - Margin_left - Padding_horizontal
Display_settings.x = math.min(xlo, Display_settings.x)
plan_draw()
end
local result = {}
table.insert(result, id..' -- ')
if Links[id] then
for rel,val in pairs(Links[id]) do
table.insert(result, rel)
table.insert(result, ':')
if type(val) == 'table' then
table.insert(result, '[')
for _,dest in ipairs(val) do
table.insert(result, dest)
table.insert(result, ' ')
end
table.insert(result, ']')
else
table.insert(result, val)
end
table.insert(result, '|')
end
end
return table.concat(result)
local result = {}
table.insert(result, id..' -- ')
if Links[id] then
for rel,val in pairs(Links[id]) do
table.insert(result, rel)
table.insert(result, ':')
if type(val) == 'table' then
table.insert(result, '[')
for _,dest in ipairs(val) do
table.insert(result, dest)
table.insert(result, ' ')
end
table.insert(result, ']')
else
table.insert(result, val)
end
table.insert(result, '|')
end
end
return table.concat(result)