delete some seemingly redundant code
Dependencies
- [2]
G3DLS5OUaudit all asserts - [3]
ILOA5BYFseparate data structure for each line's cache data - [4]
73OCE2MCafter much struggle, a brute-force undo - [5]
OI4FPFINsupport drawings in the source editor - [6]
2L5MEZV3experiment: new edit namespace - [7]
7ZXZGVHMpurge obsolete term 'fragment' - [8]
VJ77YABHmore efficient undo/redo - [9]
TGHAJBESuse line cache for drawings as well - [10]
QCPXQ2E3add state arg to a few functions - [11]
WLWNS6FBa bug I've never run into - [12]
LNUHQOGHstart passing in Editor_state explicitly - [13]
KKMFQDR4editing source code from within the app - [14]
KMSL74GAsupport selections in the source editor
Change contents
- edit in undo.lua at line 84[3.852]→[3.1:51](∅→∅),[3.51]→[2.368:445](∅→∅),[2.445]→[3.94:176](∅→∅),[3.94]→[3.94:176](∅→∅),[3.176]→[2.446:531](∅→∅),[2.531]→[3.227:313](∅→∅),[3.227]→[3.227:313](∅→∅)
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 - edit in source_undo.lua at line 84[3.2662]→[3.2662:2712](∅→∅),[3.2712]→[2.2686:2763](∅→∅),[2.2763]→[3.2755:2837](∅→∅),[3.2755]→[3.2755:2837](∅→∅),[3.2837]→[2.2764:2849](∅→∅),[2.2849]→[3.2888:2974](∅→∅),[3.2888]→[3.2888:2974](∅→∅)
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 - edit in source_edit.lua at line 444
patch_placeholders(State.line_cache, event.after, event.before) - edit in edit.lua at line 443
patch_placeholders(State.line_cache, event.after, event.before)