Merge lines.love

[?]
Jul 31, 2023, 5:26 PM
KWHC65JIQZP77ZVU2YUF7M7MFZ7OWO3GPGOXJ6Q7JIZPXVVQLKAQC

Dependencies

  • [2] ONHKBLLC Merge lines.love
  • [3] BMGHJX7G bugfix: search highlight straddling screen lines
  • [4] 66X36NZN a little more prose describing manual_tests
  • [5] 73OCE2MC after much struggle, a brute-force undo
  • [6] RU4HIK43 Merge lines.love
  • [7] OGUV4HSA remove some memory leaks from rendered fragments
  • [8] D4B52CQ2 Merge lines.love
  • [9] CE4LZV4T drop last couple of manual tests
  • [10] B6DS4GZC Merge lines.love
  • [11] JOPVPUSA editing source code from within the app
  • [12] ZE7LVQNE improve a comment
  • [13] 3QNOKBFM beginnings of a test harness
  • [14] FZBXBUFF bugfix: search
  • [15] JDZVBFEI Merge lines.love
  • [16] KB7KTSCP Merge lines.love
  • [17] LWPFEZBI Merge lines.love
  • [18] XX7G2FFJ intermingle freehand line drawings with text
  • [19] TVCPXAAU rename
  • [20] UBA2ZUCP remove a duplicate print to screen
  • [21] T4FRZSYL delete an ancient, unused file
  • [22] FS2ITYYH record a known issue
  • [23] 2344TV56 Merge lines.love
  • [24] GZ5WULJV switch source side to new screen-line-based render
  • [25] N2NUGNN4 include a brief reference enabling many useful apps
  • [26] LXTTOB33 extract a couple of files
  • [27] I64IPGJX avoid saving fragments in lines
  • [28] SGMA5JLE save the list of tests in repo
  • [29] TLOAPLBJ add a license
  • [30] VP5KC4XZ Merge lines.love
  • [31] ZPQI5UL3 bugfix: never use utf8 pos in string.sub
  • [32] BLWAYPKV extract a module
  • [33] IAWCZRFU extract a variable
  • [34] VXORMHME delete experimental REPL
  • [35] 4YDBYBA4 clean up memory leak experiments
  • [36] 6LJZN727 handle chords
  • [37] TWXPV2AC hoist and duplicate a conditional
  • [38] Z4XRNDTR find text
  • [39] K74U4BAU Merge lines.love
  • [40] KWIVKQQ7 Merge lines.love
  • [41] SDEY7LFJ rename a variable
  • [42] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [43] D2GCFTTT clean up repl functionality
  • [44] KMSL74GA support selections in the source editor
  • [45] 2L5MEZV3 experiment: new edit namespace
  • [46] C2M4RUU5 reorganize some comments
  • [47] R5QXEHUI somebody stop me
  • [48] VHQCNMAR several more modules
  • [49] 2CTN2IEF Merge lines.love
  • [50] RSZD5A7G forgot to add json.lua
  • [51] IM7UEBMK bugfix: highlight search patterns on the right line
  • [52] AVTNUQYR basic test-enabled framework
  • [53] KKMFQDR4 editing source code from within the app
  • [54] K2X6G75Z start writing some tests for drawings
  • [55] 3PSFWAIL Merge lines.love
  • [56] OTIBCAUJ love2d scaffold
  • [57] HALS7E5U more clearly skip prints before screen top
  • [58] JYZKEDDG Merge lines.love
  • [59] 2TQUKHBC Merge lines.love
  • [60] ORKN6EOB Merge lines.love
  • [61] MD3W5IRA new fork: rip out drawing support
  • [62] VHUNJHXB Merge lines.love
  • [63] MUJTM6RE bring back a level of wrapping
  • [64] ZLJYLPOT Merge lines.love
  • [65] 4SR3Z4Y3 document the version of LÖVE I've been using
  • [66] BULPIBEG beginnings of a module for the text editor

Change contents

  • file deletion: source_text.lua (----------)source_text.lua (----------)
    [4.2][4.147062:147101](),[4.2][4.147062:147101](),[4.147101][4.83723:83723]()
    end
    -- render colorized text
    local x = State.left
    for frag in screen_line:gmatch('%S*%s*') do
    select_color(frag)
    App.screen.print(frag, x,y)
    x = x+App.width(frag)
    end
    -- render search highlight or cursor
    if State.search_term then
    end
    elseif Focus == 'edit' then
    if pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos then
    Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
    elseif pos + frag_len == State.cursor1.pos then
    -- Show cursor at end of line.
    -- This place also catches end of wrapping screen lines. That doesn't seem worth distinguishing.
    -- It seems useful to see a cursor whether your eye is on the left or right margin.
    Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
    local data = State.lines[State.cursor1.line].data
    local cursor_offset = Text.offset(data, State.cursor1.pos)
    if data:sub(cursor_offset, cursor_offset+#State.search_term-1) == State.search_term then
    local save_selection = State.selection1
    State.selection1 = {line=line_index, pos=State.cursor1.pos+utf8.len(State.search_term)}
    local lo, hi = Text.clip_selection(State, line_index, pos, pos+frag_len)
    Text.draw_highlight(State, line, State.left,y, pos, lo,hi)
    State.selection1 = save_selection
  • edit in text.lua at line 33
    [4.106][4.741:887](),[4.237][4.741:887](),[4.608][4.741:887](),[4.237][4.741:887](),[4.237][4.741:887](),[4.608][4.741:887]()
    local lo_px = Text.draw_highlight(State, line, State.left,y, pos, State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term))
  • replacement in source_text.lua at line 27
    [4.237][4.614:651](),[4.614][4.614:651]()
    -- render any link decorations
    [4.237]
    [4.651]
    -- render any highlights
  • edit in source_text.lua at line 29
    [4.714]
    [4.714]
    -- render link decorations
  • edit in source_text.lua at line 43
    [4.20777][4.1234:1259]()
    -- render fragment
  • edit in source_text.lua at line 47
    [4.88252]
    [4.238]
    if not hide_cursor and line_index == State.cursor1.line then
    -- render search highlight or cursor
    if State.search_term then
    local data = State.lines[State.cursor1.line].data
    local cursor_offset = Text.offset(data, State.cursor1.pos)
    if data:sub(cursor_offset, cursor_offset+#State.search_term-1) == State.search_term then
    local save_selection = State.selection1
    State.selection1 = {line=line_index, pos=State.cursor1.pos+utf8.len(State.search_term)}
    local lo, hi = Text.clip_selection(State, line_index, pos, pos+frag_len)
    Text.draw_highlight(State, line, State.left,y, pos, lo,hi)
    State.selection1 = save_selection
    end
    elseif Focus == 'edit' then
    if pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos then
    Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
    elseif pos + frag_len == State.cursor1.pos then
    -- Show cursor at end of line.
    -- This place also catches end of wrapping screen lines. That doesn't seem worth distinguishing.
    -- It seems useful to see a cursor whether your eye is on the left or right margin.
    Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
    end
    end
    end
  • edit in source_text.lua at line 77
    [4.449][4.88290:88326](),[4.848][4.88290:88326](),[4.1390][4.88290:88326](),[4.88290][4.88290:88326](),[4.88326][4.1391:1539](),[4.1539][4.88475:88511](),[4.88475][4.88475:88511](),[4.88511][4.7:241](),[4.241][4.1540:1686](),[4.88661][4.1540:1686](),[4.1686][4.88798:88834](),[4.88798][4.88798:88834](),[4.88834][4.1687:1760](),[4.1760][4.88898:88952](),[4.88898][4.88898:88952](),[4.88952][4.450:546](),[4.546][4.89066:89102](),[4.1847][4.89066:89102](),[4.89066][4.89066:89102]()
    -- render cursor if necessary
    if not hide_cursor and line_index == State.cursor1.line then
    if pos <= State.cursor1.pos and pos + frag_len >= State.cursor1.pos then
    if State.search_term then
    local data = State.lines[State.cursor1.line].data
    local cursor_offset = Text.offset(data, State.cursor1.pos)
    if data:sub(cursor_offset, cursor_offset+#State.search_term-1) == State.search_term then
    local lo_px = Text.draw_highlight(State, line, State.left,y, pos, State.cursor1.pos, State.cursor1.pos+utf8.len(State.search_term))
    App.color(Text_color)
    love.graphics.print(State.search_term, State.left+lo_px,y)
    end
    elseif Focus == 'edit' then
    Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
    end
    end
    end