search: transparently handle drawings everywhere

[?]
Aug 12, 2022, 5:17 AM
7PZ4CQFVYUMSJKVCNM75VKK5JCUYU6ICHWPZXXIC3S63YJVFCP5QC

Dependencies

  • [2] MSOQI3A5 bugfix: check before cursor on same line
  • [3] EETIR4GX bugfix: skip over drawings when searching
  • [4] LXTTOB33 extract a couple of files
  • [5] LF7BWEG4 group all editor globals
  • [6] 5ZA3BRNY add state arg to a few functions

Change contents

  • edit in search.lua at line 23
    [3.39][3.127:139]()
    local pos
  • replacement in search.lua at line 24
    [2.758][3.140:334](),[3.49756][3.140:334]()
    local line = State.lines[State.cursor1.line]
    if line.mode == 'text' then
    pos = line.data:find(State.search_term, State.cursor1.pos)
    if pos then
    State.cursor1.pos = pos
    end
    [2.758]
    [3.49862]
    local pos = find(State.lines[State.cursor1.line].data, State.search_term, State.cursor1.pos)
    if pos then
    State.cursor1.pos = pos
  • replacement in search.lua at line 31
    [3.211][3.335:576]()
    local line = State.lines[i]
    if line.mode == 'text' then
    pos = State.lines[i].data:find(State.search_term)
    if pos then
    State.cursor1.line = i
    State.cursor1.pos = pos
    break
    end
    [3.211]
    [3.50051]
    pos = find(State.lines[i].data, State.search_term)
    if pos then
    State.cursor1.line = i
    State.cursor1.pos = pos
    break
  • replacement in search.lua at line 42
    [3.368][3.368:424]()
    pos = State.lines[i].data:find(State.search_term)
    [3.368]
    [3.50189]
    pos = find(State.lines[i].data, State.search_term)
  • replacement in search.lua at line 52
    [2.833][2.833:1048]()
    local line = State.lines[State.cursor1.line]
    if line.mode == 'text' then
    pos = line.data:find(State.search_term)
    if pos and pos < State.cursor1.pos then
    State.cursor1.pos = pos
    end
    [2.833]
    [2.1048]
    pos = find(State.lines[State.cursor1.line].data, State.search_term)
    if pos and pos < State.cursor1.pos then
    State.cursor1.pos = pos
  • edit in search.lua at line 108
    [3.51762]
    [3.51762]
    end
    function find(s, pat, i)
    if s == nil then return end
    return s:find(pat, i)
  • edit in search.lua at line 116
    [3.51793]
    [3.51793]
    if s == nil then return end