Merge upstream into main
[?]
Jul 13, 2022, 6:16 AM
MSDHRXWUFZFE6DZTRMJLLCKZYW4RDMNYK367X5NFKKNP55EJJ7VACDependencies
- [2]
ZLEPKWDJfork: capture frontend for a note-taking system - [3]
UHB4GARJleft/right margin -> left/right coordinates - [4]
VIU2FBNVmake sure to save right when quitting - [5]
BPWFKBXTnew test: dragging and dropping a file on lines.love - [6]
XSLCFVFH. - [7]
5MR22SGZbugfix: enable resize when loading settings - [8]
AM42E4Y6avoid redundant writes on exit - [9]
DWZK32YDinclude CWD when saving filename - [10]
2L5MEZV3experiment: new edit namespace - [11]
LF7BWEG4group all editor globals - [12]
MHOUX5JFexperiment: turn off JIT - [13]
O6T3TPXDbugfix: position cursor up top when loading file - [14]
WQOSZSUEwarn on unused commandline args - [15]
ZZ2B5RPQextract variables for drawing padding - [16]
K464QQR4more defensive resize handling - [17]
7M7LS7I2start saving some settings to disk on quit - [18]
IZZVOCLBconfirm that we have access to all of the love API - [19]
W4UVZETR2 regressions: - [20]
OTIBCAUJlove2d scaffold - [21]
PWHZPJJMalways show current filename in window title - [22]
VHQCNMARseveral more modules - [23]
2RXZ3PGObeginning of a new approach to scroll+wrap - [24]
QCQHLMSTalways have a filename - [25]
YGCT2D2Ostart loading settings as applicable - [26]
LNUHQOGHstart passing in Editor_state explicitly - [27]
R6GUSTBYdefault font size and line-height - [28]
HPVT467Winitialize contains test state - [29]
AVTNUQYRbasic test-enabled framework - [30]
6LJZN727handle chords - [31]
MGOQ5XAVstart uppercasing globals - [32]
5T2E3PDVcouple of bugfixes to file-handling - [33]
HOSPP2ANcrisp font rendering - [34]
VO3GEIRWuse app name in window title - [35]
YT5P6TO6bugfix: save previous file when dropping a new one on - [36]
AD34IX2Zcouple more tests - [37]
Z4KNS42Nto open a file without a terminal, drag it on! - [38]
PGZJ6NATensure Filename is writable when opened outside a terminal - [39]
CE4LZV4Tdrop last couple of manual tests - [40]
AVQ5MC5Dfinish uppercasing all globals - [41]
4CTZOJPCstop pretending globals are local - [42]
PTDO2SOTadd state arg to schedule_save - [43]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [44]
YPHKZVWMextract a new variable - [45]
LAW2O3NWextract variable Margin_left - [46]
S7ZZA3YEugh, handle absolute as well as relative paths - [47]
PX7DDEMOautosave slightly less aggressively - [48]
73OCE2MCafter much struggle, a brute-force undo - [49]
V5TP27FPctrl-+ and ctrl-- to adjust font size - [50]
UYRAO73Yenable pressing and holding backspace - [51]
YKRF5V3Zstarting to load/save - [52]
2KRK3OBVdon't rely on defaults
Change contents
- edit in main_tests.lua at line 12[4.631]→[4.84826:85118](∅→∅),[4.631]→[4.84826:85118](∅→∅),[4.64]→[3.17142:17201](∅→∅),[4.64]→[3.17142:17201](∅→∅),[4.234]→[4.85186:85266](∅→∅),[4.234]→[4.85186:85266](∅→∅),[4.85266]→[4.167:197](∅→∅),[4.85266]→[4.167:197](∅→∅),[4.99]→[3.17202:17261](∅→∅),[4.99]→[3.17202:17261](∅→∅)
check_eq(#Editor_state.lines, 3, 'F - test_drop_file/#lines')check_eq(Editor_state.lines[1].data, 'abc', 'F - test_drop_file/lines:1')check_eq(Editor_state.lines[2].data, 'def', 'F - test_drop_file/lines:2')check_eq(Editor_state.lines[3].data, 'ghi', 'F - test_drop_file/lines:3')App.screen.init{width=Editor_state.left+300, height=300}Editor_state.lines = load_array{'abc', 'def'}Editor_state.filename = 'foo'schedule_save(Editor_state)App.screen.init{width=Editor_state.left+300, height=300} - edit in main.lua at line 17
Directory = love.filesystem.getUserDirectory()..'/pensieve'Filename = love.filesystem.getUserDirectory()..'/lines.txt' -- just for tests - edit in main.lua at line 40[2.168]→[2.168:303](∅→∅),[4.63]→[4.85310:85546](∅→∅),[4.63]→[4.85310:85546](∅→∅),[4.319]→[4.85547:85585](∅→∅),[4.319]→[4.85547:85585](∅→∅),[4.383]→[4.85586:85823](∅→∅),[4.383]→[4.85586:85823](∅→∅),[4.540]→[4.85824:85864](∅→∅),[4.540]→[4.85824:85864](∅→∅),[4.466]→[4.85865:85928](∅→∅),[4.466]→[4.85865:85928](∅→∅)
Filename = Directory..os.date('/%Y/%m/%d/%H-%M-%S')os.execute('mkdir -p '..dirname(Filename))assert(not file_exists(Filename))Editor_state.filename = arg[1]Editor_state.lines = load_from_disk(Editor_state.filename)Editor_state.screen_top1 = {line=1, pos=1}Editor_state.cursor1 = {line=1, pos=1}for i,line in ipairs(Editor_state.lines) doEditor_state.cursor1.line = iEditor_state.lines = load_from_disk(Editor_state.filename)if Editor_state.cursor1.line > #Editor_state.lines or Editor_state.lines[Editor_state.cursor1.line].mode ~= 'text' thenfor i,line in ipairs(Editor_state.lines) doEditor_state.cursor1.line = ilove.window.setTitle('lines.love - '..Editor_state.filename) - resolve order conflict in main.lua at line 40[2.168]
- edit in main.lua at line 40
Editor_state.filename = Editor_state.directory..os.date('/%Y/%m/%d/%H-%M-%S')os.execute('mkdir -p '..dirname(Editor_state.filename))assert(not file_exists(Editor_state.filename)) - replacement in main.lua at line 44
love.window.setTitle('capture.love - '..Filename)love.window.setTitle('capture.love - '..Editor_state.filename) - edit in main.lua at line 66
Editor_state.filename = settings.filename - edit in main.lua at line 70
Editor_state.screen_top1 = settings.screen_topEditor_state.cursor1 = settings.cursor - edit in main.lua at line 105[4.1059]→[4.86541:86634](∅→∅),[4.1059]→[4.86541:86634](∅→∅),[4.8235]→[4.86635:86680](∅→∅),[4.8235]→[4.86635:86680](∅→∅),[4.88]→[4.86681:86725](∅→∅),[4.88]→[4.86681:86725](∅→∅),[4.16]→[4.86726:86772](∅→∅),[4.16]→[4.86726:86772](∅→∅),[4.532]→[4.86773:86809](∅→∅),[4.532]→[4.86773:86809](∅→∅),[4.568]→[4.86810:86891](∅→∅),[4.568]→[4.86810:86891](∅→∅)
if Editor_state.next_save thensave_to_disk(Editor_state.lines, Editor_state.filename)Editor_state.filename = file:getFilename()Editor_state.lines = load_from_file(file)for i,line in ipairs(Editor_state.lines) doEditor_state.cursor1.line = ilove.window.setTitle('Text with Editor_state.lines - '..Editor_state.filename) - edit in main.lua at line 127
local filename = Editor_state.filenameif filename:sub(1,1) ~= '/' thenfilename = love.filesystem.getWorkingDirectory()..'/'..filename -- '/' should work even on Windowsend - replacement in main.lua at line 131
filename=filename,screen_top=Editor_state.screen_top1, cursor=Editor_state.cursor1}} - edit in file.lua at line 2
- resurrect zombie in file.lua at line 2
function file_exists(filename)local infile = App.open_for_reading(filename)if infile theninfile:close()return trueelsereturn falseendend - edit in file.lua at line 11
- replacement in edit.lua at line 106
filename = love.filesystem.getUserDirectory()..'/lines.txt',directory = love.filesystem.getUserDirectory()..'/pensieve',filename = love.filesystem.getUserDirectory()..'/lines.txt', -- just for tests