reorg

[?]
May 17, 2022, 5:54 AM
UTF73CBLAPLW2J6BUF4Q7N2TETQ2IKSUZ4267UG357V4SFXDFUTAC

Dependencies

  • [2] 7Q4B6M2D esc to cancel a shape mid-click
  • [3] VVXVV2D2 change data model; text can now have metadata
  • [4] 3CS5KKCI up/down cursor movement
  • [5] OTIBCAUJ love2d scaffold
  • [6] PRPPZGDY speed up some obvious common cases
  • [7] H7OEU6WP experimental approach to combining keyboard and mouse while drawing
  • [8] RJGZD4IN binary search to most natural up/down with proportional fonts
  • [9] 6PUNJS5B backspace
  • [10] HWPK4SMP new mode: manhattan
  • [11] VXORMHME delete experimental REPL
  • [12] 6LJZN727 handle chords
  • [13] 3D5RFWHV stop handling drawings in cursor_pos computations
  • [14] WAZVXUV2 simplest possible way to straighten strokes
  • [15] IYW7X3WL left/right cursor movement, deleting characters
  • [16] 3XD6M3CF refactor

Change contents

  • edit in main.lua at line 516
    [4.196]
    [4.196]
    -- shortcuts for text
  • edit in main.lua at line 564
    [3.2192]
    [4.525]
    elseif chord == 'delete' then
    if cursor_pos <= #lines[cursor_line].data then
    local byte_start = utf8.offset(lines[cursor_line].data, cursor_pos)
    local byte_end = utf8.offset(lines[cursor_line].data, cursor_pos+1)
    if byte_start then
    if byte_end then
    lines[cursor_line].data = string.sub(lines[cursor_line].data, 1, byte_start-1)..string.sub(lines[cursor_line].data, byte_end)
    else
    lines[cursor_line].data = string.sub(lines[cursor_line].data, 1, byte_start-1)
    end
    -- no change to cursor_pos
    end
    end
    -- transitioning between drawings and text
  • replacement in main.lua at line 598
    [4.921][4.1518:1550](),[4.1518][4.1518:1550](),[4.1550][3.2493:2692](),[3.2692][4.1734:1784](),[4.1734][4.1734:1784](),[4.1784][3.2693:2829](),[3.2829][4.1905:1918](),[4.1905][4.1905:1918](),[4.1918][3.2830:2919](),[3.2919][4.1997:2044](),[4.1997][4.1997:2044](),[4.2044][4.296:314](),[4.296][4.296:314]()
    elseif chord == 'delete' then
    if cursor_pos <= #lines[cursor_line].data then
    local byte_start = utf8.offset(lines[cursor_line].data, cursor_pos)
    local byte_end = utf8.offset(lines[cursor_line].data, cursor_pos+1)
    if byte_start then
    if byte_end then
    lines[cursor_line].data = string.sub(lines[cursor_line].data, 1, byte_start-1)..string.sub(lines[cursor_line].data, byte_end)
    else
    lines[cursor_line].data = string.sub(lines[cursor_line].data, 1, byte_start-1)
    end
    -- no change to cursor_pos
    end
    end
    [4.921]
    [2.2]
    -- shortcuts for drawings