A (random) hotkey toggles going into or leaving edit mode. While editing, we autosave every few seconds just like in lines.love. When leaving edit mode we also make sure to flush to disk. And update any other panes containing the same file.
I'm noticing a problem now where word-wrap behaves differently on the first column vs other columns. But only after the first load. So before left/right have been initialized?
DUQDA3U7VNWZSKRVACS6G3FTEB5VXRR7FJQU5NYZ4EFSGL3XUU5QC VHWC2IGQD72ZZUIONIAEP45KPMPX2N6DXN6NU2QGBIWDUHP7INAAC HEL54WE5OI5MS7VXNODYHFIWX4L4DO5CINWRKVBUV3GZ52AVX5KQC 3QQZ7W4EJ7G4HQM5IYWXICMAHVRGERY4X6AOC6LOV5NSZ4OBICSAC OTIBCAUJ3KDQJLVDN3A536DLZGNRYMGJLORZVR3WLCGXGO6UGO6AC 4BX4GJEWW7Z5LA4SJUXADYLAHOYFL4IBOYH4J4DJYRAVKKGGFHGQC J3ER7DFO2TXYUMJAXZUFEHQNLFDNIXSYDTE7HEFGQ2RYB3A6RFPAC X22MOJHFLXMZQJN4IP2HAXIIVD2ALPR4EO5V5YDYF6QPXS7ZNB6QC Cache['foo'] = {lines=load_from_disk('foo'), left=0, right=Display_settings.column_width}Cache['foo2'] = {lines=load_from_disk('foo2'), left=0, right=Display_settings.column_width}
Cache['foo'] = {lines=load_from_disk(Directory..'foo'), left=0, right=Display_settings.column_width}Cache['foo2'] = {lines=load_from_disk(Directory..'foo2'), left=0, right=Display_settings.column_width}
--? function love.quit()--? edit.quit(Editor_state)--? -- save some important settings
function love.quit()if Cursor_pane thenlocal pane = Surface[Cursor_pane.col][Cursor_pane.row]if pane.show_cursor thenedit.quit(pane)endend--? -- TODO: save important settings
--? function App.textinput(t)--? Cursor_time = 0 -- ensure cursor is visible immediately after it moves--? return edit.textinput(Editor_state, t)--? end--?--? function App.keychord_pressed(chord, key)--? Cursor_time = 0 -- ensure cursor is visible immediately after it moves--? return edit.keychord_pressed(Editor_state, chord, key)--? end--?
function App.textinput(t)Cursor_time = 0 -- ensure cursor is visible immediately after it movesif not Cursor_pane then return end-- hotkeys operating on the cursor panelocal pane = Surface[Cursor_pane.col][Cursor_pane.row]if pane.show_cursor thenreturn edit.textinput(pane, t)endendfunction App.keychord_pressed(chord, key)Cursor_time = 0 -- ensure cursor is visible immediately after it moves-- global hotkeys go hereif not Cursor_pane then return end-- hotkeys operating on the cursor panelocal pane = Surface[Cursor_pane.col][Cursor_pane.row]if chord == 'C-x' thenpane.show_cursor = not pane.show_cursorif pane.show_cursor == false thenedit.quit(pane) -- saverefresh_panes(pane)endreturnendif pane.show_cursor thenreturn edit.keychord_pressed(pane, chord, key)elseendendfunction refresh_panes(pane)--? print('refreshing')Cache[pane.id].lines = pane.linesfor x,col in ipairs(Surface) dofor y,p in ipairs(col) doif p.id == pane.id then--? print(x,y)p.lines = pane.linesText.redraw_all(p)endendendend