There is no state of grace to git bisect
this against.
Though I plan to put back the search bar hack in bring_cursor_into_view. It's not implicated here.
The bug occurs even in the absence of wrapping lines.
I think what is going on is: bring_cursor_into_view updates the viewport but does no scrolling. It assumes plan_draw will take care of that. But we're suppressing plan_draw for the cursor pane. That's the issue.
GR4RROJFJOGM2WLQSVK5R5UYD7IK6ITF6UP5RVHAHD3J4OFJWGCAC
37AATGG5QIXOBXWA3DMSVMIIDSULA36NPETHOYZIOZ4G4RZLMHCAC
UAX3KJOIN3XBSLKP4IAWAWSCI3DLDKF22A6HRMGA4FHY3AS2QRVAC
AEIAYEN3YCCNVDKAQSFBJW75DAUQOJKNIP7JDO34CJ67V34PDK3QC
KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC
GO534NHJW3FC4FNJXTA5QZYZJ5A7UHVTGPNB7G73GA2YJRX4D54AC
JMUE7GSN6QDQZ6NDRB55MRJMKJN6LBD6MVQPKROYPDOIXM7I3XNQC
VPCPK52KMU4MZUXP4SUSJJDEHDR4C3KJ45HLMUQUK32FMY6OCQ4QC
ZBC6KQCAR727UGTWBHRXVDMGAAZIYIY4IX6JRKLDSXSPQ2Z2HOCAC
AHOO2ILEJWTPCYHJH26WAF7A4YYVMHFX4UWHSAAAMHI73TSQZ6CAC
KTABGWEVR6D5KLOCVAOUDNQMRB3BUFU4GTR3OIAWLJSIPIG6G46QC
--? if Surface[pane.column_index].name == 'search: donate' then
--? print('draw: search: donate', pane, Display_settings.search_all_pane)
--? print(#pane.lines, #pane.line_cache, pane._height)
--? print(pane.lines[1].data)
--? end
if pane.column_index == 1 and pane.pane_index == 1 then
print('draw', pane.id, 'from y', pane.top, 'down to screen height', App.screen.height)
print('screen top', pane.screen_top1.line, pane.screen_top1.pos)
print('cursor', pane.cursor1.line, pane.cursor1.pos)
end
--? print('viewport before', Display_settings.x, Display_settings.y)
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)
--? print(y_of_schema1(pane, pane.cursor1))
--? print('viewport starts at', Display_settings.y)
--? print('pane starts at', up_edge_sy(Cursor_pane.col, Cursor_pane.row))
--? print('cursor line contains ^'..pane.lines[pane.cursor1.line].data..'$')
--? print('cursor is at', y_of_schema1(pane, pane.cursor1), 'from top of pane')
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')
-- Bah, temporarily giving up on debugging.
Display_settings.y = Display_settings.y + Line_height
--? print('=>', Display_settings.y)
--? print('cursor now at ', cursor_sy - Display_settings.y)
--? print('viewport height', App.screen.height)
--? print('cursor row starts', App.screen.height - (cursor_sy-Display_settings.y), 'px above bottom of viewport') -- totally wrong
print('=>', Display_settings.y)
print('cursor now at ', cursor_sy - Display_settings.y)
print('viewport height', App.screen.height)
print('cursor row starts', App.screen.height - (cursor_sy-Display_settings.y), 'px above bottom of viewport') -- totally wrong
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
print('cursor is at pixel', cursor_sy)
if 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
end
local screen_top_updated = not eq(old_top, pane.screen_top1)
if screen_top_updated 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
return screen_top_updated
print('CCC')
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
print('Display_settings.y is now', Display_settings.y)