Now all we're doing is sticking to 10 columns. Let's see how this goes.
If this goes well then I'll take stock of all the different things I tried and decide which version is cleanest. For example, I'd like to drop either Editable_cursor_pane_updated_screen_top or options.ignore_editable_cursor_pane.
UAX3KJOIN3XBSLKP4IAWAWSCI3DLDKF22A6HRMGA4FHY3AS2QRVAC ZBC6KQCAR727UGTWBHRXVDMGAAZIYIY4IX6JRKLDSXSPQ2Z2HOCAC XNFTJHC4QSHNSIWNN7K6QZEZ37GTQYKHS4EPNSVPQCUSWREROGIQC BULPIBEGL7TMK6CVIE7IS7WGAHGOSUJBGJSFQK542MOWGHP2ADQQC MTJEVRJR5GLWUSK7HMIM4UXM6GS6O6YCRWJT3DUSU2RYMHCQNOEQC SPSW74Y5OJ54Y7VQ3SJFCJR5CYDKTR4A3TOEVZODDZLUSDDU2GZAC IM3RBHY2QI5UHLPHT4QB3YECS7CRBEFE765DDKXOW267AOQZL5QQC Z5HLXU4PJWWJJDBCK52NBD6PIRIA3TAN2BKZB5HBYFGIDBX4F5HAC JMUE7GSN6QDQZ6NDRB55MRJMKJN6LBD6MVQPKROYPDOIXM7I3XNQC KKMFQDR43ZWVCDRHQLWWX3FCWCFA3ZSXYOBRJNPHUQZR2XPKWULAC VPCPK52KMU4MZUXP4SUSJJDEHDR4C3KJ45HLMUQUK32FMY6OCQ4QC GO534NHJW3FC4FNJXTA5QZYZJ5A7UHVTGPNB7G73GA2YJRX4D54AC 3IBO5P7DVWMJM42VZL5HIFAJH55FK77K2IKPGMNI55GRXDXT4WUQC 2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC PTDO2SOTXEI6FROZ2AVRFXSKKNKCRMPPTQSI5LWD45UVGDJPMSGQC IFTYOERMW7P3I24WISZN35X3GWJ5MSMRYDRBK3L52GCZTPP3CWZQC if body_sy < Display_settings.y thenpane.screen_top1, y_offset = schema1_of_y(pane, Display_settings.y - body_sy)elsepane.screen_top1 = {line=1, pos=1}endif body_sy < Display_settings.y thenpane.top = Margin_aboveelsepane.top = body_sy - Display_settings.y + Margin_aboveendpane.top = Header_height + pane.top - y_offset--? print('bounds: =>', pane.top)pane.left = sx - Display_settings.xpane.right = pane.left + Display_settings.column_widthpane.width = pane.right - pane.leftelse-- clear bounds to catch issues earlypane.top = nil--? print('bounds: =>', pane.top)endsy = sy + Margin_above + height(pane) + Margin_below + Padding_verticalendelse-- clear bounds to catch issues earlyfor _, pane in ipairs(column) dopane.top = nilendendsx = sx + Margin_right + Display_settings.column_width + Padding_horizontal + Margin_leftendend-- keep the structure of this function sync'd with refresh_pane_heightfunction plan_draw_maybe_updating_screen_top_in_cursor_pane(update_screen_top_in_cursor_pane)--? print('update pane bounds')--? print(#Surface, 'columns;', num_panes(), 'panes')Panes_to_draw = {}local sx = Padding_horizontal + Margin_leftfor column_index, column in ipairs(Surface) doif should_show_column(sx) thenlocal sy = Padding_verticalfor pane_index, pane in ipairs(column) doif sy > Display_settings.y + App.screen.height - Header_height thenbreakend--? print('bounds:', column_index, pane_index, sx,sy)if should_show_pane(pane, sy) thentable.insert(Panes_to_draw, pane)-- stash some short-lived variablespane.column_index = column_indexpane.pane_index = pane_indexlocal y_offset = 0local body_sy = syif column[pane_index].title thenbody_sy = body_sy + 5+Line_height+5endif should_update_screen_top(column_index, pane_index, update_screen_top_in_cursor_pane) then
if should_update_screen_top(column_index, pane_index, pane, options) then
return including_cursor_pane
-- update the cursor pane either if it's not editable, or-- if it was explicitly requestedif not pane.editable then return true endif options == nil then return true endif not options.ignore_editable_cursor_pane then return true endif not Editable_cursor_pane_updated_screen_top then return true endreturn false
local modified = edit.keychord_pressed(pane, chord, key)if modified thenlocal cursor_pane_updated_screen_top = maybe_update_screen_top_of_cursor_pane(pane, old_top)pane._height = nilplan_draw_maybe_updating_screen_top_in_cursor_pane(not cursor_pane_updated_screen_top)end
edit.keychord_pressed(pane, chord, key)maybe_update_screen_top_of_cursor_pane(pane, old_top)pane._height = nilplan_draw{ignore_editable_cursor_pane=true}