diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-07-25 19:56:39 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-07-25 19:56:39 -0700 |
commit | 48162b981689c58e54ad44f45a9ba4b70a1c68d7 (patch) | |
tree | 8184b384917184e1553017b278602f9515d49f18 /main.lua | |
parent | e26470aada335d56c0766fb2e32524981a6e9af2 (diff) | |
download | text.love-48162b981689c58e54ad44f45a9ba4b70a1c68d7.tar.gz |
have file API operate on state object
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main.lua b/main.lua index 5cf8f08..ce8e778 100644 --- a/main.lua +++ b/main.lua @@ -39,13 +39,13 @@ function App.initialize(arg) if #arg > 0 then Editor_state.filename = arg[1] - Editor_state.lines = load_from_disk(Editor_state.filename) + load_from_disk(Editor_state) Text.redraw_all(Editor_state) Editor_state.screen_top1 = {line=1, pos=1} Editor_state.cursor1 = {line=1, pos=1} edit.fixup_cursor(Editor_state) else - Editor_state.lines = load_from_disk(Editor_state.filename) + load_from_disk(Editor_state) Text.redraw_all(Editor_state) edit.fixup_cursor(Editor_state) end @@ -117,7 +117,7 @@ end function App.filedropped(file) -- first make sure to save edits on any existing file if Editor_state.next_save then - save_to_disk(Editor_state.lines, Editor_state.filename) + save_to_disk(Editor_state) end -- clear the slate for the new file App.initialize_globals() -- in particular, forget all undo history |