stop creating a singleton table for every word

[?]
Apr 1, 2023, 11:43 PM
S2QMLRXLULVA6M73YVC5VQJ2SYUBHG2DTGXEMOBKEPR4OU7ZKG3AC

Dependencies

  • [2] ISOFHXB2 App.width can no longer take a Text
  • [3] H4R5BHVY no more Text allocations
  • [4] OYVFFWBK move
  • [5] XUGDTYW2 stop confusingly reading a global
  • [6] FBVUNLS4 clean up some debug prints
  • [7] 6WDBV52Z move a var closer to its use
  • [8] X3F7ECSL add state arg to some functions
  • [9] ILOA5BYF separate data structure for each line's cache data
  • [10] S2MISTTM add state arg to a few functions
  • [11] PFT5Y2ZY move
  • [12] OYXDYPGS get rid of debug variables
  • [13] UN7GKYV5 support hyperlinks in the source editor
  • [14] HIKLULFQ extract a function
  • [15] KURLAXXI clean up some prints
  • [16] UPCIYZEU drop an unnecessary level of indent
  • [17] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [18] DHI6IJCN selecting text and deleting selections
  • [19] HALS7E5U more clearly skip prints before screen top
  • [20] R3KXFRZN get rid of to_text
  • [21] LWPRYDLW set color for each fragment
  • [22] WLHI7KD3 new globals: draw partial screen line up top
  • [23] G54H3YG2 get rid of all bifold text
  • [24] KKMFQDR4 editing source code from within the app
  • [25] Z4XRNDTR find text
  • [26] FZBXBUFF bugfix: search
  • [27] CVGE3SIG I feel confident now that page-down is working.
  • [*] BULPIBEG beginnings of a module for the text editor

Change contents

  • replacement in text.lua at line 18
    [4.29][3.3:113]()
    local frag_len = utf8.len(f.data)
    --? print('text.draw:', f.data, 'at', line_index,pos, 'after', x,y)
    [4.29]
    [4.48]
    local frag_len = utf8.len(f)
    --? print('text.draw:', f, 'at', line_index,pos, 'after', x,y)
  • replacement in text.lua at line 22
    [4.95][3.114:150]()
    --? print('skipping', f.data)
    [4.95]
    [4.129]
    --? print('skipping', f)
  • replacement in text.lua at line 25
    [4.28][2.3:46]()
    local frag_width = App.width(f.data)
    [4.28]
    [4.138]
    local frag_width = App.width(f)
  • replacement in text.lua at line 39
    [4.1066][3.151:187]()
    App.screen.print(f.data, x,y)
    [4.1066]
    [4.259]
    App.screen.print(f, x,y)
  • replacement in text.lua at line 50
    [4.869][3.188:270]()
    Text.draw_cursor(State, x+Text.x(f.data, State.cursor1.pos-pos+1), y)
    [4.869]
    [4.530]
    Text.draw_cursor(State, x+Text.x(f, State.cursor1.pos-pos+1), y)
  • replacement in text.lua at line 91
    [4.594][2.47:88]()
    local frag_width = App.width(f.data)
    [4.594]
    [4.638]
    local frag_width = App.width(f)
  • replacement in text.lua at line 97
    [4.792][3.271:304]()
    pos = pos + utf8.len(f.data)
    [4.792]
    [4.853]
    pos = pos + utf8.len(f)
  • replacement in text.lua at line 123
    [4.982][3.305:362]()
    table.insert(line_cache.fragments, {data=frag1})
    [4.982]
    [4.1056]
    table.insert(line_cache.fragments, frag1)
  • replacement in text.lua at line 130
    [4.618][3.363:417]()
    table.insert(line_cache.fragments, {data=frag})
    [4.1407]
    [4.1549]
    table.insert(line_cache.fragments, frag)
  • replacement in source_text.lua at line 20
    [4.87502][3.422:557]()
    select_color(f.data)
    local frag_len = utf8.len(f.data)
    --? print('text.draw:', f.data, 'at', line_index,pos, 'after', x,y)
    [4.87502]
    [4.87674]
    select_color(f)
    local frag_len = utf8.len(f)
    --? print('text.draw:', f, 'at', line_index,pos, 'after', x,y)
  • replacement in source_text.lua at line 25
    [4.87725][3.558:594]()
    --? print('skipping', f.data)
    [4.87725]
    [4.87759]
    --? print('skipping', f)
  • replacement in source_text.lua at line 28
    [4.87793][2.310:353]()
    local frag_width = App.width(f.data)
    [4.87793]
    [4.87839]
    local frag_width = App.width(f)
  • replacement in source_text.lua at line 43
    [4.84][3.595:685]()
    local trimmed_word = rtrim(f.data) -- compute_fragments puts whitespace at the end
    [4.84]
    [4.172]
    local trimmed_word = rtrim(f) -- compute_fragments puts whitespace at the end
  • replacement in source_text.lua at line 55
    [4.779][3.686:722]()
    App.screen.print(f.data, x,y)
    [4.779]
    [4.88227]
    App.screen.print(f, x,y)
  • replacement in source_text.lua at line 66
    [4.88889][3.723:805]()
    Text.draw_cursor(State, x+Text.x(f.data, State.cursor1.pos-pos+1), y)
    [4.88889]
    [4.88969]
    Text.draw_cursor(State, x+Text.x(f, State.cursor1.pos-pos+1), y)
  • replacement in source_text.lua at line 107
    [4.91878][2.354:395]()
    local frag_width = App.width(f.data)
    [4.91878]
    [4.91922]
    local frag_width = App.width(f)
  • replacement in source_text.lua at line 113
    [4.92076][3.806:839]()
    pos = pos + utf8.len(f.data)
    [4.92076]
    [4.92137]
    pos = pos + utf8.len(f)
  • replacement in source_text.lua at line 139
    [4.93792][3.840:897]()
    table.insert(line_cache.fragments, {data=frag1})
    [4.93792]
    [4.93866]
    table.insert(line_cache.fragments, frag1)
  • replacement in source_text.lua at line 146
    [4.94166][3.898:952]()
    table.insert(line_cache.fragments, {data=frag})
    [4.94086]
    [4.94236]
    table.insert(line_cache.fragments, frag)