port an old fix to source editor

[?]
Sep 17, 2023, 5:40 AM
O2IL6JT26B6BJ4LHJYWRBY5LICTKXB3QYIS5S7IV4WSIT2EF7HBQC

Dependencies

  • [2] LIKTH6HM update stale source X-(
  • [3] IX5YTLSV state validation in source editor as well
  • [4] T7EAACC5 bugfix to the helper I added yesterday
  • [5] KKMFQDR4 editing source code from within the app
  • [6] NVSC4N4K change a helper slightly

Change contents

  • replacement in source_edit.lua at line 114
    [3.205][3.205:250]()
    or edit.invalid1(State, State.cursor1)
    [3.205]
    [3.250]
    or edit.invalid_cursor1(State)
  • edit in source_edit.lua at line 128
    [2.301]
    [3.567]
    end
    -- cursor loc in particular differs from other locs in one way:
    -- pos might occur just after end of line
    function edit.invalid_cursor1(State)
    local cursor1 = State.cursor1
    if cursor1.line > #State.lines then return true end
    local l = State.lines[cursor1.line]
    if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing line
    return cursor1.pos > #State.lines[cursor1.line].data + 1