Merge lines.love

[?]
Nov 12, 2022, 2:06 AM
VO2ZVTWKGVKKIU6IM2SKMYKLK4FKR2VYJYMYP5TEAFGMS7TKEDIQC

Dependencies

  • [2] 2CTN2IEF Merge lines.love
  • [3] DW6SNODM source editing: highlight [[ ]] comments/strings
  • [4] XX7G2FFJ intermingle freehand line drawings with text
  • [5] TVCPXAAU rename
  • [6] VHQCNMAR several more modules
  • [7] 4YDBYBA4 clean up memory leak experiments
  • [8] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [9] KMSL74GA support selections in the source editor
  • [10] K2X6G75Z start writing some tests for drawings
  • [11] 3PSFWAIL Merge lines.love
  • [12] ETXNVRPT Merge lines.love
  • [13] TLOAPLBJ add a license
  • [14] RPGTBMMM Merge lines.love
  • [15] 2L5MEZV3 experiment: new edit namespace
  • [16] RSZD5A7G forgot to add json.lua
  • [17] LXTTOB33 extract a couple of files
  • [18] D4B52CQ2 Merge lines.love
  • [19] GUOQRUL7 Merge lines.love
  • [20] OGUV4HSA remove some memory leaks from rendered fragments
  • [21] KKMFQDR4 editing source code from within the app
  • [22] ATQO62TF Merge lines.love
  • [23] 3QNOKBFM beginnings of a test harness
  • [24] CE4LZV4T drop last couple of manual tests
  • [25] AVTNUQYR basic test-enabled framework
  • [26] MD3W5IRA new fork: rip out drawing support
  • [27] VP5KC4XZ Merge lines.love
  • [28] 66X36NZN a little more prose describing manual_tests
  • [29] FS2ITYYH record a known issue
  • [30] D2GCFTTT clean up repl functionality
  • [31] 32V6ZHQB Merge lines.love
  • [32] BULPIBEG beginnings of a module for the text editor
  • [33] R5QXEHUI somebody stop me
  • [34] VBU5YHLR Merge lines.love
  • [35] VHUNJHXB Merge lines.love
  • [36] VXORMHME delete experimental REPL
  • [37] JOPVPUSA editing source code from within the app
  • [38] 73OCE2MC after much struggle, a brute-force undo
  • [39] BLWAYPKV extract a module
  • [40] 6LJZN727 handle chords
  • [41] T4FRZSYL delete an ancient, unused file
  • [42] OTIBCAUJ love2d scaffold

Change contents

  • file deletion: colorize.lua (----------)colorize.lua (----------)
    [4.2][4.209677:209713](),[4.2][4.209677:209713](),[4.209713][4.207764:207764]()
    if edge.suffix and rfind(frag, edge.suffix, nil, --[[plain]] true) == #frag - #edge.suffix + 1 then
    Current_state = edge.target
    break
    end
    end
    end
    function trim(s)
    return s:gsub('^%s+', ''):gsub('%s+$', '')
    end
    function ltrim(s)
    return s:gsub('^%s+', '')
    end
    function rtrim(s)
    return s:gsub('%s+$', '')
    end
    dstring=String_color,
    block_string=String_color,
    block_comment=Comment_color,
    }
    Current_state = 'normal'
    function initialize_color()
    --? print('new line')
    Current_state = 'normal'
    end
    function select_color(frag)
    --? print('before', '^'..frag..'$', Current_state)
    switch_color_based_on_prefix(frag)
    --? print('using color', Current_state, Colors[Current_state])
    App.color(Colors[Current_state])
    switch_color_based_on_suffix(frag)
    --? print('state after suffix', Current_state)
    end
    function switch_color_based_on_prefix(frag)
    if Next_state[Current_state] == nil then
    return
    end
    frag = rtrim(frag)
    for _,edge in pairs(Next_state[Current_state]) do
    if edge.prefix and find(frag, edge.prefix, nil, --[[plain]] true) == 1 then
    Current_state = edge.target
    break
    end
    end
    end
    function switch_color_based_on_suffix(frag)
    if Next_state[Current_state] == nil then
    return
    end
    frag = rtrim(frag)
    for _,edge in pairs(Next_state[Current_state]) do
    comment=Comment_color,
    sstring=String_color,
    Comment_color = {r=0, g=0, b=1}
    String_color = {r=0, g=0.5, b=0.5}
    Divider_color = {r=0.7, g=0.7, b=0.7}
    Colors = {
    normal=Text_color,
    block_string={
    {suffix=']]', target='normal'},
    },
    block_comment={
    {suffix=']]', target='normal'},
    },
    -- comments are a sink
    }
    {prefix='[[', target='block_string'}, -- only single line for now
    },
    dstring={
    {suffix='"', target='normal'},
    },
    sstring={
    {suffix="'", target='normal'},
    },
    {prefix='--[[', target='block_comment'}, -- only single-line for now
    {prefix='--', target='comment'},
    {prefix='"', target='dstring'},
    {prefix="'", target='sstring'},
  • edit in colorize.lua at line 7
    [4.207435]
    [4.207435]
    {prefix='--[[', target='block_comment'}, -- only single-line for now
  • edit in colorize.lua at line 11
    [4.207544]
    [4.207544]
    {prefix='[[', target='block_string'}, -- only single line for now
  • edit in colorize.lua at line 19
    [4.207653]
    [4.207653]
    block_string={
    {suffix=']]', target='normal'},
    },
    block_comment={
    {suffix=']]', target='normal'},
    },
  • replacement in colorize.lua at line 28
    [4.207681][4.207681:207714]()
    Comments_color = {r=0, g=0, b=1}
    [4.207681]
    [4.207714]
    Comment_color = {r=0, g=0, b=1}
  • replacement in colorize.lua at line 34
    [4.207820][4.207820:207846]()
    comment=Comments_color,
    [4.207820]
    [4.207846]
    comment=Comment_color,
  • replacement in colorize.lua at line 36
    [4.207870][4.207870:207893]()
    dstring=String_color
    [4.207870]
    [4.207893]
    dstring=String_color,
    block_string=String_color,
    block_comment=Comment_color,
  • replacement in colorize.lua at line 76
    [4.208814][4.208814:208899]()
    if edge.suffix and rfind(frag, edge.suffix, nil, --[[plain]] true) == #frag then
    [4.208814]
    [4.208899]
    if edge.suffix and rfind(frag, edge.suffix, nil, --[[plain]] true) == #frag - #edge.suffix + 1 then