line.y -> line_cache.starty in a few more places

[?]
Jul 28, 2022, 3:45 AM
IFTYOERMW7P3I24WISZN35X3GWJ5MSMRYDRBK3L52GCZTPP3CWZQC

Dependencies

  • [2] MTJEVRJR add state arg to a few functions
  • [3] UHB4GARJ left/right margin -> left/right coordinates
  • [4] ILOA5BYF separate data structure for each line's cache data
  • [5] ZLJGZYQG select text with shift + mouseclick
  • [6] 3HVBAZPA add state arg to a few functions
  • [7] LF7BWEG4 group all editor globals
  • [8] SPSW74Y5 add state arg to Text.keychord_pressed
  • [9] QCPXQ2E3 add state arg to a few functions
  • [10] APYPFFS3 call edit rather than App callbacks in tests
  • [11] WAR3HXHT test both ways of selecting text with mouse
  • [12] RMKMPFT5 fix a corner case when selecting text
  • [13] 5ZA3BRNY add state arg to a few functions
  • [14] 73OCE2MC after much struggle, a brute-force undo
  • [15] LNUHQOGH start passing in Editor_state explicitly
  • [16] S2MISTTM add state arg to a few functions
  • [17] 2L5MEZV3 experiment: new edit namespace
  • [18] VJ77YABH more efficient undo/redo
  • [19] PTDO2SOT add state arg to schedule_save
  • [*] LXTTOB33 extract a couple of files

Change contents

  • replacement in undo.lua at line 70
    [4.1978][4.1978:2236]()
    table.insert(event.lines, {mode='drawing', y=line.y, h=line.h, points=points, shapes=shapes, pending={}})
    --? table.insert(event.lines, {mode='drawing', y=line.y, h=line.h, points=deepcopy(line.points), shapes=deepcopy(line.shapes), pending={}})
    [4.1978]
    [4.2236]
    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={}})
  • replacement in text_tests.lua at line 834
    [4.19386][4.1150:1232]()
    edit.draw(Editor_state) -- populate line.y for each line in Editor_state.lines
    [4.19386]
    [3.5639]
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
  • replacement in text_tests.lua at line 852
    [4.20197][4.1233:1315]()
    edit.draw(Editor_state) -- populate line.y for each line in Editor_state.lines
    [4.20197]
    [4.2]
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
  • replacement in text_tests.lua at line 873
    [4.21125][4.1316:1398]()
    edit.draw(Editor_state) -- populate line.y for each line in Editor_state.lines
    [4.21125]
    [4.581]
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
  • replacement in text_tests.lua at line 899
    [4.22267][4.1399:1481]()
    edit.draw(Editor_state) -- populate line.y for each line in Editor_state.lines
    [4.22267]
    [4.446]
    edit.draw(Editor_state) -- populate line_cache.starty for each line Editor_state.line_cache
  • replacement in edit.lua at line 289
    [4.6311][4.6311:6394]()
    for _,line in ipairs(State.lines) do line.y = nil end -- just in case we scroll
    [4.6311]
    [4.6394]
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
  • replacement in edit.lua at line 353
    [4.12265][4.7858:7943]()
    for _,line in ipairs(State.lines) do line.y = nil end -- just in case we scroll
    [4.12265]
    [2.2587]
    for _,line in ipairs(State.lines) do line.starty = nil end -- just in case we scroll
  • replacement in edit.lua at line 369
    [4.12746][4.8140:8225]()
    for _,line in ipairs(State.lines) do line.y = nil end -- just in case we scroll
    [4.12746]
    [2.2624]
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
  • replacement in edit.lua at line 385
    [4.13241][4.8422:8507]()
    for _,line in ipairs(State.lines) do line.y = nil end -- just in case we scroll
    [4.13241]
    [4.3829]
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
  • replacement in edit.lua at line 391
    [4.13432][4.8508:8593]()
    for _,line in ipairs(State.lines) do line.y = nil end -- just in case we scroll
    [4.13432]
    [3.22975]
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll
  • replacement in edit.lua at line 398
    [4.13689][4.8683:8768]()
    for _,line in ipairs(State.lines) do line.y = nil end -- just in case we scroll
    [4.13689]
    [4.13768]
    for _,line in ipairs(State.lines) do line.starty = nil end -- just in case we scroll
  • replacement in edit.lua at line 419
    [4.14561][4.14561:14592]()
    -- DON'T reset line.y here
    [4.14561]
    [4.15]
    -- DON'T reset line_cache.starty here
  • replacement in edit.lua at line 454
    [4.15878][4.9507:9592]()
    for _,line in ipairs(State.lines) do line.y = nil end -- just in case we scroll
    [4.15878]
    [4.7099]
    for _,line_cache in ipairs(State.line_cache) do line_cache.starty = nil end -- just in case we scroll