stop handling nil screen_line_starting_pos everywhere

[?]
Jun 10, 2022, 9:57 PM
CBPV5SSIJFGEZLGF7LMC35KZWUTZUFNAWTTVNYDMEEUK4EBOMOVQC

Dependencies

  • [2] VC2CU2GG faster paste
  • [3] KZ5GAYRP this fixes the immediate regression
  • [4] HYEAFRZ2 split mouse_pressed events between Text and Drawing
  • [5] JY4VK7L2 rename
  • [6] 3OKKTUT4 up and down arrow now moving by screen line where possible
  • [7] KECEMMMR extract couple of functions
  • [8] XNFTJHC4 split keyboard handling between Text and Drawing
  • [9] PYGMASTV disable some debug prints
  • [10] P66MRF3U bugfix: don't append metadata when it already exists
  • [11] KOYAJWE4 extract a couple more methods
  • [12] DLQMM265 scroll past first page
  • [13] SVJZZDC3 snapshot - no, that's all wrong
  • [14] 6E3HVYWF test and App helper for mouse clicks
  • [15] V5MJRFOZ bugfix: down arrow doesn't scroll up unnecessarily
  • [16] 5L7K4GBD clicking to the right of a wrapped line
  • [17] LERERVPH keep one screen line of overlap on pagedown
  • [18] PHQPLJUQ rename
  • [19] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [20] MDXGMZU2 disable all debug prints
  • [21] OYXDYPGS get rid of debug variables
  • [22] H22OAXWE couple of TODOs
  • [23] ZPUQSPQP extract a few methods
  • [24] AYE2VEGJ extract a couple of methods
  • [25] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [26] EGH7XDBK support non-text lines in Text.to2
  • [27] ESETRNLB bugfix: printing the first part of a line at the bottom made it seem non-wrapping
  • [28] LS55YKGW switch copy/paste to ctrl- hotkeys
  • [29] 5FW7YOFT highlight selection while dragging
  • [30] U52E2XZN fix a crash
  • [31] CVGE3SIG I feel confident now that page-down is working.
  • [32] T7IWZFL4 more precise scroll on paste
  • [33] HOSPP2AN crisp font rendering
  • [34] HIH47LNB drop unused arg
  • [35] PR4KIAZD first stab at equally hacky cursor down support
  • [36] AIRIP35Z cleaner
  • [37] BOFNXP5G clicking now moves the cursor even on long, wrapped lines
  • [38] NQWWTGXR switch undo/redo to ctrl- hotkeys
  • [*] BULPIBEG beginnings of a module for the text editor
  • [*] OTIBCAUJ love2d scaffold

Change contents

  • edit in text.lua at line 24
    [4.1895][4.1895:1901](),[4.1901][4.1:103]()
    end
    if line.screen_line_starting_pos == nil then
    Text.populate_screen_line_starting_pos(line_index)
  • edit in text.lua at line 25
    [4.109]
    [4.1]
    Text.populate_screen_line_starting_pos(line_index)
  • edit in text.lua at line 451
    [4.757][4.757:825](),[4.825][4.5308:5392](),[4.5308][4.5308:5392](),[4.527][4.751:779](),[4.726][4.751:779](),[4.831][4.751:779](),[4.5425][4.751:779](),[4.751][4.751:779]()
    if Lines[Cursor1.line].screen_line_starting_pos == nil then
    Cursor1.pos = Text.nearest_cursor_pos(Lines[Cursor1.line].data, Cursor_x)
    break
    end
  • replacement in text.lua at line 595
    [4.1383][4.6253:6315](),[4.6315][4.1444:1465](),[4.1444][4.1444:1465]()
    if Lines[Cursor1.line].screen_line_starting_pos == nil then
    return 1,1
    end
    [4.1383]
    [4.6316]
    Text.populate_screen_line_starting_pos(Cursor1.line)
  • replacement in text.lua at line 606
    [4.1711][4.6476:6538](),[4.6538][4.1772:1794](),[4.1772][4.1772:1794]()
    if Lines[Cursor1.line].screen_line_starting_pos == nil then
    return true
    end
    [4.1711]
    [4.1]
    Text.populate_screen_line_starting_pos(Cursor1.line)
  • replacement in text.lua at line 673
    [4.252][4.3723:3806]()
    if line.screen_line_starting_pos == nil then return y < line.y + Line_height end
    [4.252]
    [4.3806]
    Text.populate_screen_line_starting_pos(Cursor1.line)
  • edit in text.lua at line 679
    [4.1193][4.472:519](),[4.7453][4.472:519](),[4.180][4.472:519](),[4.519][4.1194:1244](),[4.1244][4.622:628](),[4.622][4.622:628]()
    if line.screen_line_starting_pos == nil then
    return Text.nearest_cursor_pos(line.data, mx)
    end
  • replacement in text.lua at line 799
    [4.7808][4.1529:1588](),[4.1588][3.171:231]()
    if Lines[pos1.line].screen_line_starting_pos == nil then
    Text.populate_screen_line_starting_pos(pos1.line)
    end
    [4.7808]
    [3.231]
    Text.populate_screen_line_starting_pos(pos1.line)
  • replacement in text.lua at line 853
    [4.1732][4.1732:1778](),[4.1778][3.469:527](),[3.527][4.1952:1960](),[4.1952][4.1952:1960]()
    if l.screen_line_starting_pos == nil then
    Text.populate_screen_line_starting_pos(pos2.line-1)
    end
    [4.1732]
    [3.528]
    Text.populate_screen_line_starting_pos(pos2.line-1)
  • edit in main.lua at line 444
    [2.205][2.205:264]()
    Text.populate_screen_line_starting_pos(Cursor1.line)