4A6GJRVUV7PVB62QCNDN7RN6NBHEDN6XPUFJXX22G2OCGNKLCTCAC 5E6DJTFMGUDYGZ3WT5BGSR7KO5WWZ3LV47HNMTHWVIJLBACTRWVQC Y3XOLUYVSWJYRIVWLT3SML7GTMJHMWCTHZJF3ZZ5Q5DY4E6VG72AC QRHK34F2WMGVH44UZGT4ZMLMF5W6GL23YZ723UAD6ZEADYOMTEBAC LW6UME22NIRDLYNQDP47SLYT2ZEBD4HMHQOJNXJRRXQYVMNF4IGAC VAMA5WWY2UDCK4UPFY4YV2BM6ETRCQTY6IP3AVKS4L3VHLBYFS2AC OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC IGYF6FQOON2BT5JFBELGFN2AGELRISIGNOXKWKD2DY5P5BXEDTOAC UGEB2N5EVBSHMMJNDKYEHFYH2HHXEHJK3UWSXZB4BCVQR2N65OAAC F7MP5BERVKCYMWFWQ7EBOJFYY3FYWFVLYENXTWKPREGDLFRESPBAC L2R5WULWN44SCNUPP7R7I2AQCWQR6D3E2YZA35RBXZAR2LGC6LQQC S4U35JJQWC3CBNKHAEZ2DYEGUT5L3UYVAO6PJ5R7HSTD53KWVAXQC -- return if cursor is not visible on screenif pane.cursor_x < 0 or pane.cursor_x >= App.screen.width thenreturnendif pane.cursor_y < Header_height or pane.cursor_y >= App.screen.height thenreturnendif chord == 'C-e' thencommand.exit_editing()else--? print(('%s pressed in editor pane'):format(chord))local old_top = {line=pane.screen_top1.line, pos=pane.screen_top1.pos}edit.keychord_pressed(pane, chord, key)--? print('screen top after:', pane.screen_top1.line, pane.screen_top1.pos)Editable_cursor_pane_updated_screen_top = not eq(old_top, pane.screen_top1)if Editable_cursor_pane_updated_screen_top then--? print('updating viewport based on screen top')Display_settings.y = up_edge_sy(Cursor_pane.col, Cursor_pane.row) + y_of_schema1(pane, pane.screen_top1)--? print(('display settings.y is now %d'):format(Display_settings.y))Surface.cursor_on_screen_check = true -- cursor was on screen before keystroke, so it should remain on screen afterendupdate_metadata(pane)end
keychord_pressed_on_editable_pane(pane, chord, key)
-- return if no part of cursor pane is visiblelocal left_sx = left_edge_sx(Cursor_pane.col)if not overlap(left_sx, left_sx+Display_settings.column_width, Display_settings.x, Display_settings.x+App.screen.width) thenreturnendlocal up_sy = up_edge_sy(Cursor_pane.col, Cursor_pane.row)if not overlap(up_sy, up_sy+pane.height, Display_settings.y, Display_settings.y+App.screen.height-Header_height) thenreturnendif chord == 'C-e' thencommand.edit_note_at_cursor()elsekeychord_pressed_on_immutable_pane(pane, chord, key)end
keychord_pressed_in_normal_mode_with_immutable_pane(pane, chord, key)
endfunction keychord_pressed_on_editable_pane(pane, chord, key)-- ignore if cursor is not visible on screenif pane.cursor_x < 0 or pane.cursor_x >= App.screen.width thenreturnendif pane.cursor_y < Header_height or pane.cursor_y >= App.screen.height thenreturnendif chord == 'C-e' thencommand.exit_editing()else--? print(('%s pressed in editor pane'):format(chord))local old_top = {line=pane.screen_top1.line, pos=pane.screen_top1.pos}edit.keychord_pressed(pane, chord, key)--? print('screen top after:', pane.screen_top1.line, pane.screen_top1.pos)Editable_cursor_pane_updated_screen_top = not eq(old_top, pane.screen_top1)if Editable_cursor_pane_updated_screen_top then--? print('updating viewport based on screen top')Display_settings.y = up_edge_sy(Cursor_pane.col, Cursor_pane.row) + y_of_schema1(pane, pane.screen_top1)--? print(('display settings.y is now %d'):format(Display_settings.y))Surface.cursor_on_screen_check = true -- cursor was on screen before keystroke, so it should remain on screen afterendupdate_metadata(pane)endendfunction keychord_pressed_in_normal_mode_with_immutable_pane(pane, chord, key)-- return if no part of cursor pane is visiblelocal left_sx = left_edge_sx(Cursor_pane.col)if not overlap(left_sx, left_sx+Display_settings.column_width, Display_settings.x, Display_settings.x+App.screen.width) thenreturnendlocal up_sy = up_edge_sy(Cursor_pane.col, Cursor_pane.row)if not overlap(up_sy, up_sy+pane.height, Display_settings.y, Display_settings.y+App.screen.height-Header_height) thenreturnendif chord == 'C-e' thencommand.edit_note_at_cursor()elsekeychord_pressed_on_immutable_pane(pane, chord, key)end