Let's see if we can do without.
EAHBVX4JVOMSJCMHLOMB6GWTWQNMKVXMPONA7L4KDVH3YFX7EZKAC
local cursor_sy = up_edge_sy(Cursor_pane.col, Cursor_pane.row) + y_of_schema1(pane, pane.cursor1)
if not eq(old_top, pane.screen_top1) and eq(old_top, {line=1, pos=1}) and pane.top > Header_height and cursor_sy - Display_settings.y > App.screen.height - Header_height - Line_height then
-- pan the surface instead of scrolling within the pane
pane.screen_top1 = old_top
bring_cursor_of_cursor_pane_in_view('down')
Surface.cursor_on_screen_check = true -- cursor was on screen before keystroke, so it should remain on screen after
return
end
if not eq(old_top, pane.screen_top1) then
Display_settings.y = up_edge_sy(Cursor_pane.col, Cursor_pane.row) + y_of_schema1(pane, pane.screen_top1)
Surface.cursor_on_screen_check = true -- cursor was on screen before keystroke, so it should remain on screen after
end
if eq(old_top, pane.screen_top1) then return end
Display_settings.y = up_edge_sy(Cursor_pane.col, Cursor_pane.row) + y_of_schema1(pane, pane.screen_top1)
Surface.cursor_on_screen_check = true -- cursor was on screen before keystroke, so it should remain on screen after