keep all text cache writes inside text.lua

[?]
Jul 17, 2022, 5:06 PM
BW2IUB3KA4AKD35DYLCUCUM4Z32FMKGZNUBQBAEDIQJJYPA547MAC

Dependencies

  • [2] WJBZZQE4 fold together two largely similar cases
  • [3] 537TQ2QN some more logging
  • [4] CVGE3SIG I feel confident now that page-down is working.
  • [5] M6TH7VSZ rip out notion of Line_width
  • [6] 2L5MEZV3 experiment: new edit namespace
  • [7] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [8] LNUHQOGH start passing in Editor_state explicitly
  • [9] MXA3RZYK deduce left/right from state where possible
  • [10] 3ZSUBI57 drop some redundant args from Text.draw
  • [11] 2POFQQLW keep cursor on screen when pressing 'down'
  • [12] JY4VK7L2 rename
  • [13] LF7BWEG4 group all editor globals
  • [14] BULPIBEG beginnings of a module for the text editor
  • [15] X3F7ECSL add state arg to some functions
  • [16] GK47BBCY start passing left/right margins everywhere
  • [17] 3TFEAQSW start using some globals
  • [18] 4VKEE43Z bugfix
  • [19] LXTTOB33 extract a couple of files
  • [20] 73OCE2MC after much struggle, a brute-force undo

Change contents

  • replacement in text.lua at line 9
    [3.1568][3.1:103](),[3.103][3.3:41]()
    -- return values:
    -- y coordinate drawn until in px
    -- position of start of final screen line drawn
    function Text.draw(State, line_index)
    [3.1568]
    [3.1129]
    -- draw a line starting from startpos to screen at y between State.left and State.right
    -- return the final y, and position of start of final screen line drawn
    function Text.draw(State, line_index, y, startpos)
  • edit in text.lua at line 15
    [3.81]
    [3.1747]
    line.starty = y
    line.startpos = startpos
  • edit in text.lua at line 19
    [3.76][3.82:106]()
    local y = line.starty
  • replacement in edit.lua at line 133
    [2.91][3.4396:4442](),[3.4396][3.4396:4442]()
    line.starty = y
    line.startpos = 1
    [2.91]
    [2.92]
    local startpos = 1
  • replacement in edit.lua at line 135
    [2.143][2.143:189]()
    line.startpos = State.screen_top1.pos
    [2.143]
    [2.189]
    startpos = State.screen_top1.pos
  • replacement in edit.lua at line 152
    [3.5239][2.973:1038]()
    y, State.screen_bottom1.pos = Text.draw(State, line_index)
    [3.5239]
    [3.3585]
    y, State.screen_bottom1.pos = Text.draw(State, line_index, y, startpos)