bugfix: crash in Text.up() after return

[?]
Jun 19, 2022, 4:03 PM
MP2TBKU6CNDMZKENYMBV62F5KQ27ZWEVPVRFS2RESVDQQT2IRR4AC

Dependencies

  • [2] HIKLULFQ extract a function
  • [3] UFIUYYYV additional logging for an active bug
  • [4] DGK5BPVI bugfix: UTF-8 in compute_fragments
  • [5] CPZGQT72 go through and fix similar issues
  • [6] NZKYPBSK check for scroll when just typing
  • [7] CG3264MM move
  • [8] ULKLJBN6 couple of renames
  • [9] Z4XRNDTR find text
  • [10] FHSZYAZ2 more precise search highlighting
  • [11] GN3IF4WF bugfix: pasting newlines
  • [12] PFT5Y2ZY move
  • [13] SLLR6KKI bugfix for non-ASCII
  • [14] XNFTJHC4 split keyboard handling between Text and Drawing
  • [15] JY4VK7L2 rename
  • [16] 2POFQQLW keep cursor on screen when pressing 'down'
  • [17] BYG5CEMV support for naming points
  • [18] QYIFOHW3 first test!
  • [19] 537TQ2QN some more logging
  • [20] IMEJA43L snapshot
  • [21] ZPUQSPQP extract a few methods
  • [22] KOYAJWE4 extract a couple more methods
  • [23] 5L7K4GBD clicking to the right of a wrapped line
  • [24] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [25] DHI6IJCN selecting text and deleting selections
  • [26] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [27] V5MJRFOZ bugfix: down arrow doesn't scroll up unnecessarily
  • [28] 2ZYV7D3W handle tab characters
  • [29] TKFSYQ2Z up arrow to search previous
  • [30] 7SFHSB47 rename
  • [31] VJ77YABH more efficient undo/redo
  • [32] HOSPP2AN crisp font rendering
  • [33] NP7PIUBT bugfix: restore state after C-f (find)
  • [34] CUIV2LE5 some typos
  • [35] YW5324Q3 bugfix: cut (C-x) without first selecting anything
  • [36] IRCKL6VN extract scrolling logic out of insert_at_cursor
  • [37] PR4KIAZD first stab at equally hacky cursor down support
  • [38] 73OCE2MC after much struggle, a brute-force undo
  • [39] OYXDYPGS get rid of debug variables
  • [40] SQLVYKVJ rename
  • [41] BOFNXP5G clicking now moves the cursor even on long, wrapped lines
  • [42] LXTTOB33 extract a couple of files
  • [43] O7QH4N4W speeding up copy, attempt 1
  • [44] AYE2VEGJ extract a couple of methods
  • [45] TVM2WIHH bugfix: autosave and undo in a couple of cases
  • [46] BTKAW76L rename
  • [47] KOTI3MFG bugfix in previous commit
  • [48] 4VKEE43Z bugfix
  • [*] BULPIBEG beginnings of a module for the text editor
  • [*] OTIBCAUJ love2d scaffold

Change contents

  • replacement in text.lua at line 116
    [4.910][4.910:1010]()
    local boffset = utf8.offset(frag, bpos+1) -- byte _after_ bpos
    assert(boffset)
    [4.910]
    [4.1010]
    local boffset = Text.offset(frag, bpos+1) -- byte _after_ bpos
  • replacement in text.lua at line 158
    [6.51][6.171:191](),[6.55][6.171:191](),[6.99][6.171:191](),[3.118][6.171:191](),[6.6357][6.171:191](),[6.171][6.171:191](),[6.191][6.459:485](),[6.485][6.56:125](),[6.125][6.285:292](),[6.556][6.285:292](),[6.285][6.285:292](),[6.292][6.126:146](),[6.146][6.312:318](),[6.312][6.312:318](),[6.318][3.119:248]()
    local byte_offset
    if Cursor1.pos > 1 then
    byte_offset = utf8.offset(Lines[Cursor1.line].data, Cursor1.pos)
    else
    byte_offset = 1
    end
    if byte_offset == nil then
    print(Cursor1.line, Cursor1.pos, byte_offset, Lines[Cursor1.line].data)
    assert(false)
    end
    [6.99]
    [6.147]
    local byte_offset = Text.offset(Lines[Cursor1.line].data, Cursor1.pos)
  • replacement in text.lua at line 167
    [6.627][6.8375:8394]()
    --? print(chord)
    [6.627]
    [6.1]
    --? print('chord')
  • replacement in text.lua at line 373
    [6.223][6.223:296](),[6.296][6.1167:1293]()
    local byte_offset = utf8.offset(Lines[Cursor1.line].data, Cursor1.pos)
    --? print(Cursor1.line, Cursor1.pos, #Lines[Cursor1.line].data)
    --? print(Lines[Cursor1.line].data)
    assert(byte_offset)
    [6.223]
    [6.296]
    local byte_offset = Text.offset(Lines[Cursor1.line].data, Cursor1.pos)
  • replacement in text.lua at line 455
    [6.1520][5.3:165]()
    local screen_line_starting_byte_offset = utf8.offset(Lines[Cursor1.line].data, screen_line_starting_pos)
    assert(screen_line_starting_byte_offset)
    [6.1520]
    [5.165]
    local screen_line_starting_byte_offset = Text.offset(Lines[Cursor1.line].data, screen_line_starting_pos)
  • replacement in text.lua at line 474
    [6.2441][5.255:421]()
    local new_screen_line_starting_byte_offset = utf8.offset(Lines[Cursor1.line].data, new_screen_line_starting_pos)
    assert(new_screen_line_starting_byte_offset)
    [6.2441]
    [5.421]
    local new_screen_line_starting_byte_offset = Text.offset(Lines[Cursor1.line].data, new_screen_line_starting_pos)
  • replacement in text.lua at line 513
    [6.4338][5.511:677]()
    local new_screen_line_starting_byte_offset = utf8.offset(Lines[Cursor1.line].data, new_screen_line_starting_pos)
    assert(new_screen_line_starting_byte_offset)
    [6.4338]
    [5.677]
    local new_screen_line_starting_byte_offset = Text.offset(Lines[Cursor1.line].data, new_screen_line_starting_pos)
  • replacement in text.lua at line 531
    [6.5061][6.5061:5131]()
    local offset = utf8.offset(Lines[Cursor1.line].data, Cursor1.pos)
    [6.5061]
    [6.5131]
    local offset = Text.offset(Lines[Cursor1.line].data, Cursor1.pos)
  • replacement in text.lua at line 543
    [6.5383][6.5383:5453]()
    local offset = utf8.offset(Lines[Cursor1.line].data, Cursor1.pos)
    [6.5383]
    [6.10688]
    local offset = Text.offset(Lines[Cursor1.line].data, Cursor1.pos)
  • replacement in text.lua at line 683
    [6.133][5.767:910]()
    local screen_line_starting_byte_offset = utf8.offset(line.data, screen_line_starting_pos)
    assert(screen_line_starting_byte_offset)
    [6.133]
    [5.910]
    local screen_line_starting_byte_offset = Text.offset(line.data, screen_line_starting_pos)
  • replacement in text.lua at line 788
    [6.360][6.360:414]()
    local offset = utf8.offset(s, pos)
    assert(offset)
    [6.360]
    [6.414]
    local offset = Text.offset(s, pos)
  • edit in text.lua at line 842
    [6.559]
    [6.559]
    end
    function Text.offset(s, pos1)
    if pos1 == 1 then return 1 end
    local result = utf8.offset(s, pos1)
    if result == nil then
    print(Cursor1.line, Cursor1.pos, #Lines[Cursor1.line].data, Lines[Cursor1.line].data)
    print(pos1, #s, s)
    end
    assert(result)
    return result
  • replacement in select.lua at line 58
    [2.242][2.242:391]()
    local lo_offset = utf8.offset(line.data, lo)
    local hi_offset = utf8.offset(line.data, hi)
    local pos_offset = utf8.offset(line.data, pos)
    [2.242]
    [2.391]
    local lo_offset = Text.offset(line.data, lo)
    local hi_offset = Text.offset(line.data, hi)
    local pos_offset = Text.offset(line.data, pos)
  • replacement in select.lua at line 140
    [6.47373][6.47373:47487]()
    local min_offset = utf8.offset(Lines[minl].data, minp)
    local max_offset = utf8.offset(Lines[maxl].data, maxp)
    [6.47373]
    [6.47487]
    local min_offset = Text.offset(Lines[minl].data, minp)
    local max_offset = Text.offset(Lines[maxl].data, maxp)
  • replacement in select.lua at line 168
    [6.48224][6.48224:48338]()
    local min_offset = utf8.offset(Lines[minl].data, minp)
    local max_offset = utf8.offset(Lines[maxl].data, maxp)
    [6.48224]
    [6.48338]
    local min_offset = Text.offset(Lines[minl].data, minp)
    local max_offset = Text.offset(Lines[maxl].data, maxp)
  • replacement in main.lua at line 425
    [6.3421][6.3421:3477]()
    local byte_offset = utf8.offset(Search_term, len)
    [6.3421]
    [6.3477]
    local byte_offset = Text.offset(Search_term, len)
  • replacement in main.lua at line 540
    [6.782][6.782:837]()
    local byte_offset = utf8.offset(p.name, len-1)
    [6.782]
    [6.837]
    local byte_offset = Text.offset(p.name, len-1)