Merge lines.love

[?]
Mar 26, 2023, 4:43 PM
Z5WOBP27DT46JXRZGX6SNDHZSTY7G77V4FB6B62QQIGUZ7MT45TAC

Dependencies

Change contents

  • resurrect zombie in edit.lua at line 114
    [4.565][3.26:258](),[4.565][3.26:258]()
    if loc1.line > #State.lines then return true end
    local l = State.lines[loc1.line]
    if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing line
    return loc1.pos > #State.lines[loc1.line].data
  • edit in edit.lua at line 114
    [4.529]
    [3.26]
    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
    function edit.invalid1(State, loc1)
  • edit in edit.lua at line 131
    [3.258]
    [4.2701]
    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)
    for i,line in ipairs(State.lines) do
    if line.mode == 'text' then
    State.cursor1 = {line=i, pos=1}
    break
    end
    end
    end