Merge text0

[?]
Jul 31, 2023, 6:08 PM
52NEZG2FJSEHUOZI72O7VEHXULPUHKTC4FPP7HSY3CNGKR4OPCCQC

Dependencies

  • [2] 2N3HLCOV Merge text0
  • [3] 4L3UAM75 experiment: knob for readonly editor
  • [4] BMGHJX7G bugfix: search highlight straddling screen lines
  • [5] UBA2ZUCP remove a duplicate print to screen
  • [6] GZ2OYPSH configurable colors and cursor in editor widget
  • [7] TLEW46AQ Merge text0
  • [8] PLKNHYZ4 extract a function
  • [9] B4FAIVRA Merge lines.love
  • [10] HALS7E5U more clearly skip prints before screen top
  • [11] LSYLEVBD drop some redundant args when clearing the cache
  • [12] TGHAJBES use line cache for drawings as well
  • [13] R53OF3ON one bug I've repeatedly run into while testing with Moby Dick
  • [14] 6K5PFF6X helper: trimming whitespace from strings
  • [15] ZPQI5UL3 bugfix: never use utf8 pos in string.sub
  • [16] NQM25OZV reduce use of rfind
  • [17] IAWCZRFU extract a variable
  • [18] CYEH4AXB a prefix for metadata in the manifest
  • [19] KB7KTSCP Merge lines.love
  • [20] MD3W5IRA new fork: rip out drawing support
  • [21] ILOA5BYF separate data structure for each line's cache data
  • [22] MUJTM6RE bring back a level of wrapping
  • [23] SDEY7LFJ rename a variable
  • [24] ZE7LVQNE improve a comment
  • [25] Z4XRNDTR find text
  • [26] 4CTZOJPC stop pretending globals are local
  • [27] HLIF3YQE Merge text0
  • [28] ZLJYLPOT Merge lines.love
  • [29] FZBXBUFF bugfix: search
  • [30] TWXPV2AC hoist and duplicate a conditional
  • [31] IM7UEBMK bugfix: highlight search patterns on the right line
  • [32] I64IPGJX avoid saving fragments in lines
  • [*] BULPIBEG beginnings of a module for the text editor

Change contents

  • edit in text.lua at line 37
    [5.458][2.3:237](),[5.458][2.3:237](),[2.237][5.26:172](),[5.1893][5.26:172](),[5.172][5.3604:3632](),[5.1566][5.3604:3632](),[5.3632][5.174:174](),[5.3632][5.174:174](),[5.174][5.888:961](),[5.774][5.888:961](),[5.774][5.888:961]()
    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(fg)
    love.graphics.print(State.search_term, State.left+lo_px,y)
  • resurrect zombie in text.lua at line 37
    [5.49][5.4:38](),[5.49][5.4:38](),[5.38][4.4:586](),[5.38][4.4:586](),[5.38][4.4:586]()
    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
  • replacement in text.lua at line 46
    [5.854][3.4:157](),[5.854][3.4:157](),[3.157][5.6:6](),[5.3671][5.6:6](),[5.6][5.7:121]()
    elseif hide_cursor then
    Text.pretend_draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
    else
    Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y, Cursor_color, fg)
    [4.586]
    [5.530]
    end
    else
    if pos <= State.cursor1.pos and pos + frag_len > State.cursor1.pos then
    if hide_cursor then
    Text.pretend_draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
    else
    Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y, Cursor_color, fg)
    end
    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.
    if hide_cursor then
    Text.pretend_draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
    else
    Text.draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y, Cursor_color, fg)
    end
  • edit in text.lua at line 965
    [5.442][2.239:239](),[4.586][5.122:149](),[5.854][5.122:149](),[5.854][5.122:149](),[5.149][5.87:571](),[5.149][5.87:571]()
    end
    else
    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.
  • resolve order conflict in text.lua at line 965
    [5.442]