Merge upstream into main

[?]
Jun 30, 2022, 1:02 AM
VUVH2XLFK4225ZWM7V2JFLKO6HZYM5C6IS36DOCARRXWATKXPBEQC

Dependencies

  • [2] 27DROQW2 Merge upstream into main
  • [3] AM42E4Y6 avoid redundant writes on exit
  • [4] YT5P6TO6 bugfix: save previous file when dropping a new one on
  • [5] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [6] EQP53UQV autosave slightly less aggressively
  • [7] 23DEB6JL make sure to save right when quitting
  • [8] PX7DDEMO autosave slightly less aggressively
  • [9] CE4LZV4T drop last couple of manual tests
  • [10] VIU2FBNV make sure to save right when quitting
  • [11] BLWAYPKV extract a module
  • [12] VHQCNMAR several more modules
  • [13] 6LJZN727 handle chords
  • [14] D2GCFTTT clean up repl functionality
  • [15] RSZD5A7G forgot to add json.lua
  • [16] AVTNUQYR basic test-enabled framework
  • [17] 73OCE2MC after much struggle, a brute-force undo
  • [18] T4FRZSYL delete an ancient, unused file
  • [19] LXTTOB33 extract a couple of files
  • [20] TLOAPLBJ add a license
  • [21] BULPIBEG beginnings of a module for the text editor
  • [22] K2X6G75Z start writing some tests for drawings
  • [23] BPWFKBXT new test: dragging and dropping a file on lines.love
  • [24] V366JSXA videos
  • [25] OGUV4HSA remove some memory leaks from rendered fragments
  • [26] KVHUFUFV reorg
  • [27] BZRRUIFQ correct location of the line width slider
  • [28] FS2ITYYH record a known issue
  • [29] VXORMHME delete experimental REPL
  • [30] 4YDBYBA4 clean up memory leak experiments
  • [31] 7M5PGWKU drop last couple of manual tests
  • [32] 66X36NZN a little more prose describing manual_tests
  • [33] OTIBCAUJ love2d scaffold
  • [34] 3QNOKBFM beginnings of a test harness
  • [35] R5QXEHUI somebody stop me
  • [36] TVCPXAAU rename
  • [37] XX7G2FFJ intermingle freehand line drawings with text
  • [38] 5BJCYYHN convert videos to gif so they render inline on GitHub

Change contents

  • file deletion: main_tests.lua (----------)main_tests.lua (----------)
    [5.2][5.1125:1163](),[5.2][5.1125:1163](),[5.1163][5.7:7]()
    function test_drop_file()
    io.write('\ntest_drop_file')
    App.screen.init{width=Margin_left+300, height=300}
    App.filesystem['foo'] = 'abc\ndef\nghi\n'
    local fake_dropped_file = {
    opened = false,
    getFilename = function(self)
    return 'foo'
    end,
    open = function(self)
    self.opened = true
    end,
    lines = function(self)
    assert(self.opened)
    return App.filesystem['foo']:gmatch('[^\n]+')
    end,
    close = function(self)
    self.opened = false
    end,
    }
    App.filedropped(fake_dropped_file)
    check_eq(#Lines, 3, 'F - test_drop_file/#lines')
    check_eq(Lines[1].data, 'abc', 'F - test_drop_file/lines:1')
    check_eq(Lines[2].data, 'def', 'F - test_drop_file/lines:2')
    check_eq(Lines[3].data, 'ghi', 'F - test_drop_file/lines:3')
    end
    function test_adjust_line_width()
    io.write('\ntest_adjust_line_width')
    Filename = 'foo'
    App.screen.init{width=Margin_left+300, height=300}
    Line_width = 256
    App.draw() -- initialize button
    end
    function test_drop_file_saves_previous()
    io.write('\ntest_drop_file_saves_previous')
    App.screen.init{width=Margin_left+300, height=300}
    -- initially editing a file called foo that hasn't been saved to filesystem yet
    Lines = load_array{'abc', 'def'}
    Filename = 'foo'
    schedule_save()
    -- now drag a new file bar from the filesystem
    App.filesystem['bar'] = 'abc\ndef\nghi\n'
    local fake_dropped_file = {
    opened = false,
    getFilename = function(self)
    return 'bar'
    end,
    open = function(self)
    self.opened = true
    end,
    lines = function(self)
    assert(self.opened)
    return App.filesystem['bar']:gmatch('[^\n]+')
    end,
    close = function(self)
    self.opened = false
    end,
    }
    App.filedropped(fake_dropped_file)
    -- filesystem now contains a file called foo
    check_eq(App.filesystem['foo'], 'abc\ndef\n', 'F - test_drop_file_saves_previous')
  • edit in main_tests.lua at line 13
    [5.552]
    [5.552]
    function test_drop_file()
    io.write('\ntest_drop_file')
    App.screen.init{width=Margin_left+300, height=300}
    App.filesystem['foo'] = 'abc\ndef\nghi\n'
    local fake_dropped_file = {
    opened = false,
    getFilename = function(self)
    return 'foo'
    end,
    open = function(self)
    self.opened = true
    end,
    lines = function(self)
    assert(self.opened)
    return App.filesystem['foo']:gmatch('[^\n]+')
    end,
    close = function(self)
    self.opened = false
    end,
    }
    App.filedropped(fake_dropped_file)
    check_eq(#Lines, 3, 'F - test_drop_file/#lines')
    check_eq(Lines[1].data, 'abc', 'F - test_drop_file/lines:1')
    check_eq(Lines[2].data, 'def', 'F - test_drop_file/lines:2')
    check_eq(Lines[3].data, 'ghi', 'F - test_drop_file/lines:3')
    end
    function test_drop_file_saves_previous()
    io.write('\ntest_drop_file_saves_previous')
    App.screen.init{width=Margin_left+300, height=300}
    -- initially editing a file called foo that hasn't been saved to filesystem yet
    Lines = load_array{'abc', 'def'}
    Filename = 'foo'
    schedule_save()
    -- now drag a new file bar from the filesystem
    App.filesystem['bar'] = 'abc\ndef\nghi\n'
    local fake_dropped_file = {
    opened = false,
    getFilename = function(self)
    return 'bar'
    end,
    open = function(self)
    self.opened = true
    end,
    lines = function(self)
    assert(self.opened)
    return App.filesystem['bar']:gmatch('[^\n]+')
    end,
    close = function(self)
    self.opened = false
    end,
    }
    App.filedropped(fake_dropped_file)
    -- filesystem now contains a file called foo
    check_eq(App.filesystem['foo'], 'abc\ndef\n', 'F - test_drop_file_saves_previous')
    end
  • edit in main.lua at line 333
    [5.66][5.66:103](),[5.103][2.45:45]()
    save_to_disk(Lines, Filename)
    end
  • resurrect zombie in main.lua at line 333
    [5.66][3.8:68](),[5.66][3.8:68]()
    if Next_save then
    save_to_disk(Lines, Filename)
    end
  • resolve order conflict in main.lua at line 333
    [5.66]
    [3.8]
  • edit in main.lua at line 336
    [3.68]
    [5.1399]
    end