stop caching screen_bottom1

akkartik
Jun 11, 2024, 2:02 PM
ZS5IYZH5EXXPSVIFWS7XW5POEVRRCK6XV6PB36D3EJXJRT22LKOQC

Dependencies

  • [2] 2EKE4XLL simplify
  • [3] 6NYMNNAD fix a name
  • [4] 3TI67SEJ more bugfix
  • [5] TXI6GSQD some minor cleanup
  • [6] 4GYPLUDY streamline the interface for Text.draw
  • [7] VDFARWQX remove some support for long lines from source editor
  • [8] CUFW4EJL reorganize app.lua and its comments
  • [9] 2MGBV7NP bugfix: crash when using mouse wheel
  • [10] PXSQR2AD hide line numbers from log browser
  • [11] G3DLS5OU audit all asserts
  • [12] FHNPQBLK more carefully pass the 'key' arg around
  • [13] QAMVLUK2 fix a crash involving mouse and drawings
  • [14] JYB3RFWH bugfix in source editor
  • [15] OP643FFG move
  • [16] CVGE3SIG I feel confident now that page-down is working.
  • [17] MSOQI3A5 bugfix: check before cursor on same line
  • [18] KZ5GAYRP this fixes the immediate regression
  • [19] LNUHQOGH start passing in Editor_state explicitly
  • [20] OI4FPFIN support drawings in the source editor
  • [21] 6RYLD5ON change how we handle clicks above top margin
  • [22] AJP4OSTJ new test
  • [23] BW2IUB3K keep all text cache writes inside text.lua
  • [24] BZRRUIFQ correct location of the line width slider
  • [25] ESETRNLB bugfix: printing the first part of a line at the bottom made it seem non-wrapping
  • [26] H3ECRBXF bugfix: clicking on empty lines
  • [27] V5MJRFOZ bugfix: down arrow doesn't scroll up unnecessarily
  • [28] KOYAJWE4 extract a couple more methods
  • [29] GK47BBCY start passing left/right margins everywhere
  • [30] SPSW74Y5 add state arg to Text.keychord_pressed
  • [31] CNCYMM6A make test initializations a little more obvious
  • [32] B3IWYWSR delete another arg that can be deduced
  • [33] 5UG5PQ6K undo commit 861c57b533
  • [34] 5OALPNN3 add args to some functions
  • [35] KOTI3MFG bugfix in previous commit
  • [36] 4KC7I3E2 make colors easier to edit
  • [37] LXTTOB33 extract a couple of files
  • [38] WOXIYUTL bugfix: manage screen_top and cursor when resizing
  • [39] 2TQR4PSY add args to some functions
  • [40] 2CH77LZC add args to some functions
  • [41] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [42] 3OKKTUT4 up and down arrow now moving by screen line where possible
  • [43] 6XCJX4DZ bugfix: inscript's bug
  • [44] GJ4LBCIE streamline button.lua
  • [45] 5ZA3BRNY add state arg to a few functions
  • [46] HOSPP2AN crisp font rendering
  • [47] Y36LOGR5 bugfix: show cursor when past end of line
  • [48] AVTNUQYR basic test-enabled framework
  • [49] ORRSP7FV deduce test names on failures
  • [50] ZHLO7K3M add args to some functions
  • [51] I64IPGJX avoid saving fragments in lines
  • [52] FQZ3U3YA streamline one more test name
  • [53] 3MAZEQK5 add state arg to Text.textinput
  • [54] B4JEWKWI hide editor cursor while in file navigator
  • [55] 656FM555 bugfix: clear selection when clicking above or below lines
  • [56] WLJCIXYM add state arg to a few functions
  • [57] DSLD74DK lots more tests
  • [58] ODLKHO7B switch to line index in a function
  • [59] 5BMR5HRT click to the left of a line
  • [60] KOTNETIM repeat changes on source editor
  • [61] ZZ2B5RPQ extract variables for drawing padding
  • [62] S2QMLRXL stop creating a singleton table for every word
  • [63] DHI6IJCN selecting text and deleting selections
  • [64] UBA2ZUCP remove a duplicate print to screen
  • [65] V5SYDHPQ start thinking of compute_fragments as a detail
  • [66] GCEF4N3V stop repeatedly checking for line wrapping
  • [67] 62PZGSUC optimization: moving cursor to next word
  • [68] 2L5MEZV3 experiment: new edit namespace
  • [69] 3ZSUBI57 drop some redundant args from Text.draw
  • [70] LAW2O3NW extract variable Margin_left
  • [71] HALS7E5U more clearly skip prints before screen top
  • [72] P6SYWBLB remove a duplicate test
  • [73] DLQMM265 scroll past first page
  • [74] BULPIBEG beginnings of a module for the text editor
  • [75] NHNP76LG swap return values
  • [76] Y4SPXCM3 bugfix: pagedown was sometimes bouncing up
  • [77] FZBXBUFF bugfix: search
  • [78] X3F7ECSL add state arg to some functions
  • [79] LLAOOMUL bugfix: search upwards
  • [80] A2PRHMXT change cursor bounds check slightly
  • [81] G54H3YG2 get rid of all bifold text
  • [82] Z4XRNDTR find text
  • [83] LF7BWEG4 group all editor globals
  • [84] 2LOQ5ALJ add args to some functions
  • [85] GDAWPFAV more streamlined test names
  • [86] ILOA5BYF separate data structure for each line's cache data
  • [87] K4OBZSHE add args to some functions
  • [88] 2ZYV7D3W handle tab characters
  • [89] CVSRHMJ2 experiment: slightly adaptive scrolling
  • [90] IRCKL6VN extract scrolling logic out of insert_at_cursor
  • [91] Y2ZIPXEM new test
  • [92] 2H76FV5S bugfix: searching files containing unicode
  • [93] SWZAQHGR bugfix: up arrow when line above is a drawing
  • [94] FKNXK2OA switch to line index in a function
  • [95] SR4C3ZYZ add an assert
  • [96] YFW4MNNP handle wrapping lines
  • [97] KTZQ57HV replace globals with args in a few functions
  • [98] 5SM6DRHK port inscript's bugfix to source editor
  • [99] SDEY7LFJ rename a variable
  • [100] MXA3RZYK deduce left/right from state where possible
  • [101] 73OCE2MC after much struggle, a brute-force undo
  • [102] 3TFEAQSW start using some globals
  • [103] TRNWIQN6 more precise height calculation when scrolling up as much as possible while keeping cursor on screen
  • [104] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [105] EKKFWP4D bugfix: couple of margin-relative computations
  • [106] O4ZGUPZN improved handling of other keyboard layouts
  • [107] QLTJG7Q3 indent
  • [108] GFXWHTE6 mouse wheel support
  • [109] LK4ZW4BB bugfix
  • [110] 4EGQRXDA bugfix: naming points
  • [111] OGUV4HSA remove some memory leaks from rendered fragments
  • [112] QCPXQ2E3 add state arg to a few functions
  • [113] GIG6OV3G port keyboard layout handling to source editor
  • [114] YPHKZVWM extract a new variable
  • [115] PYGMASTV disable some debug prints
  • [116] ZPUQSPQP extract a few methods
  • [117] WJBZZQE4 fold together two largely similar cases
  • [118] XNFTJHC4 split keyboard handling between Text and Drawing
  • [119] SVJZZDC3 snapshot - no, that's all wrong
  • [120] UHB4GARJ left/right margin -> left/right coordinates
  • [121] 6WDBV52Z move a var closer to its use
  • [122] EETIR4GX bugfix: skip over drawings when searching
  • [123] KMSL74GA support selections in the source editor
  • [124] AMSESRTH move some code
  • [125] GGJEDJOO add args to some functions
  • [126] MDXGMZU2 disable all debug prints
  • [127] CUIV2LE5 some typos
  • [128] EWMPYCDO bugfix
  • [129] HPVT467W initialize contains test state
  • [130] APYPFFS3 call edit rather than App callbacks in tests
  • [131] AMOPICKV bugfix: check after cursor on same line when searching upwards
  • [132] ELJNEPW2 simplify cursor-on-screen check
  • [133] GNQC72UX generalize a function
  • [134] PR4KIAZD first stab at equally hacky cursor down support
  • [135] MTJEVRJR add state arg to a few functions
  • [136] H4R5BHVY no more Text allocations
  • [137] Z5HLXU4P add state arg to a few functions
  • [138] 2JLVAYHB start decoupling editor tests from App
  • [139] HTWAM4NZ bugfix: scrolling in left/right movements
  • [140] TUN6TDO4 give a test a unique name
  • [141] WAR3HXHT test both ways of selecting text with mouse
  • [142] KKMFQDR4 editing source code from within the app
  • [143] TGZAJUEF bring back a set of constants
  • [144] GZ5WULJV switch source side to new screen-line-based render
  • [145] 7RKFA3VA failing test now looks realistic
  • [146] DRFE3B3Z mouse buttons are integers, not strings
  • [147] YJJ4X4JG bugfix: avoid scrolling on 'end'
  • [*] MP2TBKU6 bugfix: crash in Text.up() after return
  • [*] EAEGCJV5 rename
  • [*] 3QNOKBFM beginnings of a test harness

Change contents

  • 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
    [15.91][6.3:83]()
    -- return y for the next line, and position of start of final screen line drawn
    [15.91]
    [15.163]
    -- 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
    [15.37][6.84:127]()
    return y, final_screen_line_starting_pos
    [15.37]
    [15.1206]
    return y
  • 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)
    [15.1073]
    [15.3]
    --? 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)
    [15.1369]
    [15.470]
    --? 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)
    [15.15513]
    [15.806]
    --? 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]()
    --? print('pageup')
    [15.434]
    [15.74]
    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)
    [15.115]
    [15.2663]
    -- 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
    [15.16711]
    [15.2891]
    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)
    [15.2923]
    [15.555]
    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)
    [15.563]
    [15.77]
    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')
    [15.83]
    [15.83]
    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)
    [15.652]
    [15.339]
    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')
    [15.1257]
    [15.1214]
    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)
    [11.1152]
    [11.1153]
    --? 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
    [15.1321]
    [15.6537]
    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
    [15.3744][2.3:73]()
    local scroll_down = Text.le1(State.screen_bottom1, State.cursor1)
    [15.3744]
    [15.3929]
    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)
    [15.4810]
    [15.6091]
    --? 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
    [13.137]
    [13.201]
    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),
    [13.214]
    [13.323]
    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)
    [13.335]
    [13.388]
    local loc2 = Text.to2(State, screen_bottom1)
  • replacement in text.lua at line 703
    [15.580][4.3:162]()
    --? print('snap', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
    [15.580]
    [15.3087]
    --? 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)
    [15.3781]
    [15.3781]
    --? print('snap =>', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
  • edit in text.lua at line 938
    [149.880]
    [149.880]
    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
    [150.1229]
    [15.3987]
    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
    [15.720]
    [15.5408]
    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')
    [15.5538]
    [15.135]
    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),
    }
    [15.180]
    [15.1142]
    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
    [15.83964]
    [10.8]
    -- 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
    [15.89103]
    [15.1985]
    return y
  • 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)
    [15.97303]
    [15.97454]
    --? 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)
    [15.99353]
    [15.99506]
    --? 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)
    [15.99759]
    [15.99920]
    --? 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]()
    --? print('pageup')
    [15.107499]
    [15.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)
    [15.107562]
    [15.107643]
    -- 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
    [15.107719]
    [15.6553]
    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)
    [15.6585]
    [15.6761]
    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)
    [15.6769]
    [15.107969]
    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')
    [15.107975]
    [15.108331]
    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)
    [15.108366]
    [15.2843]
    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')
    [15.109070]
    [15.109098]
    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)
    [11.3470]
    [11.3471]
    --? 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
    [15.115410]
    [15.115469]
    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)
    [15.2975]
    [15.115903]
    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)
    [15.118181]
    [15.118338]
    --? 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
    [14.145]
    [14.209]
    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),
    [14.222]
    [14.331]
    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)
    [14.343]
    [14.396]
    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)
    [15.3661]
    [15.127567]
    --? 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)
    [15.128343]
    [15.128576]
    --? print('snap =>', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos)
  • edit in source_text.lua at line 1012
    [15.142104]
    [15.142169]
    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
    [15.5854]
    [15.144205]
    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
    [15.145510]
    [15.145510]
    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
    [15.145640]
    [15.145702]
    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),
    [15.5879]
    [15.6026]
    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)
    [15.27134]
    [15.27134]
    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)
    [15.156342]
    [15.21245]
    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}
    [5.32]
    [9.58]
    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)
    [15.46495]
    [15.5]
    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
    [15.50515]
    [15.832]
    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
    [15.51555]
    [15.1877]
    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)
    [15.5239]
    [15.1039]
    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}
    [5.182]
    [9.167]
    State.cursor1 = Text.screen_bottom1(State)
  • edit in app.lua at line 133
    [8.842]
    [8.842]
    --? 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)
    [15.60904]
    [15.60966]
    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
    [15.61148]
    [15.2058]
    -- uncomment this line for a complete stack trace