Merge upstream into main
[?]
Jun 30, 2022, 1:02 AM
VUVH2XLFK4225ZWM7V2JFLKO6HZYM5C6IS36DOCARRXWATKXPBEQCDependencies
- [2]
27DROQW2Merge upstream into main - [3]
AM42E4Y6avoid redundant writes on exit - [4]
YT5P6TO6bugfix: save previous file when dropping a new one on - [5]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [6]
EQP53UQVautosave slightly less aggressively - [7]
23DEB6JLmake sure to save right when quitting - [8]
PX7DDEMOautosave slightly less aggressively - [9]
CE4LZV4Tdrop last couple of manual tests - [10]
VIU2FBNVmake sure to save right when quitting - [11]
BLWAYPKVextract a module - [12]
VHQCNMARseveral more modules - [13]
6LJZN727handle chords - [14]
D2GCFTTTclean up repl functionality - [15]
RSZD5A7Gforgot to add json.lua - [16]
AVTNUQYRbasic test-enabled framework - [17]
73OCE2MCafter much struggle, a brute-force undo - [18]
T4FRZSYLdelete an ancient, unused file - [19]
LXTTOB33extract a couple of files - [20]
TLOAPLBJadd a license - [21]
BULPIBEGbeginnings of a module for the text editor - [22]
K2X6G75Zstart writing some tests for drawings - [23]
BPWFKBXTnew test: dragging and dropping a file on lines.love - [24]
V366JSXAvideos - [25]
OGUV4HSAremove some memory leaks from rendered fragments - [26]
KVHUFUFVreorg - [27]
BZRRUIFQcorrect location of the line width slider - [28]
FS2ITYYHrecord a known issue - [29]
VXORMHMEdelete experimental REPL - [30]
4YDBYBA4clean up memory leak experiments - [31]
7M5PGWKUdrop last couple of manual tests - [32]
66X36NZNa little more prose describing manual_tests - [33]
OTIBCAUJlove2d scaffold - [34]
3QNOKBFMbeginnings of a test harness - [35]
R5QXEHUIsomebody stop me - [36]
TVCPXAAUrename - [37]
XX7G2FFJintermingle freehand line drawings with text - [38]
5BJCYYHNconvert videos to gif so they render inline on GitHub
Change contents
- file deletion: main_tests.lua main_tests.lua
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 = trueend,lines = function(self)assert(self.opened)return App.filesystem['foo']:gmatch('[^\n]+')end,close = function(self)self.opened = falseend,}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')endfunction test_adjust_line_width()io.write('\ntest_adjust_line_width')Filename = 'foo'App.screen.init{width=Margin_left+300, height=300}Line_width = 256App.draw() -- initialize buttonendfunction 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 yetLines = load_array{'abc', 'def'}Filename = 'foo'schedule_save()-- now drag a new file bar from the filesystemApp.filesystem['bar'] = 'abc\ndef\nghi\n'local fake_dropped_file = {opened = false,getFilename = function(self)return 'bar'end,open = function(self)self.opened = trueend,lines = function(self)assert(self.opened)return App.filesystem['bar']:gmatch('[^\n]+')end,close = function(self)self.opened = falseend,}App.filedropped(fake_dropped_file)-- filesystem now contains a file called foocheck_eq(App.filesystem['foo'], 'abc\ndef\n', 'F - test_drop_file_saves_previous') - edit in main_tests.lua at line 13
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 = trueend,lines = function(self)assert(self.opened)return App.filesystem['foo']:gmatch('[^\n]+')end,close = function(self)self.opened = falseend,}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')endfunction 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 yetLines = load_array{'abc', 'def'}Filename = 'foo'schedule_save()-- now drag a new file bar from the filesystemApp.filesystem['bar'] = 'abc\ndef\nghi\n'local fake_dropped_file = {opened = false,getFilename = function(self)return 'bar'end,open = function(self)self.opened = trueend,lines = function(self)assert(self.opened)return App.filesystem['bar']:gmatch('[^\n]+')end,close = function(self)self.opened = falseend,}App.filedropped(fake_dropped_file)-- filesystem now contains a file called foocheck_eq(App.filesystem['foo'], 'abc\ndef\n', 'F - test_drop_file_saves_previous')end - edit in main.lua at line 333
save_to_disk(Lines, Filename)end - resurrect zombie in main.lua at line 333
if Next_save thensave_to_disk(Lines, Filename)end - resolve order conflict in main.lua at line 333
- edit in main.lua at line 336
end