resolve conflicts
Dependencies
- [2]
TYLURRX3resolve conflicts - [3]
4Z4XY6TKsimplify some code now that lines contains no derived data - [4]
7ZXZGVHMpurge obsolete term 'fragment' - [5]
PTDO2SOTadd state arg to schedule_save - [6]
R5QXEHUIsomebody stop me - [7]
3QNOKBFMbeginnings of a test harness - [8]
EB6LHFJRuse deepcopy where possible - [9]
CE4LZV4Tdrop last couple of manual tests - [10]
MTJEVRJRadd state arg to a few functions - [11]
ISOFHXB2App.width can no longer take a Text - [12]
QCPXQ2E3add state arg to a few functions - [13]
YXQOITYSMerge lines.love - [14]
2TCIWW6Zstop caching starty - [15]
3XNFQDDNMerge lines.love - [16]
GVJEOWYQresolve conflicts - [17]
BULPIBEGbeginnings of a module for the text editor - [18]
BH7BT36Lctrl+a: select entire buffer - [19]
LK4ZW4BBbugfix - [20]
6LJZN727handle chords - [21]
BLWAYPKVextract a module - [22]
2TQUKHBCMerge lines.love - [23]
RSZD5A7Gforgot to add json.lua - [24]
WPUHAZUCsuperfluous line - [25]
ORKN6EOBMerge lines.love - [26]
7YGYHOEOMerge lines.love - [27]
VHUNJHXBMerge lines.love - [28]
TFUNIT6Mresolve conflicts - [29]
TOXPJJYYresolve conflicts - [30]
CRBLAWBOresolve conflicts - [31]
4SR3Z4Y3document the version of LÖVE I've been using - [32]
WKXJNESIresolve conflicts - [33]
KKQKPGCIresolve conflicts - [34]
4J3Y3DJWpijul bug: redo upstream change - [35]
VHQCNMARseveral more modules - [36]
SGMA5JLEsave the list of tests in repo - [37]
G54H3YG2get rid of all bifold text - [38]
LWPFEZBIMerge lines.love - [39]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing - [40]
UN7GKYV5support hyperlinks in the source editor - [41]
OTIBCAUJlove2d scaffold - [42]
LF7BWEG4group all editor globals - [43]
TGHAJBESuse line cache for drawings as well - [44]
N2NUGNN4include a brief reference enabling many useful apps - [45]
FS2ITYYHrecord a known issue - [46]
MUDXM3JIclearing starty is redundant in mutations - [47]
TBTRYEBPMerge lines.love - [48]
QMRQL2FOresolve conflicts - [49]
6Z6WH62Wresolve conflicts - [50]
66X36NZNa little more prose describing manual_tests - [51]
TLOAPLBJadd a license - [52]
TVCPXAAUrename - [53]
MBAJPTDJresolve conflicts - [54]
D4B52CQ2Merge lines.love - [55]
LXTTOB33extract a couple of files - [56]
T4FRZSYLdelete an ancient, unused file - [57]
73OCE2MCafter much struggle, a brute-force undo - [58]
VP5KC4XZMerge lines.love - [59]
VXORMHMEdelete experimental REPL - [60]
JOPVPUSAediting source code from within the app - [61]
SCOXD4EOMerge lines.love - [62]
6VJTQKW7start supporting LÖVE v12 - [63]
VJ77YABHmore efficient undo/redo - [64]
MUJTM6REbring back a level of wrapping - [65]
XX7G2FFJintermingle freehand line drawings with text - [66]
2CTN2IEFMerge lines.love - [67]
3PSFWAILMerge lines.love - [68]
G3DLS5OUaudit all asserts - [69]
2L5MEZV3experiment: new edit namespace - [70]
OI4FPFINsupport drawings in the source editor - [71]
OGUV4HSAremove some memory leaks from rendered fragments - [72]
R2ASHK5Cfix a bad merge - [73]
K2X6G75Zstart writing some tests for drawings - [74]
LNUHQOGHstart passing in Editor_state explicitly - [75]
KMSL74GAsupport selections in the source editor - [76]
ED4Z6ORCcleaner API for file-system access - [77]
ZS5IYZH5stop caching screen_bottom1 - [78]
KKMFQDR4editing source code from within the app - [79]
WLWNS6FBa bug I've never run into - [80]
AVTNUQYRbasic test-enabled framework - [81]
D2GCFTTTclean up repl functionality - [82]
ILOA5BYFseparate data structure for each line's cache data - [83]
4YDBYBA4clean up memory leak experiments - [84]
MOAEVTKJclean up a few more loose ends - [85]
ZLJYLPOTMerge lines.love - [86]
IPMYE6WTestablish a fairly fundamental invariant
Change contents
- file deletion: source_undo.lua source_undo.lua
table.insert(event.lines, deepcopy(State.lines[i]))endreturn eventendfunction patch(lines, from, to)--? if #from.lines == 1 and #to.lines == 1 then--? assert(from.start_line == from.end_line)--? assert(to.start_line == to.end_line)--? assert(from.start_line == to.start_line)--? lines[from.start_line] = to.lines[1]--? return--? end - file deletion: source_text.lua source_text.lua
Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks--? print('clearing line caches')-- Perform some early sanity checking here, in hopes that we correctly call-- this whenever we change editor state.if State.right <= State.left thenassert(false, ('Right margin %d must be to the right of the left margin %d'):format(State.right, State.left))endendfunction Text.in_line(State, line_index, x,y)local line = State.lines[line_index]local line_cache = State.line_cache[line_index]endendendendend-- return the location of the start of the bottom-most line on screenfunction Text.screen_bottom1(State)-- duplicate some logic from love.draw-- does not modify State (except to populate line_cache)local loc2 = Text.to2(State, State.screen_top1)local y = State.topwhile true doif State.lines[loc2.line].mode == 'text' theny = y + State.line_heightelseif State.lines[loc2.line].mode == 'drawing' theny = y + Drawing_padding_height + Drawing.pixels(State.lines[loc2.line].h, State.width)endif y + State.line_height > App.screen.height then break endlocal next_loc2 = Text.next_screen_line(State, loc2)if Text.eq2(next_loc2, loc2) then break endloc2 = next_loc2endreturn Text.to1(State, loc2)endendText.clear_screen_line_cache(State, State.cursor1.line) - file deletion: source_edit.lua source_edit.lua
-- screen_line_starting_pos: optional array of codepoint indices if it wraps over more than one screen lineText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaksschedule_save(State)end-- clipboardschedule_save(State)endelseif chord == 'C-y' thenelseif chord == 'return' thenState.search_term = nilline_cache = {},-- Given wrapping, any potential location for the text cursor can be described in two ways:-- * schema 1: As a combination of line index and position within a line (in utf8 codepoint units)-- * schema 2: As a combination of line index, screen line index within the line, and a position within the screen line. - edit in undo.lua at line 59
local line = State.lines[i]table.insert(event.lines, {data=line.data}) -- I've forgotten: should we deepcopy(line.data)? - edit in source_undo.lua at line 60
-- deep copy lines without cached stuff like text fragments - replacement in source_undo.lua at line 61[5.2045]→[5.2045:2077](∅→∅),[5.2077]→[5.108:140](∅→∅),[5.140]→[5.109:223](∅→∅),[5.223]→[5.221:260](∅→∅),[5.221]→[5.221:260](∅→∅),[5.260]→[5.224:356](∅→∅),[5.356]→[5.750:759](∅→∅),[5.750]→[5.750:759](∅→∅),[5.759]→[5.309:373](∅→∅),[5.373]→[5.802:810](∅→∅),[5.802]→[5.802:810](∅→∅)
local line = State.lines[i]if line.mode == 'text' thentable.insert(event.lines, {mode='text', data=line.data}) -- I've forgotten: should we deepcopy(line.data)?elseif line.mode == 'drawing' thentable.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})elseassert(false, ('unknown line mode %s'):format(line.mode))endtable.insert(event.lines, deepcopy(State.lines[i])) - edit in source_undo.lua at line 84[5.2725]→[5.2725:2775](∅→∅),[5.2775]→[5.538:615](∅→∅),[5.615]→[5.2818:2900](∅→∅),[5.2818]→[5.2818:2900](∅→∅),[5.2900]→[5.616:701](∅→∅),[5.701]→[5.2951:3037](∅→∅),[5.2951]→[5.2951:3037](∅→∅)
function patch_placeholders(line_cache, from, to)assert(from.start_line == to.start_line, 'failed to patch undo operation')for i=from.end_line,from.start_line,-1 dotable.remove(line_cache, i)endassert(#to.lines == to.end_line-to.start_line+1, 'failed to patch undo operation')for i=1,#to.lines dotable.insert(line_cache, to.start_line+i-1, {})endend - replacement in source_text.lua at line 292
Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - replacement in source_text.lua at line 430
Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - replacement in source_text.lua at line 479
Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - replacement in source_text.lua at line 541
Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - replacement in source_text.lua at line 687
Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - replacement in source_text.lua at line 832
Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - replacement in source_text.lua at line 1121
--? print('clearing fragments')--? print('clearing line caches') - replacement in source_edit.lua at line 56
-- fragments: snippets of the line guaranteed to not straddle screen lines-- screen_line_starting_pos: optional array of grapheme indices if it wraps over more than one screen line-- screen_line_starting_pos: optional array of codepoint indices if it wraps over more than one screen line - replacement in source_edit.lua at line 402
Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - edit in source_edit.lua at line 444
patch_placeholders(State.line_cache, event.after, event.before) - replacement in source_edit.lua at line 446
-- if we're scrolling, reclaim all fragments to avoid memory leaksText.redraw_all(State)Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - replacement in source_edit.lua at line 459
-- if we're scrolling, reclaim all fragments to avoid memory leaksText.redraw_all(State)Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - replacement in edit.lua at line 277
Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - replacement in edit.lua at line 322
patch_placeholders(State.line_cache, event.after, event.before)-- if we're scrolling, reclaim all fragments to avoid memory leaksText.redraw_all(State)Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - replacement in edit.lua at line 333
-- if we're scrolling, reclaim all fragments to avoid memory leaksText.redraw_all(State)Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - edit in edit.lua at line 449[5.12430]→[2.1075:1075](∅→∅),[5.296]→[4.1915:2014](∅→∅),[5.296]→[4.1915:2014](∅→∅),[5.296]→[4.1915:2014](∅→∅),[5.104]→[4.1815:1914](∅→∅),[5.104]→[4.1815:1914](∅→∅),[5.104]→[4.1815:1914](∅→∅),[5.7184]→[4.1715:1814](∅→∅),[5.7184]→[4.1715:1814](∅→∅)
Text.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaksText.redraw_all(State) -- if we're scrolling, reclaim all line caches to avoid memory leaks - resolve order conflict in edit.lua at line 449[5.12430]