minor cleanup and a todo for later

[?]
Apr 2, 2023, 12:34 AM
GGWAHCLEUEJ3PVMPZVYVLAAA3ANWSPWGIBOGQEOUP2L6QU2ERUHQC

Dependencies

  • [2] IFTYOERM line.y -> line_cache.starty in a few more places
  • [3] FUOURDEY clean up some final bifold code
  • [4] VJ77YABH more efficient undo/redo
  • [5] 73OCE2MC after much struggle, a brute-force undo
  • [6] KKMFQDR4 editing source code from within the app
  • [7] OI4FPFIN support drawings in the source editor
  • [8] LF7BWEG4 group all editor globals
  • [9] MTJEVRJR add state arg to a few functions

Change contents

  • replacement in undo.lua at line 64
    [4.1624][4.1624:1687]()
    table.insert(event.lines, {mode='text', data=line.data})
    [4.1624]
    [4.1687]
    table.insert(event.lines, {mode='text', data=line.data}) -- I've forgotten: should we deepcopy(line.data)?
  • replacement in undo.lua at line 66
    [4.1726][4.1726:1978](),[4.1978][2.1:239]()
    local points=deepcopy(line.points)
    --? print('copying', line.points, 'with', #line.points, 'points into', points)
    local shapes=deepcopy(line.shapes)
    --? print('copying', line.shapes, 'with', #line.shapes, 'shapes into', shapes)
    table.insert(event.lines, {mode='drawing', h=line.h, points=points, shapes=shapes, pending={}})
    --? table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})
    [4.1726]
    [4.2236]
    table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})
  • replacement in source_undo.lua at line 64
    [4.1590][3.5:68]()
    table.insert(event.lines, {mode='text', data=line.data})
    [4.1590]
    [4.1671]
    table.insert(event.lines, {mode='text', data=line.data}) -- I've forgotten: should we deepcopy(line.data)?
  • replacement in source_undo.lua at line 66
    [4.1710][4.1710:2200]()
    local points=deepcopy(line.points)
    --? print('copying', line.points, 'with', #line.points, 'points into', points)
    local shapes=deepcopy(line.shapes)
    --? print('copying', line.shapes, 'with', #line.shapes, 'shapes into', shapes)
    table.insert(event.lines, {mode='drawing', h=line.h, points=points, shapes=shapes, pending={}})
    --? table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})
    [4.1710]
    [4.2200]
    table.insert(event.lines, {mode='drawing', h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})