have file API operate on state object
[?]
Jul 26, 2022, 2:56 AM
SPNMXTYRSNPNQJNBTYDZSHYDZVZRPM4LI5QX7GR2TLTC6SPJX4DACDependencies
- [2]
PX3736DXbetter error message - [3]
ILOA5BYFseparate data structure for each line's cache data - [4]
L6XA5EY2test: moving a point - [5]
LNUHQOGHstart passing in Editor_state explicitly - [6]
ERQKFTPVextract method - [7]
KAUD3YIKtests: deleting points/shapes - [8]
T7SJSJIHtest: undo naming a point - [9]
PX7DDEMOautosave slightly less aggressively - [10]
Y4VYNEGFtest: autosave after name/move/delete of point - [11]
2L5MEZV3experiment: new edit namespace - [12]
YGCT2D2Ostart loading settings as applicable - [13]
42LVB4DEtest: naming a point - [14]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [15]
AD34IX2Zcouple more tests - [16]
7CLGG7J2test: autosave after any shape - [17]
4AXV2HG4all pending manual tests done! - [18]
YT5P6TO6bugfix: save previous file when dropping a new one on - [19]
VHQCNMARseveral more modules - [20]
7DYUAOI6test: undo moving point - [21]
W4UVZETR2 regressions: - [22]
PJEQCTBLadd state arg to Drawing.update - [23]
4CTZOJPCstop pretending globals are local - [24]
TO6Y2G3Umore decoupling editor tests from App - [25]
K2X6G75Zstart writing some tests for drawings - [26]
LF7BWEG4group all editor globals - [27]
UN7L3DNNavoid some string concatenations - [*]
OTIBCAUJlove2d scaffold
Change contents
- replacement in main.lua at line 42
Editor_state.lines = load_from_disk(Editor_state.filename)load_from_disk(Editor_state) - replacement in main.lua at line 48
Editor_state.lines = load_from_disk(Editor_state.filename)load_from_disk(Editor_state) - replacement in main.lua at line 120
save_to_disk(Editor_state.lines, Editor_state.filename)save_to_disk(Editor_state) - replacement in file.lua at line 2[4.15168]→[4.15168:15202](∅→∅),[4.15202]→[4.13:61](∅→∅),[4.61]→[4.15237:15277](∅→∅),[4.15237]→[4.15237:15277](∅→∅)
function load_from_disk(filename)local infile = App.open_for_reading(filename)local result = load_from_file(infile)function load_from_disk(State)local infile = App.open_for_reading(State.filename)State.lines = load_from_file(infile) - edit in file.lua at line 6
return result - replacement in file.lua at line 28
function save_to_disk(lines, filename)local outfile = App.open_for_writing(filename)function save_to_disk(State)local outfile = App.open_for_writing(State.filename) - replacement in file.lua at line 31
error('failed to write to "'..filename..'"')error('failed to write to "'..State.filename..'"') - replacement in file.lua at line 33
for _,line in ipairs(lines) dofor _,line in ipairs(State.lines) do - replacement in edit.lua at line 191
save_to_disk(State.lines, State.filename)save_to_disk(State) - replacement in edit.lua at line 205
save_to_disk(State.lines, State.filename)save_to_disk(State) - replacement in drawing_tests.lua at line 58
Editor_state.lines = load_from_disk(Editor_state.filename)load_from_disk(Editor_state) - replacement in drawing_tests.lua at line 436
Editor_state.lines = load_from_disk(Editor_state.filename)load_from_disk(Editor_state) - replacement in drawing_tests.lua at line 468
Editor_state.lines = load_from_disk(Editor_state.filename)load_from_disk(Editor_state) - replacement in drawing_tests.lua at line 495
Editor_state.lines = load_from_disk(Editor_state.filename)load_from_disk(Editor_state) - replacement in drawing_tests.lua at line 556
Editor_state.lines = load_from_disk(Editor_state.filename)load_from_disk(Editor_state) - replacement in drawing_tests.lua at line 690
Editor_state.lines = load_from_disk(Editor_state.filename)load_from_disk(Editor_state) - replacement in drawing_tests.lua at line 741
Editor_state.lines = load_from_disk(Editor_state.filename)load_from_disk(Editor_state) - replacement in drawing_tests.lua at line 782
Editor_state.lines = load_from_disk(Editor_state.filename)load_from_disk(Editor_state)