It's embarrassing: page-down stopped working when I made that change. And page-down was the whole original use case for updating viewport based on the editable pane's screen_top.
This is a big sign that I need to add some tests.
Bottomline: commit dabb7a6c4 is a nice idea, but it only works if we can guarantee that any scrolling operation always moves the cursor past end of the previously visible page. Which is not true of page-down; we tend to have 1-2 screen lines of overlap.
OKBAAAUJRSAG7VYNKTBHEOOAMNFKREFMW2PHGNEAA2ZKSFONRR4AC
NP5DODWMHP22MO6Z3B6NYDR7C3DLV2BD4NKT2RFFFOSIDPC3ZPWQC
VPCPK52KMU4MZUXP4SUSJJDEHDR4C3KJ45HLMUQUK32FMY6OCQ4QC
KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC
AHOO2ILEJWTPCYHJH26WAF7A4YYVMHFX4UWHSAAAMHI73TSQZ6CAC
UAX3KJOIN3XBSLKP4IAWAWSCI3DLDKF22A6HRMGA4FHY3AS2QRVAC
JMUE7GSN6QDQZ6NDRB55MRJMKJN6LBD6MVQPKROYPDOIXM7I3XNQC
3U6YMMN2GMRL27TLPE7V3KUGM6MI2L3SAQSNU6HMNRINVXVRL3QAC
--? print('bring_in_view: viewport before', Display_settings.x, Display_settings.y)
--? print('bring_in_view: pane before', pane.screen_top1.line, pane.screen_top1.pos, pane.cursor1.line, pane.cursor1.pos)
log(2, 'bring_in_view: viewport before: '..tostring(Display_settings.x)..','..Display_settings.y)
log(2, 'bring_in_view: pane before: '..tostring(pane.screen_top1.line)..' '..tostring(pane.screen_top1.pos)..' '..tostring(pane.cursor1.line)..' '..tostring(pane.cursor1.pos))
--? print('bring_in_view: pane starts at', up_edge_sy(Cursor_pane.col, Cursor_pane.row))
--? print('bring_in_view: cursor line contains ^'..pane.lines[pane.cursor1.line].data..'$')
--? print('bring_in_view: cursor is at', y_of_schema1(pane, pane.cursor1), 'from top of pane')
log(2, 'bring_in_view: pane starts at '..tostring(up_edge_sy(Cursor_pane.col, Cursor_pane.row)))
log(2, 'bring_in_view: cursor line contains ^'..pane.lines[pane.cursor1.line].data..'$')
log(2, 'bring_in_view: cursor is at '..tostring(y_of_schema1(pane, pane.cursor1))..' from top of pane')