Merge lines.love
[?]
Mar 26, 2023, 4:57 PM
REAIVN7WJ3JMUKLX4BIACO2VMNHVTWLP3DMXPYD7PHVSYFFSV64QCDependencies
- [2]
ASP5RVZAMerge lines.love - [3]
MU2HIRR6Merge lines.love - [4]
LIKTH6HMupdate stale source X-( - [5]
A4BSGS2CMerge lines.love - [6]
BLWAYPKVextract a module - [7]
ORRSP7FVdeduce test names on failures - [8]
RSZD5A7Gforgot to add json.lua - [9]
ZTZOO2OQMerge lines.love - [10]
GUOQRUL7Merge lines.love - [11]
2CK5QI7Wmake love event names consistent - [12]
ORKN6EOBMerge lines.love - [13]
XX7G2FFJintermingle freehand line drawings with text - [14]
KKMFQDR4editing source code from within the app - [15]
OTIBCAUJlove2d scaffold - [16]
73OCE2MCafter much struggle, a brute-force undo - [17]
VXORMHMEdelete experimental REPL - [18]
VHQCNMARseveral more modules - [19]
5Y24ZDZIbugfix - [20]
BULPIBEGbeginnings of a module for the text editor - [21]
TLOAPLBJadd a license - [22]
2TQUKHBCMerge lines.love - [23]
MD3W5IRAnew fork: rip out drawing support - [24]
ETXNVRPTMerge lines.love - [25]
LXTTOB33extract a couple of files - [26]
CE4LZV4Tdrop last couple of manual tests - [27]
VP5KC4XZMerge lines.love - [28]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [29]
LDFXFRUObring a few things in sync between run and source - [30]
T4FRZSYLdelete an ancient, unused file - [31]
4U4VQWNYMerge lines.love - [32]
MQTFTTEKMerge lines.love - [33]
TVCPXAAUrename - [34]
IX5YTLSVstate validation in source editor as well - [35]
2CTN2IEFMerge lines.love - [36]
G54H3YG2get rid of all bifold text - [37]
OGUV4HSAremove some memory leaks from rendered fragments - [38]
66X36NZNa little more prose describing manual_tests - [39]
L6XA5EY2test: moving a point - [40]
KYNGDE2Cconsistent names in a few more places - [41]
U3MJNFUYMerge lines.love - [42]
AVTNUQYRbasic test-enabled framework - [43]
2L5MEZV3experiment: new edit namespace - [44]
OI4FPFINsupport drawings in the source editor - [45]
6LJZN727handle chords - [46]
JOPVPUSAediting source code from within the app - [47]
K74U4BAUMerge lines.love - [48]
FS2ITYYHrecord a known issue - [49]
4EGQRXDAbugfix: naming points - [50]
K2X6G75Zstart writing some tests for drawings - [51]
KMSL74GAsupport selections in the source editor - [52]
VHUNJHXBMerge lines.love - [53]
R5QXEHUIsomebody stop me - [54]
3QNOKBFMbeginnings of a test harness - [55]
VOU73AK6Merge lines.love - [56]
4SR3Z4Y3document the version of LÖVE I've been using - [57]
D2GCFTTTclean up repl functionality - [58]
Q7XPSKIIMerge lines.love - [59]
4YDBYBA4clean up memory leak experiments - [60]
3PSFWAILMerge lines.love
Change contents
- file deletion: source_text.lua source_text.lua
assert(State.lines[State.cursor1.line].mode == 'text')local byte_offset = Text.offset(State.lines[State.cursor1.line].data, State.cursor1.pos)State.lines[State.cursor1.line].data = string.sub(State.lines[State.cursor1.line].data, 1, byte_offset-1)..t..string.sub(State.lines[State.cursor1.line].data, byte_offset)Text.clear_screen_line_cache(State, State.cursor1.line)State.cursor1.pos = State.cursor1.pos+1 - file deletion: source_edit.lua source_edit.lua
if len > 0 thenlocal byte_offset = Text.offset(p.name, len-1)if len == 1 then byte_offset = 0 endp.name = string.sub(p.name, 1, byte_offset)record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})endendendschedule_save(State)elseif State.lines.current_drawing and State.current_drawing_mode == 'name' thenif chord == 'return' thenState.current_drawing_mode = State.previous_drawing_modeState.previous_drawing_mode = nilelselocal before = snapshot(State, State.lines.current_drawing_index)local drawing = State.lines.current_drawinglocal p = drawing.points[drawing.pending.target_point]if chord == 'escape' thenp.name = nilrecord_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})elseif chord == 'backspace' thenlocal len = utf8.len(p.name)elseif State.lines.current_drawing and State.current_drawing_mode == 'name' thenlocal before = snapshot(State, State.lines.current_drawing_index)local drawing = State.lines.current_drawinglocal p = drawing.points[drawing.pending.target_point]p.name = p.name..trecord_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})--? print('text input', t)if State.search_term thenState.search_term = State.search_term..tState.search_text = nilText.search_next(State)--? print('release', State.cursor1.line)if State.lines.current_drawing then--? print('press', State.cursor1.line)if mouse_press_consumed_by_any_button_handler(State, x,y, mouse_button) then-- press on a button and it returned 'true' to short-circuitreturnendfor line_index,line in ipairs(State.lines) dobutton(State, 'draw', {x=State.left-Margin_left+4, y=y+4, w=12,h=12, color={1,1,0},icon = icon.insert_drawing,onpress1 = function()Drawing.before = snapshot(State, line_index-1, line_index)table.insert(State.lines, line_index, {mode='drawing', y=y, h=256/2, points={}, shapes={}, pending={}})table.insert(State.line_cache, line_index, {})if State.cursor1.line >= line_index thenState.cursor1.line = State.cursor1.line+1endschedule_save(State)record_undo_event(State, {before=Drawing.before, after=snapshot(State, line_index-1, line_index+1)})end,})if loc1.line > #State.lines then return true endlocal l = State.lines[loc1.line]if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing linereturn loc1.pos > #State.lines[loc1.line].dataendfunction edit.cursor_on_text(State)return State.cursor1.line <= #State.linesand State.lines[State.cursor1.line].mode == 'text'endfunction edit.put_cursor_on_first_text_line(State) - edit in source_text.lua at line 181
assert(State.lines[State.cursor1.line].mode == 'text') - replacement in source_edit.lua at line 126
return loc1.line > #State.linesor loc1.pos > #State.lines[loc1.line].dataif loc1.line > #State.lines then return true endlocal l = State.lines[loc1.line]if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing linereturn loc1.pos > #State.lines[loc1.line].data - replacement in source_edit.lua at line 174
button(State, 'draw', {x=4,y=y+4, w=12,h=12, color={1,1,0},button(State, 'draw', {x=State.left-Margin_left+4, y=y+4, w=12,h=12, color={1,1,0}, - replacement in source_edit.lua at line 230
--? print('press', State.selection1.line, State.selection1.pos)--? print('press', State.cursor1.line) - replacement in source_edit.lua at line 273
--? print('release')--? print('release', State.cursor1.line) - edit in source_edit.lua at line 325
--? print('text input', t) - replacement in source_edit.lua at line 330
elseif State.current_drawing_mode == 'name' thenelseif State.lines.current_drawing and State.current_drawing_mode == 'name' then - replacement in source_edit.lua at line 483
elseif State.current_drawing_mode == 'name' thenelseif State.lines.current_drawing and State.current_drawing_mode == 'name' then - replacement in source_edit.lua at line 496
local byte_offset = Text.offset(p.name, len-1)if len == 1 then byte_offset = 0 endp.name = string.sub(p.name, 1, byte_offset)record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})if len > 0 thenlocal byte_offset = Text.offset(p.name, len-1)if len == 1 then byte_offset = 0 endp.name = string.sub(p.name, 1, byte_offset)record_undo_event(State, {before=before, after=snapshot(State, State.lines.current_drawing_index)})end - resurrect zombie in drawing_tests.lua at line 493
end