have file API operate on state object

[?]
Jul 26, 2022, 2:56 AM
SPNMXTYRSNPNQJNBTYDZSHYDZVZRPM4LI5QX7GR2TLTC6SPJX4DAC

Dependencies

  • [2] PX3736DX better error message
  • [3] ILOA5BYF separate data structure for each line's cache data
  • [4] 2L5MEZV3 experiment: new edit namespace
  • [5] 42LVB4DE test: naming a point
  • [6] YGCT2D2O start loading settings as applicable
  • [7] KAUD3YIK tests: deleting points/shapes
  • [8] 4CTZOJPC stop pretending globals are local
  • [9] PJEQCTBL add state arg to Drawing.update
  • [10] 7CLGG7J2 test: autosave after any shape
  • [11] ERQKFTPV extract method
  • [12] AD34IX2Z couple more tests
  • [13] PX7DDEMO autosave slightly less aggressively
  • [14] YT5P6TO6 bugfix: save previous file when dropping a new one on
  • [15] LNUHQOGH start passing in Editor_state explicitly
  • [16] L6XA5EY2 test: moving a point
  • [17] 7DYUAOI6 test: undo moving point
  • [18] UN7L3DNN avoid some string concatenations
  • [19] T7SJSJIH test: undo naming a point
  • [20] K2X6G75Z start writing some tests for drawings
  • [21] LF7BWEG4 group all editor globals
  • [22] Y4VYNEGF test: autosave after name/move/delete of point
  • [23] VHQCNMAR several more modules
  • [24] TO6Y2G3U more decoupling editor tests from App
  • [25] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [26] W4UVZETR 2 regressions:
  • [27] 4AXV2HG4 all pending manual tests done!
  • [*] OTIBCAUJ love2d scaffold

Change contents

  • replacement in main.lua at line 42
    [4.85345][4.85345:85408]()
    Editor_state.lines = load_from_disk(Editor_state.filename)
    [4.85345]
    [3.7629]
    load_from_disk(Editor_state)
  • replacement in main.lua at line 48
    [4.383][4.85586:85649]()
    Editor_state.lines = load_from_disk(Editor_state.filename)
    [4.383]
    [3.7664]
    load_from_disk(Editor_state)
  • replacement in main.lua at line 120
    [4.86574][4.86574:86634]()
    save_to_disk(Editor_state.lines, Editor_state.filename)
    [4.86574]
    [4.1113]
    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)
    [4.15139]
    [4.15277]
    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
    [4.15313][4.15313:15329]()
    return result
  • replacement in file.lua at line 28
    [4.15977][4.15977:16016](),[4.16016][4.2190:2239]()
    function save_to_disk(lines, filename)
    local outfile = App.open_for_writing(filename)
    [4.15977]
    [2.14]
    function save_to_disk(State)
    local outfile = App.open_for_writing(State.filename)
  • replacement in file.lua at line 31
    [2.39][2.39:88]()
    error('failed to write to "'..filename..'"')
    [2.39]
    [2.88]
    error('failed to write to "'..State.filename..'"')
  • replacement in file.lua at line 33
    [2.94][4.16057:16090](),[4.2239][4.16057:16090](),[4.16057][4.16057:16090]()
    for _,line in ipairs(lines) do
    [2.94]
    [4.16090]
    for _,line in ipairs(State.lines) do
  • replacement in edit.lua at line 191
    [4.4315][4.4315:4361]()
    save_to_disk(State.lines, State.filename)
    [4.4315]
    [4.4361]
    save_to_disk(State)
  • replacement in edit.lua at line 205
    [4.4441][4.4441:4487]()
    save_to_disk(State.lines, State.filename)
    [4.4441]
    [4.6746]
    save_to_disk(State)
  • replacement in drawing_tests.lua at line 58
    [4.622][4.107039:107100]()
    Editor_state.lines = load_from_disk(Editor_state.filename)
    [4.622]
    [3.8638]
    load_from_disk(Editor_state)
  • replacement in drawing_tests.lua at line 436
    [4.55][4.118419:118480]()
    Editor_state.lines = load_from_disk(Editor_state.filename)
    [4.55]
    [3.9034]
    load_from_disk(Editor_state)
  • replacement in drawing_tests.lua at line 468
    [4.242][4.119070:119131]()
    Editor_state.lines = load_from_disk(Editor_state.filename)
    [4.242]
    [3.9100]
    load_from_disk(Editor_state)
  • replacement in drawing_tests.lua at line 495
    [4.492][4.119635:119696]()
    Editor_state.lines = load_from_disk(Editor_state.filename)
    [4.492]
    [3.9133]
    load_from_disk(Editor_state)
  • replacement in drawing_tests.lua at line 556
    [4.754][4.121379:121440]()
    Editor_state.lines = load_from_disk(Editor_state.filename)
    [4.754]
    [3.9232]
    load_from_disk(Editor_state)
  • replacement in drawing_tests.lua at line 690
    [4.33][4.124808:124869]()
    Editor_state.lines = load_from_disk(Editor_state.filename)
    [4.33]
    [3.9397]
    load_from_disk(Editor_state)
  • replacement in drawing_tests.lua at line 741
    [4.53][4.125895:125956]()
    Editor_state.lines = load_from_disk(Editor_state.filename)
    [4.53]
    [3.9463]
    load_from_disk(Editor_state)
  • replacement in drawing_tests.lua at line 782
    [4.1704][4.127022:127083]()
    Editor_state.lines = load_from_disk(Editor_state.filename)
    [4.1704]
    [3.9529]
    load_from_disk(Editor_state)