edit in text_tests.lua at line 78
[15.2689]→[15.2689:2724](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 257
[15.7365]→[15.7365:7400](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 275
[15.399]→[15.399:434](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 294
[15.654]→[15.654:689](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 312
[15.7905]→[15.7905:7940](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 330
[15.584]→[15.584:619](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 347
[15.8346]→[15.8346:8381](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 363
[15.8720]→[15.8720:8755](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 379
[15.9093]→[15.9093:9128](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 396
[15.1649]→[15.1649:1684](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 414
[15.2721]→[15.2721:2756](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 431
[15.9468]→[15.9468:9503](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 448
[15.9882]→[15.9882:9917](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 466
[15.10251]→[15.10251:10286](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 488
[15.10796]→[15.10796:10831](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 508
[15.11383]→[15.11383:11418](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 531
[15.11969]→[15.11969:12004](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 555
[15.12559]→[15.12559:12594](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 573
[15.12983]→[15.12983:13018](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 595
[15.13593]→[15.13593:13628](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 612
[15.14098]→[15.14098:14133](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 628
[15.14473]→[15.14473:14508](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 649
[15.14960]→[15.14960:14995](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 666
[15.15334]→[15.15334:15369](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 683
[15.15701]→[15.15701:15736](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 701
[15.16058]→[15.16058:16093](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 724
[15.16656]→[15.16656:16691](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 742
[15.17099]→[15.17099:17134](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 770
[15.17865]→[15.17865:17900](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 786
[15.18583]→[15.18583:18618](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 814
[15.20131]→[15.20131:20166](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 833
[15.431]→[15.431:466](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 850
[15.390]→[15.390:425](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 872
[15.685]→[15.685:720](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 892
[15.21059]→[15.21059:21094](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 916
[15.22201]→[15.22201:22236](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 945
[15.322]→[15.322:357](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 966
[15.23657]→[15.23657:23692](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 981
[15.24028]→[15.24028:24063](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1010
[15.24767]→[15.24767:24802](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1023
[15.7987]→[15.8517:8522](∅→∅),
[15.8517]→[15.8517:8522](∅→∅),
[15.8522]→[15.2:62](∅→∅),
[15.127]→[15.127:183](∅→∅),
[15.183]→[15.8691:8730](∅→∅),
[15.8691]→[15.8691:8730](∅→∅),
[15.8730]→[15.2399:2445](∅→∅),
[15.2445]→[15.25155:25218](∅→∅),
[15.7869]→[15.25155:25218](∅→∅),
[15.8730]→[15.25155:25218](∅→∅),
[15.25218]→[15.2552:2584](∅→∅),
[15.2584]→[15.25304:25425](∅→∅),
[15.25304]→[15.25304:25425](∅→∅),
[15.25425]→[15.1563:1589](∅→∅),
[15.1589]→[15.7870:7899](∅→∅),
[15.7899]→[15.7988:8038](∅→∅),
[15.8038]→[15.25463:25498](∅→∅),
[15.287]→[15.25463:25498](∅→∅),
[15.25498]→[15.8039:8090](∅→∅),
[15.8090]→[15.25499:25534](∅→∅),
[15.392]→[15.25499:25534](∅→∅),
[15.25534]→[15.8091:8142](∅→∅),
[15.8142]→[15.497:581](∅→∅),
[15.497]→[15.497:581](∅→∅),
[15.581]→[12.1837:1901](∅→∅),
[12.1901]→[15.8143:8379](∅→∅),
[15.3864]→[15.8143:8379](∅→∅),
[15.8379]→[15.7900:7923](∅→∅),
[15.25983]→[15.7900:7923](∅→∅),
[15.7923]→[15.8380:8422](∅→∅),
[15.8422]→[15.26014:26049](∅→∅),
[15.1074]→[15.26014:26049](∅→∅),
[15.26049]→[15.8423:8465](∅→∅),
[15.8465]→[15.26050:26085](∅→∅),
[15.1170]→[15.26050:26085](∅→∅),
[15.26085]→[15.8466:8507](∅→∅) − end
−
− function test_pagedown_often_shows_start_of_wrapping_line()
− -- draw a few lines ending in part of a wrapping line
− App.screen.init{width=50, height=60}
− Editor_state = edit.initialize_test_state()
− Editor_state.lines = load_array{'abc', 'def ghi jkl', 'mno'}
− Text.redraw_all(Editor_state)
− Editor_state.cursor1 = {line=1, pos=1}
− Editor_state.screen_top1 = {line=1, pos=1}
− Editor_state.screen_bottom1 = {}
− edit.draw(Editor_state)
− local y = Editor_state.top
− App.screen.check(y, 'abc', 'baseline/screen:1')
− y = y + Editor_state.line_height
− App.screen.check(y, 'def ', 'baseline/screen:2')
− y = y + Editor_state.line_height
− App.screen.check(y, 'ghi ', 'baseline/screen:3')
− -- after pagedown we start drawing from the bottom _line_ (multiple screen lines)
− edit.run_after_keychord(Editor_state, 'pagedown', 'pagedown')
− check_eq(Editor_state.screen_top1.line, 2, 'screen_top:line')
− check_eq(Editor_state.screen_top1.pos, 1, 'screen_top:pos')
− check_eq(Editor_state.cursor1.line, 2, 'cursor:line')
− check_eq(Editor_state.cursor1.pos, 1, 'cursor:pos')
− y = Editor_state.top
− App.screen.check(y, 'def ', 'screen:1')
− y = y + Editor_state.line_height
− App.screen.check(y, 'ghi ', 'screen:2')
− y = y + Editor_state.line_height
− App.screen.check(y, 'jkl', 'screen:3')
edit in text_tests.lua at line 1033
[15.26414]→[15.26414:26449](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1067
[15.408]→[15.408:443](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1081
[15.27146]→[15.27146:27181](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1113
[15.535]→[15.535:570](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1134
[15.27805]→[15.27805:27840](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1161
[15.28555]→[15.28555:28590](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1189
[15.29429]→[15.29429:29464](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1216
[15.30387]→[15.30387:30422](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1249
[15.31646]→[15.31646:31681](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1280
[15.1630]→[15.1630:1665](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1301
[15.32301]→[15.32301:32336](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1328
[15.423]→[15.423:458](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1349
[15.33043]→[15.33043:33078](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1376
[15.33977]→[15.33977:34012](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1405
[15.34891]→[15.34891:34926](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1431
[15.35562]→[15.35562:35597](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1455
[15.36182]→[15.36182:36217](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1483
[15.37115]→[15.37115:37150](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1509
[15.37947]→[15.37947:37982](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1537
[15.38791]→[15.38791:38826](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1559
[15.39591]→[15.39591:39626](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1577
[15.40368]→[15.40368:40403](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1606
[15.41178]→[15.41178:41213](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1634
[15.42109]→[15.42109:42144](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1663
[15.42979]→[15.42979:43014](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1691
[15.43886]→[15.43886:43921](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1721
[15.44713]→[15.44713:44748](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1754
[15.45576]→[15.45576:45611](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1781
[15.46302]→[15.46302:46337](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1915
[15.51142]→[15.51142:51177](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1949
[15.52318]→[15.52318:52353](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 1987
[15.53705]→[15.53705:53740](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 2007
[15.320]→[15.320:355](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 2033
[15.318]→[15.318:353](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 2050
[15.309]→[15.309:344](∅→∅) − Editor_state.screen_bottom1 = {}
edit in text_tests.lua at line 2067
[15.329]→[15.329:364](∅→∅) − Editor_state.screen_bottom1 = {}
replacement in text.lua at line 5
− -- return y for the next line, and position of start of final screen line drawn
+ -- return y for the next line
edit in text.lua at line 13
[15.1768]→[15.85:161](∅→∅) − local final_screen_line_starting_pos = startpos -- track value to return
edit in text.lua at line 20
[15.138]→[15.320:363](∅→∅) − final_screen_line_starting_pos = pos
replacement in text.lua at line 60
− return y, final_screen_line_starting_pos
replacement in text.lua at line 135
[15.1073]→[15.84:235](∅→∅),
[15.84]→[15.84:235](∅→∅) − --? print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
replacement in text.lua at line 168
[15.1369]→[15.498:651](∅→∅),
[15.498]→[15.498:651](∅→∅) − --? print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
replacement in text.lua at line 173
[15.321]→[15.953:1114](∅→∅),
[15.15513]→[15.953:1114](∅→∅),
[15.953]→[15.953:1114](∅→∅) − --? print('=>', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print('=>', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
replacement in text.lua at line 354
[15.434]→[15.3:25](∅→∅),
[15.1145]→[15.3:25](∅→∅),
[15.2605]→[15.3:25](∅→∅),
[15.74]→[15.3:25](∅→∅) + State.screen_top1 = Text.previous_screen_top1(State)
+ State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
+ Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State)
+ Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
+ end
+
+ function Text.previous_screen_top1(State)
replacement in text.lua at line 362
[15.115]→[15.435:485](∅→∅),
[15.139]→[15.152:183](∅→∅),
[15.485]→[15.152:183](∅→∅),
[15.749]→[15.152:183](∅→∅),
[15.2662]→[15.152:183](∅→∅),
[15.66327]→[15.152:183](∅→∅),
[15.152]→[15.152:183](∅→∅) − local top2 = Text.to2(State, State.screen_top1)
− --? print(App.screen.height)
+ -- does not modify State (except to populate line_cache)
+ local loc2 = Text.to2(State, State.screen_top1)
replacement in text.lua at line 366
[15.2746]→[15.26:89](∅→∅),
[15.16711]→[15.26:89](∅→∅),
[15.66425]→[15.26:89](∅→∅),
[15.1366]→[15.26:89](∅→∅),
[15.89]→[15.2747:2891](∅→∅) − --? print(y, top2.line, top2.screen_line, top2.screen_pos)
− if State.screen_top1.line == 1 and State.screen_top1.pos == 1 then break end
− if State.lines[State.screen_top1.line].mode == 'text' then
+ if loc2.line == 1 and loc2.screen_line == 1 and loc2.screen_pos == 1 then break end
+ if State.lines[loc2.line].mode == 'text' then
replacement in text.lua at line 369
[15.2923]→[15.2923:2993](∅→∅),
[15.2993]→[15.82:188](∅→∅) − elseif State.lines[State.screen_top1.line].mode == 'drawing' then
− y = y - Drawing_padding_height - Drawing.pixels(State.lines[State.screen_top1.line].h, State.width)
+ elseif State.lines[loc2.line].mode == 'drawing' then
+ y = y - Drawing_padding_height - Drawing.pixels(State.lines[loc2.line].h, State.width)
replacement in text.lua at line 372
[15.563]→[15.486:536](∅→∅) − top2 = Text.previous_screen_line(State, top2)
+ loc2 = Text.previous_screen_line(State, loc2)
replacement in text.lua at line 374
[15.83]→[15.814:858](∅→∅),
[15.858]→[15.175:250](∅→∅),
[15.250]→[15.537:621](∅→∅),
[15.3220]→[15.537:621](∅→∅),
[15.621]→[15.3221:3319](∅→∅),
[15.956]→[15.3221:3319](∅→∅),
[15.93]→[15.3221:3319](∅→∅),
[15.3319]→[15.90:116](∅→∅),
[15.67131]→[15.90:116](∅→∅),
[15.857]→[15.90:116](∅→∅) − State.screen_top1 = Text.to1(State, top2)
− State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
− Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State)
− --? print(State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos)
− --? print('pageup end')
+ return Text.to1(State, loc2)
replacement in text.lua at line 378
[15.652]→[15.117:141](∅→∅),
[15.1182]→[15.117:141](∅→∅),
[15.3363]→[15.117:141](∅→∅),
[15.883]→[15.117:141](∅→∅),
[15.65]→[15.2828:2991](∅→∅),
[15.141]→[15.2828:2991](∅→∅),
[15.883]→[15.2828:2991](∅→∅),
[15.2991]→[3.3:143](∅→∅),
[3.143]→[15.3118:3124](∅→∅),
[15.3118]→[15.3118:3124](∅→∅),
[15.3124]→[3.144:185](∅→∅),
[3.185]→[15.3424:3505](∅→∅),
[15.1065]→[15.3424:3505](∅→∅),
[15.3158]→[15.3424:3505](∅→∅),
[15.3505]→[15.3227:3234](∅→∅),
[15.67294]→[15.3227:3234](∅→∅),
[15.3227]→[15.3227:3234](∅→∅),
[15.3234]→[15.251:338](∅→∅),
[15.338]→[15.3318:3324](∅→∅),
[15.3614]→[15.3318:3324](∅→∅),
[15.67431]→[15.3318:3324](∅→∅),
[15.3318]→[15.3318:3324](∅→∅),
[15.3324]→[15.3615:3692](∅→∅) − --? print('pagedown')
− -- If a line/paragraph gets to a page boundary, I often want to scroll
− -- before I get to the bottom.
− -- However, only do this if it makes forward progress.
− local bot2 = Text.to2(State, State.screen_bottom1)
− if bot2.screen_line > 1 then
− bot2.screen_line = math.max(bot2.screen_line-10, 1)
− end
− local new_top1 = Text.to1(State, bot2)
− if Text.lt1(State.screen_top1, new_top1) then
− State.screen_top1 = new_top1
− else
− State.screen_top1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos}
− end
− --? print('setting top to', State.screen_top1.line, State.screen_top1.pos)
+ State.screen_top1 = Text.screen_bottom1(State)
edit in text.lua at line 381
[15.791]→[15.3783:3830](∅→∅),
[15.1163]→[15.3783:3830](∅→∅),
[15.184]→[15.3783:3830](∅→∅) − --? print('top now', State.screen_top1.line)
replacement in text.lua at line 382
[15.1257]→[15.142:170](∅→∅),
[15.184]→[15.142:170](∅→∅) − --? print('pagedown end')
+ end
+
+ -- return the location of the start of the bottom-most line on screen
+ function Text.screen_bottom1(State)
+ -- duplicate some logic from love.draw
+ -- does not modify State (except to populate line_cache)
+ local loc2 = Text.to2(State, State.screen_top1)
+ local y = State.top
+ while true do
+ if State.lines[loc2.line].mode == 'text' then
+ y = y + State.line_height
+ elseif State.lines[loc2.line].mode == 'drawing' then
+ y = y + Drawing_padding_height + Drawing.pixels(State.lines[loc2.line].h, State.width)
+ end
+ if y + State.line_height > App.screen.height then break end
+ local next_loc2 = Text.next_screen_line(State, loc2)
+ if Text.eq2(next_loc2, loc2) then break end
+ loc2 = next_loc2
+ end
+ return Text.to1(State, loc2)
replacement in text.lua at line 449
[11.1152]→[15.5973:6132](∅→∅),
[15.5973]→[15.5973:6132](∅→∅) − --? print('down', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print('down', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos)
replacement in text.lua at line 466
[15.1321]→[15.6478:6537](∅→∅) − if State.cursor1.line > State.screen_bottom1.line then
+ local screen_bottom1 = Text.screen_bottom1(State)
+ --? print('down 2', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos, screen_bottom1.line, screen_bottom1.pos)
+ if State.cursor1.line > screen_bottom1.line then
replacement in text.lua at line 476
− local scroll_down = Text.le1(State.screen_bottom1, State.cursor1)
+ local screen_bottom1 = Text.screen_bottom1(State)
+ local scroll_down = Text.le1(screen_bottom1, State.cursor1)
replacement in text.lua at line 493
[15.4810]→[15.7379:7536](∅→∅) − --? print('=>', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print('=>', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos)
replacement in text.lua at line 645
[13.137]→[13.137:201](∅→∅) − if State.lines[State.screen_bottom1.line].mode == 'text' then
+ local screen_bottom1 = Text.screen_bottom1(State)
+ if State.lines[screen_bottom1.line].mode == 'text' then
replacement in text.lua at line 648
[13.214]→[13.214:323](∅→∅) − line=State.screen_bottom1.line,
− pos=Text.pos_at_end_of_screen_line(State, State.screen_bottom1),
+ line=screen_bottom1.line,
+ pos=Text.pos_at_end_of_screen_line(State, screen_bottom1),
replacement in text.lua at line 652
[13.335]→[13.335:388](∅→∅) − local loc2 = Text.to2(State, State.screen_bottom1)
+ local loc2 = Text.to2(State, screen_bottom1)
replacement in text.lua at line 703
− --? print('snap', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print('snap', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
replacement in text.lua at line 733
[15.3781]→[15.1263:1425](∅→∅) − --? print('snap =>', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print('snap =>', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
edit in text.lua at line 938
+ function Text.eq2(a, b)
+ return a.line == b.line and a.screen_line == b.screen_line and a.screen_pos == b.screen_pos
+ end
+
edit in text.lua at line 962
+ end
+ end
+
+ function Text.next_screen_line(State, loc2)
+ if State.lines[loc2.line].mode == 'drawing' then
+ return {line=loc2.line+1, screen_line=1, screen_pos=1}
+ end
+ Text.populate_screen_line_starting_pos(State, loc2.line)
+ if loc2.screen_line >= #State.line_cache[loc2.line].screen_line_starting_pos then
+ if loc2.line < #State.lines then
+ return {line=loc2.line+1, screen_line=1, screen_pos=1}
+ else
+ return loc2
+ end
+ else
+ return {line=loc2.line, screen_line=loc2.screen_line+1, screen_pos=1}
edit in text.lua at line 1004
+ local screen_bottom1 = Text.screen_bottom1(State)
replacement in text.lua at line 1007
[15.5538]→[15.5538:5600](∅→∅),
[15.5600]→[15.870:895](∅→∅),
[15.78211]→[15.870:895](∅→∅),
[15.870]→[15.870:895](∅→∅) − elseif State.cursor1.line >= State.screen_bottom1.line then
− --? print('too low')
+ elseif State.cursor1.line >= screen_bottom1.line then
replacement in text.lua at line 1009
[15.136]→[15.956:981](∅→∅),
[15.180]→[15.956:981](∅→∅),
[15.864]→[15.956:981](∅→∅),
[15.5651]→[15.956:981](∅→∅),
[15.956]→[15.956:981](∅→∅),
[15.5710]→[15.5710:5776](∅→∅),
[15.5776]→[15.3494:3599](∅→∅),
[15.155]→[15.139:147](∅→∅),
[15.209]→[15.139:147](∅→∅),
[15.3599]→[15.139:147](∅→∅),
[15.3873]→[15.139:147](∅→∅),
[15.5878]→[15.139:147](∅→∅),
[15.139]→[15.139:147](∅→∅) − --? print('tweak')
− State.cursor1 = {
− line=State.screen_bottom1.line,
− pos=Text.to_pos_on_line(State, State.screen_bottom1.line, State.right-5, App.screen.height-5),
− }
+ State.cursor1 = Text.final_text_loc_on_screen(State)
edit in text.lua at line 1018
[15.255]→[15.300:419](∅→∅),
[15.978]→[15.300:419](∅→∅),
[15.78444]→[15.300:419](∅→∅),
[15.300]→[15.300:419](∅→∅),
[15.419]→[15.600:676](∅→∅),
[15.363]→[15.1062:1177](∅→∅),
[15.676]→[15.1062:1177](∅→∅),
[15.3944]→[15.1062:1177](∅→∅),
[15.1062]→[15.1062:1177](∅→∅) − -- this approach is cheaper and almost works, except on the final screen
− -- where file ends above bottom of screen
− --? local botpos = Text.pos_at_start_of_screen_line(State, State.cursor1)
− --? local botline1 = {line=State.cursor1.line, pos=botpos}
− --? return Text.lt1(State.screen_bottom1, botline1)
edit in source_text_tests.lua at line 78
[15.5731]→[15.5731:5766](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 257
[15.13611]→[15.13611:13646](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 275
[15.14289]→[15.14289:14324](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 294
[15.15194]→[15.15194:15229](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 312
[15.16004]→[15.16004:16039](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 330
[15.1568]→[15.1568:1603](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 347
[15.16610]→[15.16610:16645](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 363
[15.17290]→[15.17290:17325](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 379
[15.18005]→[15.18005:18040](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 396
[15.18818]→[15.18818:18853](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 414
[15.19754]→[15.19754:19789](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 431
[15.20627]→[15.20627:20662](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 448
[15.21499]→[15.21499:21534](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 466
[15.22355]→[15.22355:22390](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 488
[15.23540]→[15.23540:23575](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 508
[15.24634]→[15.24634:24669](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 531
[15.25923]→[15.25923:25958](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 555
[15.27362]→[15.27362:27397](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 573
[15.1072]→[15.1072:1107](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 595
[15.2158]→[15.2158:2193](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 612
[15.2984]→[15.2984:3019](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 628
[15.3703]→[15.3703:3738](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 649
[15.4686]→[15.4686:4721](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 666
[15.5422]→[15.5422:5457](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 683
[15.6132]→[15.6132:6167](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 701
[15.6896]→[15.6896:6931](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 724
[15.28188]→[15.28188:28223](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 742
[15.28979]→[15.28979:29014](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 770
[15.30368]→[15.30368:30403](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 786
[15.31273]→[15.31273:31308](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 814
[15.8370]→[15.8370:8405](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 833
[15.443]→[15.443:478](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 850
[15.1297]→[15.1297:1332](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 872
[15.2356]→[15.2356:2391](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 892
[15.9538]→[15.9538:9573](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 916
[15.11039]→[15.11039:11074](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 945
[15.3260]→[15.3260:3295](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 966
[15.12935]→[15.12935:12970](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 981
[15.33452]→[15.33452:33487](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1010
[15.4339]→[15.4339:4374](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1033
[15.34711]→[15.34711:34746](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1067
[15.36391]→[15.36391:36426](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1081
[15.37082]→[15.37082:37117](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1113
[15.2792]→[15.2792:2827](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1134
[15.38627]→[15.38627:38662](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1161
[15.40226]→[15.40226:40261](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1189
[15.42096]→[15.42096:42131](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1216
[15.44076]→[15.44076:44111](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1249
[15.46483]→[15.46483:46518](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1280
[15.3887]→[15.3887:3922](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1301
[15.47931]→[15.47931:47966](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1328
[15.1979]→[15.1979:2014](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1349
[15.49476]→[15.49476:49511](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1376
[15.51160]→[15.51160:51195](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1405
[15.53016]→[15.53016:53051](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1431
[15.54361]→[15.54361:54396](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1455
[15.55543]→[15.55543:55578](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1483
[15.57279]→[15.57279:57314](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1509
[15.58905]→[15.58905:58940](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1537
[15.60582]→[15.60582:60617](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1559
[15.62060]→[15.62060:62095](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1577
[15.63241]→[15.63241:63276](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1606
[15.64967]→[15.64967:65002](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1634
[15.66697]→[15.66697:66732](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1663
[15.68507]→[15.68507:68542](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1691
[15.70157]→[15.70157:70192](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1721
[15.71928]→[15.71928:71963](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1754
[15.74041]→[15.74041:74076](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1781
[15.75523]→[15.75523:75558](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1915
[15.77613]→[15.77613:77648](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1949
[15.79101]→[15.79101:79136](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 1987
[15.20140]→[15.20140:20175](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 2007
[15.80608]→[15.80608:80643](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 2033
[15.81780]→[15.81780:81815](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 2050
[15.82514]→[15.82514:82549](∅→∅) − Editor_state.screen_bottom1 = {}
edit in source_text_tests.lua at line 2067
[15.83248]→[15.83248:83283](∅→∅) − Editor_state.screen_bottom1 = {}
replacement in source_text.lua at line 5
[15.83964]→[15.48:128](∅→∅) − -- return y for the next line, and position of start of final screen line drawn
+ -- return y for the next line
edit in source_text.lua at line 12
[15.165]→[15.129:205](∅→∅) − local final_screen_line_starting_pos = startpos -- track value to return
edit in source_text.lua at line 26
[15.87768]→[15.413:456](∅→∅) − final_screen_line_starting_pos = pos
replacement in source_text.lua at line 85
[15.89103]→[15.1942:1985](∅→∅) − return y, final_screen_line_starting_pos
replacement in source_text.lua at line 209
[15.97303]→[15.97303:97454](∅→∅) − --? print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
replacement in source_text.lua at line 242
[15.99353]→[15.99353:99506](∅→∅) − --? print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
replacement in source_text.lua at line 247
[15.99759]→[15.99759:99920](∅→∅) − --? print('=>', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print('=>', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
replacement in source_text.lua at line 428
[15.107499]→[15.107499:107521](∅→∅) + State.screen_top1 = Text.previous_screen_top1(State)
+ State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
+ Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State)
+ Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
+ end
+
+ function Text.previous_screen_top1(State)
replacement in source_text.lua at line 436
[15.107562]→[15.107562:107643](∅→∅) − local top2 = Text.to2(State, State.screen_top1)
− --? print(App.screen.height)
+ -- does not modify State (except to populate line_cache)
+ local loc2 = Text.to2(State, State.screen_top1)
replacement in source_text.lua at line 440
[15.107719]→[15.107719:107782](∅→∅),
[15.107782]→[15.2339:2420](∅→∅),
[15.2420]→[15.6490:6553](∅→∅),
[15.107889]→[15.6490:6553](∅→∅) − --? print(y, top2.line, top2.screen_line, top2.screen_pos)
− if State.screen_top1.line == 1 and State.screen_top1.pos == 1 then break end
− if State.lines[State.screen_top1.line].mode == 'text' then
+ if loc2.line == 1 and loc2.screen_line == 1 and loc2.screen_pos == 1 then break end
+ if State.lines[loc2.line].mode == 'text' then
replacement in source_text.lua at line 443
[15.6585]→[15.6585:6761](∅→∅) − elseif State.lines[State.screen_top1.line].mode == 'drawing' then
− y = y - Drawing_padding_height - Drawing.pixels(State.lines[State.screen_top1.line].h, State.width)
+ elseif State.lines[loc2.line].mode == 'drawing' then
+ y = y - Drawing_padding_height - Drawing.pixels(State.lines[loc2.line].h, State.width)
replacement in source_text.lua at line 446
[15.6769]→[15.107919:107969](∅→∅),
[15.107919]→[15.107919:107969](∅→∅) − top2 = Text.previous_screen_line(State, top2)
+ loc2 = Text.previous_screen_line(State, loc2)
replacement in source_text.lua at line 448
[15.107975]→[15.107975:108019](∅→∅),
[15.108019]→[15.2421:2496](∅→∅),
[15.2496]→[15.108123:108331](∅→∅),
[15.108123]→[15.108123:108331](∅→∅) − State.screen_top1 = Text.to1(State, top2)
− State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
− Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State)
− --? print(State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos)
− --? print('pageup end')
+ return Text.to1(State, loc2)
replacement in source_text.lua at line 452
[15.108366]→[15.108366:108390](∅→∅),
[15.108390]→[7.75:160](∅→∅),
[7.160]→[15.108665:108742](∅→∅),
[15.108665]→[15.108665:108742](∅→∅) − --? print('pagedown')
− State.screen_top1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos}
− --? print('setting top to', State.screen_top1.line, State.screen_top1.pos)
+ State.screen_top1 = Text.screen_bottom1(State)
edit in source_text.lua at line 455
[15.108930]→[15.108930:108977](∅→∅) − --? print('top now', State.screen_top1.line)
replacement in source_text.lua at line 456
[15.109070]→[15.109070:109098](∅→∅) − --? print('pagedown end')
+ end
+
+ -- return the location of the start of the bottom-most line on screen
+ function Text.screen_bottom1(State)
+ -- duplicate some logic from love.draw
+ -- does not modify State (except to populate line_cache)
+ local loc2 = Text.to2(State, State.screen_top1)
+ local y = State.top
+ while true do
+ if State.lines[loc2.line].mode == 'text' then
+ y = y + State.line_height
+ elseif State.lines[loc2.line].mode == 'drawing' then
+ y = y + Drawing_padding_height + Drawing.pixels(State.lines[loc2.line].h, State.width)
+ end
+ if y + State.line_height > App.screen.height then break end
+ local next_loc2 = Text.next_screen_line(State, loc2)
+ if Text.eq2(next_loc2, loc2) then break end
+ loc2 = next_loc2
+ end
+ return Text.to1(State, loc2)
replacement in source_text.lua at line 523
[11.3470]→[15.114836:114995](∅→∅),
[15.8977]→[15.114836:114995](∅→∅),
[15.114836]→[15.114836:114995](∅→∅) − --? print('down', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print('down', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos)
replacement in source_text.lua at line 540
[15.115410]→[15.115410:115469](∅→∅) − if State.cursor1.line > State.screen_bottom1.line then
+ local screen_bottom1 = Text.screen_bottom1(State)
+ --? print('down 2', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos, screen_bottom1.line, screen_bottom1.pos)
+ if State.cursor1.line > screen_bottom1.line then
replacement in source_text.lua at line 550
[15.2975]→[15.115833:115903](∅→∅),
[15.115833]→[15.115833:115903](∅→∅) − local scroll_down = Text.le1(State.screen_bottom1, State.cursor1)
+ local screen_bottom1 = Text.screen_bottom1(State)
+ local scroll_down = Text.le1(screen_bottom1, State.cursor1)
replacement in source_text.lua at line 567
[15.118181]→[15.118181:118338](∅→∅) − --? print('=>', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print('=>', State.cursor1.line, State.cursor1.pos, State.screen_top1.line, State.screen_top1.pos)
replacement in source_text.lua at line 719
[14.145]→[14.145:209](∅→∅) − if State.lines[State.screen_bottom1.line].mode == 'text' then
+ local screen_bottom1 = Text.screen_bottom1(State)
+ if State.lines[screen_bottom1.line].mode == 'text' then
replacement in source_text.lua at line 722
[14.222]→[14.222:331](∅→∅) − line=State.screen_bottom1.line,
− pos=Text.pos_at_end_of_screen_line(State, State.screen_bottom1),
+ line=screen_bottom1.line,
+ pos=Text.pos_at_end_of_screen_line(State, screen_bottom1),
replacement in source_text.lua at line 726
[14.343]→[14.343:396](∅→∅) − local loc2 = Text.to2(State, State.screen_bottom1)
+ local loc2 = Text.to2(State, screen_bottom1)
replacement in source_text.lua at line 777
[15.3661]→[4.167:326](∅→∅) − --? print('snap', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print('snap', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
replacement in source_text.lua at line 807
[15.128343]→[15.3918:4080](∅→∅) − --? print('snap =>', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
+ --? print('snap =>', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
edit in source_text.lua at line 1012
+ function Text.eq2(a, b)
+ return a.line == b.line and a.screen_line == b.screen_line and a.screen_pos == b.screen_pos
+ end
+
edit in source_text.lua at line 1036
+ end
+ end
+
+ function Text.next_screen_line(State, loc2)
+ if State.lines[loc2.line].mode == 'drawing' then
+ return {line=loc2.line+1, screen_line=1, screen_pos=1}
+ end
+ Text.populate_screen_line_starting_pos(State, loc2.line)
+ if loc2.screen_line >= #State.line_cache[loc2.line].screen_line_starting_pos then
+ if loc2.line < #State.lines then
+ return {line=loc2.line+1, screen_line=1, screen_pos=1}
+ else
+ return loc2
+ end
+ else
+ return {line=loc2.line, screen_line=loc2.screen_line+1, screen_pos=1}
edit in source_text.lua at line 1078
+ local screen_bottom1 = Text.screen_bottom1(State)
replacement in source_text.lua at line 1081
[15.145640]→[15.145640:145702](∅→∅) − elseif State.cursor1.line >= State.screen_bottom1.line then
+ elseif State.cursor1.line >= screen_bottom1.line then
replacement in source_text.lua at line 1086
[15.5879]→[15.5879:6026](∅→∅) − line=State.screen_bottom1.line,
− pos=Text.to_pos_on_line(State, State.screen_bottom1.line, State.right-5, App.screen.height-5),
+ line=screen_bottom1.line,
+ pos=Text.to_pos_on_line(State, screen_bottom1.line, State.right-5, App.screen.height-5),
edit in source_text.lua at line 1097
[15.146140]→[15.146140:146450](∅→∅) − -- this approach is cheaper and almost works, except on the final screen
− -- where file ends above bottom of screen
− --? local botpos = Text.pos_at_start_of_screen_line(State, State.cursor1)
− --? local botline1 = {line=State.cursor1.line, pos=botpos}
− --? return Text.lt1(State.screen_bottom1, botline1)
replacement in source_select.lua at line 82
[15.27134]→[15.4417:4513](∅→∅) − return State.screen_bottom1.line, Text.pos_at_end_of_screen_line(State, State.screen_bottom1)
+ local screen_bottom1 = Text.screen_bottom1(State)
+ return screen_bottom1.line, Text.pos_at_end_of_screen_line(State, screen_bottom1)
edit in source_edit.lua at line 75
[14.946]→[15.6314:6409](∅→∅),
[15.6314]→[15.6314:6409](∅→∅) − screen_bottom1 = {line=1, pos=1}, -- position of start of screen line at bottom of screen
edit in source_edit.lua at line 169
[15.155762]→[15.4516:4561](∅→∅) − local screen_bottom1 = {line=nil, pos=nil}
edit in source_edit.lua at line 174
[15.155992]→[15.4562:4599](∅→∅) − screen_bottom1.line = line_index
replacement in source_edit.lua at line 201
[15.156342]→[10.649:753](∅→∅) − y, screen_bottom1.pos = Text.draw(State, line_index, y, startpos, hide_cursor, show_line_numbers)
+ y = Text.draw(State, line_index, y, startpos, hide_cursor, show_line_numbers)
edit in source_edit.lua at line 211
[15.156525]→[15.4686:4726](∅→∅) − State.screen_bottom1 = screen_bottom1
replacement in source_edit.lua at line 364
[5.32]→[15.227:310](∅→∅),
[15.227]→[15.227:310](∅→∅) − State.cursor1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos}
+ State.cursor1 = Text.screen_bottom1(State)
replacement in select.lua at line 82
[15.46495]→[15.1840:1936](∅→∅) − return State.screen_bottom1.line, Text.pos_at_end_of_screen_line(State, State.screen_bottom1)
+ local screen_bottom1 = Text.screen_bottom1(State)
+ return screen_bottom1.line, Text.pos_at_end_of_screen_line(State, screen_bottom1)
replacement in search.lua at line 65
[15.50515]→[15.730:832](∅→∅) − if Text.lt1(State.cursor1, State.screen_top1) or Text.lt1(State.screen_bottom1, State.cursor1) then
+ local screen_bottom1 = Text.screen_bottom1(State)
+ if Text.lt1(State.cursor1, State.screen_top1) or Text.lt1(screen_bottom1, State.cursor1) then
replacement in search.lua at line 119
[15.51555]→[15.1775:1877](∅→∅) − if Text.lt1(State.cursor1, State.screen_top1) or Text.lt1(State.screen_bottom1, State.cursor1) then
+ local screen_bottom1 = Text.screen_bottom1(State)
+ if Text.lt1(State.cursor1, State.screen_top1) or Text.lt1(screen_bottom1, State.cursor1) then
edit in edit.lua at line 73
[13.934]→[15.96626:96721](∅→∅),
[15.96626]→[15.96626:96721](∅→∅) − screen_bottom1 = {line=1, pos=1}, -- position of start of screen line at bottom of screen
edit in edit.lua at line 168
[15.22445]→[15.1951:1996](∅→∅) − local screen_bottom1 = {line=nil, pos=nil}
edit in edit.lua at line 173
[15.3095]→[15.1997:2034](∅→∅) − screen_bottom1.line = line_index
replacement in edit.lua at line 196
[15.5239]→[15.2035:2107](∅→∅) − y, screen_bottom1.pos = Text.draw(State, line_index, y, startpos)
+ y = Text.draw(State, line_index, y, startpos)
edit in edit.lua at line 206
[15.5923]→[15.2108:2148](∅→∅) − State.screen_bottom1 = screen_bottom1
replacement in edit.lua at line 360
[5.182]→[15.2080:2163](∅→∅),
[15.2080]→[15.2080:2163](∅→∅) − State.cursor1 = {line=State.screen_bottom1.line, pos=State.screen_bottom1.pos}
+ State.cursor1 = Text.screen_bottom1(State)
edit in app.lua at line 133
+ --? App.initialize_for_test() -- debug: run a single test at a time like these 2 lines
+ --? test_pagedown_skips_drawings()
replacement in app.lua at line 409
[15.60904]→[15.2268:2330](∅→∅) − local stack_trace = debug.traceback('', --[[stack frame]]5)
+ local stack_trace = debug.traceback('', --[[stack frame]]5) -- most likely to be useful, but set to 0 for a complete stack trace
edit in app.lua at line 412
+ -- uncomment this line for a complete stack trace