Merge lines.love

[?]
Mar 17, 2023, 5:53 PM
VN3MTXFKOWZ7J3IZVWM45RT2HFGXTMNITZZRNSZZMY3HLXGOWG5AC

Dependencies

  • [2] OWYI7OJT Merge upstream
  • [3] 57OGXVHZ Merge lines.love
  • [4] 7VGDIPLC more robust state validation
  • [5] 5STHSG4U remove some duplication
  • [6] KKMFQDR4 editing source code from within the app
  • [7] LF7BWEG4 group all editor globals
  • [8] LNUHQOGH start passing in Editor_state explicitly
  • [9] ERQKFTPV extract method
  • [10] 2CK5QI7W make love event names consistent
  • [11] 2L5MEZV3 experiment: new edit namespace
  • [12] 4KC7I3E2 make colors easier to edit

Change contents

  • edit in run.lua at line 40
    [5.179133][4.16:48](),[5.179133][4.16:48]()
    edit.check_locs(Editor_state)
  • resolve order conflict in run.lua at line 40
    [3.303]
    [5.179196]
  • edit in run.lua at line 98
    [5.182195][4.49:81](),[5.182195][4.49:81]()
    edit.check_locs(Editor_state)
  • edit in edit.lua at line 113
    [5.98071][5.3867:3868](),[5.3867][5.3867:3868](),[5.3868][4.92:528](),[5.3868][4.92:528]()
    function edit.check_locs(State)
    -- if State is inconsistent (i.e. file changed by some other program),
    -- throw away all cursor state entirely
    if edit.invalid1(State, State.screen_top1)
    or edit.invalid1(State, State.cursor1)
    or not edit.cursor_on_text(State)
    or not Text.le1(State.screen_top1, State.cursor1) then
    State.screen_top1 = {line=1, pos=1}
    edit.put_cursor_on_first_text_line(State)
    end
    end
  • resurrect zombie in edit.lua at line 113
    [4.528][4.528:529](),[4.528][4.528:529]()
  • edit in edit.lua at line 114
    [4.529][4.529:846](),[4.529][4.529:846](),[5.292][4.847:885](),[5.292][4.847:885]()
    function edit.invalid1(State, loc1)
    return loc1.line > #State.lines
    or loc1.pos > #State.lines[loc1.line].data
    end
    function edit.cursor_on_text(State)
    return State.cursor1.line <= #State.lines
    and State.lines[State.cursor1.line].mode == 'text'
    end
    function edit.put_cursor_on_first_text_line(State)
    State.cursor1 = {line=i, pos=1}