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]
2L5MEZV3experiment: new edit namespace - [5]
42LVB4DEtest: naming a point - [6]
YGCT2D2Ostart loading settings as applicable - [7]
KAUD3YIKtests: deleting points/shapes - [8]
4CTZOJPCstop pretending globals are local - [9]
PJEQCTBLadd state arg to Drawing.update - [10]
7CLGG7J2test: autosave after any shape - [11]
ERQKFTPVextract method - [12]
AD34IX2Zcouple more tests - [13]
PX7DDEMOautosave slightly less aggressively - [14]
YT5P6TO6bugfix: save previous file when dropping a new one on - [15]
LNUHQOGHstart passing in Editor_state explicitly - [16]
L6XA5EY2test: moving a point - [17]
7DYUAOI6test: undo moving point - [18]
UN7L3DNNavoid some string concatenations - [19]
T7SJSJIHtest: undo naming a point - [20]
K2X6G75Zstart writing some tests for drawings - [21]
LF7BWEG4group all editor globals - [22]
Y4VYNEGFtest: autosave after name/move/delete of point - [23]
VHQCNMARseveral more modules - [24]
TO6Y2G3Umore decoupling editor tests from App - [25]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [26]
W4UVZETR2 regressions: - [27]
4AXV2HG4all pending manual tests done! - [*]
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)