bugfix: printing the first part of a line at the bottom made it seem non-wrapping

[?]
May 22, 2022, 5:08 AM
ESETRNLB3MIJ2SID6HJMMP52FEVUBLGK2HLWD75KDQZAKQMKSF2QC

Dependencies

  • [2] PGZJ6NAT ensure Filename is writable when opened outside a terminal
  • [3] CVGE3SIG I feel confident now that page-down is working.
  • [4] AIRIP35Z cleaner
  • [5] PWHZPJJM always show current filename in window title
  • [6] WLHI7KD3 new globals: draw partial screen line up top
  • [7] 537TQ2QN some more logging
  • [8] BULPIBEG beginnings of a module for the text editor
  • [9] M36DBSDE bit more polish to help screen
  • [10] 2FBLO5FH adjust window size
  • [11] 2KRK3OBV don't rely on defaults
  • [12] 242L3OQX bugfix: ensure Cursor_line is always on a text line
  • [13] XNFTJHC4 split keyboard handling between Text and Drawing
  • [14] DLQMM265 scroll past first page
  • [15] TRNWIQN6 more precise height calculation when scrolling up as much as possible while keeping cursor on screen
  • [16] OTIBCAUJ love2d scaffold
  • [17] SVJZZDC3 snapshot - no, that's all wrong
  • [18] MGT5FTJ3 first stab at supporting wrapping in cursor up
  • [19] AVQ5MC5D finish uppercasing all globals
  • [20] KJKKASHZ reduce ambitions a bit: page up/down need not start screen from the middle of a line
  • [21] W4UVZETR 2 regressions:
  • [22] JY4VK7L2 rename
  • [23] PYGMASTV disable some debug prints
  • [24] DXT4QTAH a few more integer coordinates
  • [25] PR4KIAZD first stab at equally hacky cursor down support
  • [26] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [27] LUNH47XX make text and drawings the same width
  • [28] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [29] 2POFQQLW keep cursor on screen when pressing 'down'
  • [30] YKRF5V3Z starting to load/save
  • [*] BOFNXP5G clicking now moves the cursor even on long, wrapped lines
  • [*] UWNHC4AA redo y computations
  • [*] 7IKRRESB longer names for indices in long loops
  • [*] 4C375P53 this is a bit clearer
  • [*] 6LJZN727 handle chords

Change contents

  • replacement in text.lua at line 31
    [5.119][3.142:255]()
    if y + math.floor(15*Zoom) > Screen_height then
    return y, screen_line_starting_pos
    end
    [5.119]
    [3.255]
    if New_foo then print('text: new screen line', y, Screen_height, screen_line_starting_pos) end
  • edit in text.lua at line 40
    [32.169]
    [32.169]
    end
    if line_index > Screen_top1.line or pos > Screen_top1.pos then
    if y + math.floor(15*Zoom) >= Screen_height then
    return y, screen_line_starting_pos
    end
  • edit in text.lua at line 285
    [5.5222]
    [5.267]
    print('down', Cursor1.line, Cursor1.pos, Screen_top1.line, Screen_top1.pos, Screen_bottom1.line, Screen_bottom1.pos)
  • replacement in text.lua at line 288
    [5.360][5.733:798]()
    --? print('down: cursor at final screen line of its line')
    [5.360]
    [5.5223]
    print('cursor at final screen line of its line')
    --? os.exit(1)
  • replacement in text.lua at line 296
    [5.5392][5.5392:5425]()
    --? print(Cursor1.pos)
    [5.5392]
    [5.751]
    print(Cursor1.pos)
  • edit in text.lua at line 300
    [5.789][5.5426:5490]()
    --? print(Cursor1.line, Cursor1.pos, Screen_bottom1.line)
  • replacement in text.lua at line 301
    [5.5539][5.5539:5614]()
    --? print('screen top before:', Screen_top1.line, Screen_top1.pos)
    [5.5539]
    [5.5614]
    print('screen top before:', Screen_top1.line, Screen_top1.pos)
  • replacement in text.lua at line 303
    [5.5654][5.982:1031](),[5.874][5.982:1031]()
    --? print('scroll up preserving cursor')
    [5.5654]
    [5.874]
    print('scroll up preserving cursor')
  • replacement in text.lua at line 305
    [5.922][5.5655:5729]()
    --? print('screen top after:', Screen_top1.line, Screen_top1.pos)
    [5.922]
    [5.4899]
    print('screen top after:', Screen_top1.line, Screen_top1.pos)
  • edit in text.lua at line 307
    [5.4909][5.5730:5800]()
    --? print('=>', Cursor1.line, Cursor1.pos, Screen_bottom1.line)
  • replacement in text.lua at line 309
    [5.983][5.1187:1253]()
    --? print('cursor is NOT at final screen line of its line')
    [5.983]
    [5.1045]
    print('cursor is NOT at final screen line of its line')
  • replacement in text.lua at line 312
    [5.5904][5.1254:1402](),[5.1247][5.1254:1402]()
    --? print('switching pos of screen line at cursor from '..tostring(screen_line_starting_pos)..' to '..tostring(new_screen_line_starting_pos))
    [5.5904]
    [5.5905]
    print('switching pos of screen line at cursor from '..tostring(screen_line_starting_pos)..' to '..tostring(new_screen_line_starting_pos))
  • replacement in text.lua at line 315
    [5.6080][5.6080:6141]()
    --? print('cursor pos is now '..tostring(Cursor1.pos))
    [5.6080]
    [5.6141]
    print('cursor pos is now '..tostring(Cursor1.pos))
  • replacement in text.lua at line 317
    [5.6179][5.1464:1511](),[5.158][5.1464:1511]()
    --? print('scroll up preserving cursor')
    [5.6179]
    [5.1620]
    print('scroll up preserving cursor')
  • replacement in text.lua at line 319
    [5.1666][5.6180:6252]()
    --? print('screen top after:', Screen_top1.line, Screen_top1.pos)
    [5.1666]
    [5.1313]
    print('screen top after:', Screen_top1.line, Screen_top1.pos)
  • edit in text.lua at line 321
    [5.1321]
    [5.1321]
    print('=>', Cursor1.line, Cursor1.pos, Screen_top1.line, Screen_top1.pos, Screen_bottom1.line, Screen_bottom1.pos)
  • edit in text.lua at line 343
    [4.63]
    [4.63]
    print(screen_lines[#screen_lines], Cursor1.pos)
  • replacement in text.lua at line 366
    [5.589][5.190:266](),[5.266][5.6953:7075](),[5.1718][5.383:455](),[5.7075][5.383:455](),[5.383][5.383:455]()
    local cursor_pos_screen_lines = Text.pos_at_start_of_cursor_screen_line()
    --? print('cursor pos '..tostring(Cursor1.pos)..' is on the #'..tostring(cursor_pos_screen_lines)..' screen line down')
    local y = Screen_height - cursor_pos_screen_lines*math.floor(15*Zoom)
    [5.589]
    [5.455]
    local cursor2 = Text.to2(Cursor1)
    print('cursor pos '..tostring(Cursor1.pos)..' is on the #'..tostring(cursor2.screen_line)..' screen line down')
    local y = Screen_height - cursor2.screen_pos*math.floor(15*Zoom)
  • replacement in text.lua at line 372
    [5.7120][5.1719:1741](),[5.703][5.1719:1741]()
    --? print('y', y)
    [5.7120]
    [5.515]
    print('y', y)
  • replacement in text.lua at line 382
    [5.903][5.1742:1770]()
    --? print('height:', h)
    [5.903]
    [5.927]
    print('height:', h)
  • replacement in text.lua at line 490
    [5.7808][5.7808:7866]()
    if Line[pos1.line].screen_line_starting_pos == nil then
    [5.7808]
    [5.7866]
    if Lines[pos1.line].screen_line_starting_pos == nil then
  • edit in main.lua at line 66
    [2.63]
    [5.47]
    New_foo = true
  • replacement in main.lua at line 71
    [5.23][5.378:611]()
    love.window.setMode(0, 0) -- maximize
    Screen_width, Screen_height, Screen_flags = love.window.getMode()
    -- shrink slightly to account for window decoration
    Screen_width = Screen_width-100
    Screen_height = Screen_height-100
    [5.23]
    [5.611]
    --? love.window.setMode(0, 0) -- maximize
    --? Screen_width, Screen_height, Screen_flags = love.window.getMode()
    --? -- shrink slightly to account for window decoration
    --? Screen_width = Screen_width-100
    --? Screen_height = Screen_height-100
  • replacement in main.lua at line 77
    [5.638][5.638:689]()
    --? Screen_width = 120
    --? Screen_height = 200
    [5.638]
    [5.505]
    Screen_width = 120
    Screen_height = 200
  • replacement in main.lua at line 81
    [5.43][5.690:761]()
    --? Line_width = 100
    Line_width = math.floor(Screen_width/2/40)*40
    [5.43]
    [5.2]
    Line_width = 100
    --? Line_width = math.floor(Screen_width/2/40)*40
  • edit in main.lua at line 121
    [33.18]
    [34.2]
    if New_foo then print('== draw') end
  • edit in main.lua at line 123
    [34.44]
    [5.161]
    if New_foo then print('draw:', line_index, y) end
  • edit in main.lua at line 147
    [5.1510]
    [33.194]
    if New_foo then print('text') end
  • edit in main.lua at line 151
    [35.108]
    [5.1574]
    if New_foo then print('aa', y) end
  • edit in main.lua at line 155
    [5.416]
    [3.408]
    New_foo = false
  • edit in main.lua at line 196
    [36.123]
    [5.4920]
    New_foo = true