bring a few things in sync between run and source

[?]
Mar 18, 2023, 4:18 AM
LDFXFRUOUESGMZ7Z6BCZUQFRFFRIAB67GSGN2BR2VLT2ONZPUV3QC

Dependencies

  • [2] 5BMR5HRT click to the left of a line
  • [3] UN7GKYV5 support hyperlinks in the source editor
  • [4] LNUHQOGH start passing in Editor_state explicitly
  • [5] KKMFQDR4 editing source code from within the app
  • [6] UHB4GARJ left/right margin -> left/right coordinates
  • [7] 4KC7I3E2 make colors easier to edit
  • [8] OI4FPFIN support drawings in the source editor
  • [9] ZJOSQFN6 bugfix: path munging on Windows
  • [10] ILOA5BYF separate data structure for each line's cache data
  • [11] TGHAJBES use line cache for drawings as well
  • [12] KYNGDE2C consistent names in a few more places
  • [*] 2L5MEZV3 experiment: new edit namespace

Change contents

  • replacement in source_text.lua at line 1724
    [3.1068][3.1068:1149]()
    function starts_with(s, sub)
    return s:find(sub, 1, --[[no escapes]] true) == 1
    [3.1068]
    [3.1149]
    function starts_with(s, prefix)
    if #s < #prefix then
    return false
    end
    for i=1,#prefix do
    if s:sub(i,i) ~= prefix:sub(i,i) then
    return false
    end
    end
    return true
  • replacement in source_text.lua at line 1736
    [3.1154][3.1154:1253]()
    function ends_with(s, sub)
    return s:reverse():find(sub:reverse(), 1, --[[no escapes]] true) == 1
    [3.1154]
    [4.147057]
    function ends_with(s, suffix)
    if #s < #suffix then
    return false
    end
    for i=0,#suffix-1 do
    if s:sub(#s-i,#s-i) ~= suffix:sub(#suffix-i,#suffix-i) then
    return false
    end
    end
    return true
  • replacement in source_edit.lua at line 99
    [4.154970][4.154970:155006]()
    left = left,
    right = right,
    [4.154970]
    [4.155006]
    left = math.floor(left),
    right = math.floor(right),
  • edit in source_edit.lua at line 230
    [4.157047]
    [4.157047]
    -- give some time for the OS to flush everything to disk
    love.timer.sleep(0.1)
  • replacement in source_edit.lua at line 237
    [4.157151][4.21541:21562]()
    --? print('press')
    [4.157151]
    [4.157217]
    --? print('press', State.selection1.line, State.selection1.pos)
  • replacement in edit.lua at line 146
    [4.2826][4.1851:1895]()
    assert(#State.lines == #State.line_cache)
    [4.1023]
    [2.988]
    if #State.lines ~= #State.line_cache then
    print(('line_cache is out of date; %d when it should be %d'):format(#State.line_cache, #State.lines))
    assert(false)
    end