Merge text.love
[?]
Aug 31, 2023, 5:55 AM
JCRUUD2SRLBSGPWZVXWOSZYJCW32JNBJKRC7PMBUHGUI6YX63W3QCDependencies
- [2]
4HR3G5ZDMerge text.love - [3]
X43ZIKR3Merge text.love - [4]
KRLRRLVGMerge text.love - [5]
HWTLXESCMerge lines.love - [6]
OTIBCAUJlove2d scaffold - [7]
RSZD5A7Gforgot to add json.lua - [8]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [9]
BLWAYPKVextract a module - [10]
ONHKBLLCMerge lines.love - [11]
T4FRZSYLdelete an ancient, unused file - [12]
3PSFWAILMerge lines.love - [13]
3G723RV5Merge text.love - [14]
QD4LOFQRMerge text.love - [15]
2CFLXLIEMerge text.love - [16]
SGMA5JLEsave the list of tests in repo - [17]
2CTN2IEFMerge lines.love - [18]
LWPFEZBIMerge lines.love - [19]
B6DS4GZCMerge lines.love - [20]
TVCPXAAUrename - [21]
JCXL74WVbring back everything from commit a68647ae22 - [22]
PJ5PQAQErecord support for multiple versions - [23]
7CLGG7J2test: autosave after any shape - [24]
IGBTDA6YMerge text.love - [25]
FM5LDKGTMerge text.love - [26]
H4R5BHVYno more Text allocations - [27]
JMUD7T3Oget rid of ugly side-effects in tests - [28]
K2X6G75Zstart writing some tests for drawings - [29]
3QNOKBFMbeginnings of a test harness - [30]
4YDBYBA4clean up memory leak experiments - [31]
K74U4BAUMerge lines.love - [32]
AD34IX2Zcouple more tests - [33]
VHQCNMARseveral more modules - [34]
4KC7I3E2make colors easier to edit - [35]
VHUNJHXBMerge lines.love - [36]
2L5MEZV3experiment: new edit namespace - [37]
66X36NZNa little more prose describing manual_tests - [38]
UAYCSFSKMerge text.love - [39]
ED4Z6ORCcleaner API for file-system access - [40]
2TQUKHBCMerge lines.love - [41]
FS2ITYYHrecord a known issue - [42]
KKMFQDR4editing source code from within the app - [43]
AVTNUQYRbasic test-enabled framework - [44]
73OCE2MCafter much struggle, a brute-force undo - [45]
AT3LVCMPMerge text.love - [46]
MD3W5IRAnew fork: rip out drawing support - [47]
XX7G2FFJintermingle freehand line drawings with text - [48]
R3KXFRZNget rid of to_text - [49]
2344TV56Merge lines.love - [50]
N2NUGNN4include a brief reference enabling many useful apps - [51]
HKV72RZVbugfix: save modified files in save directory - [52]
CUFW4EJLreorganize app.lua and its comments - [53]
FPY4LO2Wmake a few names consistent with snake_case - [54]
KWHC65JIMerge lines.love - [55]
R5QXEHUIsomebody stop me - [56]
BULPIBEGbeginnings of a module for the text editor - [57]
KMSL74GAsupport selections in the source editor - [58]
VXORMHMEdelete experimental REPL - [59]
JFFUF5ALoverride mouse state lookups in tests - [60]
Q6RXCILQMerge text.love - [61]
3QWK3GSAsupport mouse clicks in file navigator - [62]
RU4HIK43Merge lines.love - [63]
PX7DDEMOautosave slightly less aggressively - [64]
2JLMNZZIMerge text.love - [65]
36Z442IVback to commit 8123959e52f without code editing - [66]
7IDHIAYIrename modifier_down to key_down - [67]
LXTTOB33extract a couple of files - [68]
VP5KC4XZMerge lines.love - [69]
VXRYVZ74Merge text.love - [70]
SCOXD4EOMerge lines.love - [71]
UGXRAL54Merge text.love - [72]
JOPVPUSAediting source code from within the app - [73]
TLOAPLBJadd a license - [74]
6LJZN727handle chords - [75]
CE4LZV4Tdrop last couple of manual tests - [76]
OGUV4HSAremove some memory leaks from rendered fragments - [77]
4SR3Z4Y3document the version of LÖVE I've been using - [78]
ZLJYLPOTMerge lines.love - [79]
ORKN6EOBMerge lines.love - [80]
D2GCFTTTclean up repl functionality
Change contents
- file deletion: source_file.lua source_file.lua
local outfile = App.open_for_writing(App.save_dir..State.filename)if outfile == nil thenerror('failed to write to "'..State.filename..'"')endfor _,line in ipairs(State.lines) dolocal infile = App.open_for_reading(App.save_dir..State.filename)if not infile theninfile = App.open_for_reading(App.source_dir..State.filename)endState.lines = load_from_file(infile)if infile then infile:close() endendfunction load_from_file(infile)local result = {}if infile thenlocal infile_next_line = infile:lines() -- works with both Lua files and LÖVE Files (https://www.love2d.org/wiki/File)while true dolocal line = infile_next_line()if line == nil then break end-- the source editor supports only files in the save dir backed by the source dirfunction load_from_disk(State)local infile = App.open_for_reading(App.save_dir..filename)if not infile theninfile = App.open_for_reading(App.source_dir..filename)endif infile theninfile:close()return trueelsereturn falseendend - file deletion: source_edit.lua source_edit.lua
local clipboard_data = App.get_clipboard()for _,code in utf8.codes(clipboard_data) dolocal c = utf8.char(code)if c == '\n' thenText.insert_return(State)elseText.insert_at_cursor(State, c)endendif Text.cursor_out_of_screen(State) thenText.snap_cursor_to_bottom_of_screen(State, State.left, State.right)endschedule_save(State)record_undo_event(State, {before=before, after=snapshot(State, before_line, State.cursor1.line)})App.set_clipboard(s)endschedule_save(State)elseif chord == 'C-v' thenfor _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll-- We don't have a good sense of when to scroll, so we'll be conservative-- and sometimes scroll when we didn't quite need to.local before_line = State.cursor1.linelocal before = snapshot(State, before_line)App.set_clipboard(s)endelseif chord == 'C-x' thenfor _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scrolllocal s = Text.cut_selection(State, State.left, State.right)if s then - resurrect zombie in app.lua at line 171
end - edit in app.lua at line 173
-- If you access the time using App.getTime instead of love.timer.getTime, - resurrect zombie in app.lua at line 173
-- If you access the time using App.get_time instead of love.timer.getTime, - resolve order conflict in app.lua at line 173
- resurrect zombie in app.lua at line 174
-- tests will be able to move the time back and forwards as needed using-- App.wait_fake_time below. - edit in app.lua at line 384
App.open_for_reading = function(filename) return io.open(filename, 'r') endApp.open_for_writing = function(filename) return io.open(filename, 'w') end - resurrect zombie in app.lua at line 384[6.8029]→[6.16028:16250](∅→∅),[6.8029]→[6.16028:16250](∅→∅),[6.636]→[6.16251:16483](∅→∅),[6.636]→[6.16251:16483](∅→∅),[6.907]→[6.16484:16700](∅→∅),[6.907]→[6.16484:16700](∅→∅),[6.16700]→[6.880:1018](∅→∅),[6.913]→[6.880:1018](∅→∅),[6.913]→[6.880:1018](∅→∅)
App.open_for_reading =function(filename)local result = nativefs.newFile(filename)local ok, err = result:open('r')if ok thenreturn resultelsereturn ok, errendApp.open_for_writing =function(filename)local result = nativefs.newFile(filename)local ok, err = result:open('w')if ok thenreturn resultelsereturn ok, errendApp.files = nativefs.getDirectoryItemsApp.source_dir = love.filesystem.getSource()..'/'App.current_dir = nativefs.getWorkingDirectory()..'/'App.save_dir = love.filesystem.getSaveDirectory()..'/'App.get_time = love.timer.getTimeApp.get_clipboard = love.system.getClipboardTextApp.set_clipboard = love.system.setClipboardText - edit in app.lua at line 392
end - edit in app.lua at line 402
end