add state arg to a few functions

[?]
Jul 13, 2022, 12:24 AM
QCPXQ2E3USF3Z6R6WJ2JKHTRMPKA6QWXFKKRMLXA3MXABJEL543AC

Dependencies

  • [2] WLJCIXYM add state arg to a few functions
  • [3] HYEAFRZ2 split mouse_pressed events between Text and Drawing
  • [4] KOTI3MFG bugfix in previous commit
  • [5] ZHLO7K3M add args to some functions
  • [6] PX7DDEMO autosave slightly less aggressively
  • [7] 4CTZOJPC stop pretending globals are local
  • [8] 2LOQ5ALJ add args to some functions
  • [9] YPHKZVWM extract a new variable
  • [10] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [11] MDXGMZU2 disable all debug prints
  • [12] QYIFOHW3 first test!
  • [13] AYE2VEGJ extract a couple of methods
  • [14] ESETRNLB bugfix: printing the first part of a line at the bottom made it seem non-wrapping
  • [15] GN3IF4WF bugfix: pasting newlines
  • [16] YJJ4X4JG bugfix: avoid scrolling on 'end'
  • [17] KECEMMMR extract couple of functions
  • [18] OMTGHWMA yet another bugfix. But for how long?
  • [19] KOYAJWE4 extract a couple more methods
  • [20] HMODUNJE scroll on backspace
  • [21] MP2TBKU6 bugfix: crash in Text.up() after return
  • [22] 3TDOZESE extract scrolling logic out of insert_return
  • [23] 3OKKTUT4 up and down arrow now moving by screen line where possible
  • [24] QLTJG7Q3 indent
  • [25] HTWAM4NZ bugfix: scrolling in left/right movements
  • [26] XNFTJHC4 split keyboard handling between Text and Drawing
  • [27] JJ7J4PUB some unnecessary mutations
  • [28] PFT5Y2ZY move
  • [29] IMEJA43L snapshot
  • [30] GCEF4N3V stop repeatedly checking for line wrapping
  • [31] 2CH77LZC add args to some functions
  • [32] 5OALPNN3 add args to some functions
  • [33] CVSRHMJ2 experiment: slightly adaptive scrolling
  • [34] KZ5GAYRP this fixes the immediate regression
  • [35] LF7BWEG4 group all editor globals
  • [36] OGUV4HSA remove some memory leaks from rendered fragments
  • [37] BTKAW76L rename
  • [38] M6TH7VSZ rip out notion of Line_width
  • [39] 3MAZEQK5 add state arg to Text.textinput
  • [40] S2MISTTM add state arg to a few functions
  • [41] F65ADDGL add state arg to a few functions
  • [42] H2DPLWMV snapshot: wrapping long lines at word boundaries
  • [43] RF5ALVNY allow the window to be resized
  • [44] Z5HLXU4P add state arg to a few functions
  • [45] CCYSVZA2 bugfix: BSOD in #4.
  • [46] QCQTMUZ7 add args to some functions
  • [47] CTJ3IZGS add args to some functions
  • [48] SVJZZDC3 snapshot - no, that's all wrong
  • [49] UV4EWOLY add args to some functions
  • [50] K4OBZSHE add args to some functions
  • [51] 5UG5PQ6K undo commit 861c57b533
  • [52] CPZGQT72 go through and fix similar issues
  • [53] HOSPP2AN crisp font rendering
  • [54] 62PZGSUC optimization: moving cursor to next word
  • [55] 242L3OQX bugfix: ensure Cursor_line is always on a text line
  • [56] EMRPLZPW drop an arg from a function
  • [57] GK47BBCY start passing left/right margins everywhere
  • [58] GGJEDJOO add args to some functions
  • [59] SPSW74Y5 add state arg to Text.keychord_pressed
  • [60] AIRIP35Z cleaner
  • [61] ULKLJBN6 couple of renames
  • [62] CUIV2LE5 some typos
  • [63] WOXIYUTL bugfix: manage screen_top and cursor when resizing
  • [64] CBPV5SSI stop handling nil screen_line_starting_pos everywhere
  • [65] 2ZYV7D3W handle tab characters
  • [66] LXTTOB33 extract a couple of files
  • [67] 2L5MEZV3 experiment: new edit namespace
  • [68] ZPUQSPQP extract a few methods
  • [69] IRCKL6VN extract scrolling logic out of insert_at_cursor
  • [70] U7M4M2F7 bugfix: don't rely on Screen_bottom1 while scrolling
  • [71] MYC7XR5Q bugfix: lines that aren't drawn from the start
  • [72] BOFNXP5G clicking now moves the cursor even on long, wrapped lines
  • [73] PR4KIAZD first stab at equally hacky cursor down support
  • [74] ZZ2B5RPQ extract variables for drawing padding
  • [75] R22PA3XR fix a second BSOD in #4 :/
  • [76] LNUHQOGH start passing in Editor_state explicitly
  • [77] R53OF3ON one bug I've repeatedly run into while testing with Moby Dick
  • [78] AMSESRTH move some code
  • [79] 2H67P75X switch arg for a function
  • [80] PHQPLJUQ rename
  • [81] K464QQR4 more defensive resize handling
  • [82] PTDO2SOT add state arg to schedule_save
  • [83] EGH7XDBK support non-text lines in Text.to2
  • [84] BULPIBEG beginnings of a module for the text editor
  • [85] TRNWIQN6 more precise height calculation when scrolling up as much as possible while keeping cursor on screen
  • [86] U52E2XZN fix a crash
  • [87] DRFE3B3Z mouse buttons are integers, not strings
  • [88] YLKLDF4R .
  • [89] 5FW7YOFT highlight selection while dragging
  • [90] PLKNHYZ4 extract a function
  • [*] OTIBCAUJ love2d scaffold

Change contents

  • replacement in text.lua at line 145
    [3.434][3.434:531]()
    Text.snap_cursor_to_bottom_of_screen(State.margin_left, App.screen.width-State.margin_right)
    [3.434]
    [3.531]
    Text.snap_cursor_to_bottom_of_screen(State, State.margin_left, App.screen.width-State.margin_right)
  • replacement in text.lua at line 168
    [3.261][3.261:360]()
    Text.snap_cursor_to_bottom_of_screen(State.margin_left, App.screen.width-State.margin_right)
    [3.261]
    [3.105]
    Text.snap_cursor_to_bottom_of_screen(State, State.margin_left, App.screen.width-State.margin_right)
  • replacement in text.lua at line 178
    [3.854][3.854:953]()
    Text.snap_cursor_to_bottom_of_screen(State.margin_left, App.screen.width-State.margin_right)
    [3.854]
    [3.953]
    Text.snap_cursor_to_bottom_of_screen(State, State.margin_left, App.screen.width-State.margin_right)
  • replacement in text.lua at line 215
    [3.2510][3.2510:2755](),[3.2755][3.3:95](),[3.60340][3.3:95](),[3.3103][3.3:95]()
    local top2 = Text.to2(State.screen_top1, State.margin_left, App.screen.width-State.margin_right)
    top2 = Text.previous_screen_line(top2, State.margin_left, App.screen.width-State.margin_right)
    State.screen_top1 = Text.to1(top2)
    Text.redraw_all() -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [3.2510]
    [3.2992]
    local top2 = Text.to2(State, State.screen_top1, State.margin_left, App.screen.width-State.margin_right)
    top2 = Text.previous_screen_line(State, top2, State.margin_left, App.screen.width-State.margin_right)
    State.screen_top1 = Text.to1(State, top2)
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
  • replacement in text.lua at line 357
    [3.115][3.2606:2662]()
    local top2 = Text.to2(State.screen_top1, left, right)
    [3.115]
    [3.152]
    local top2 = Text.to2(State, State.screen_top1, left, right)
  • replacement in text.lua at line 368
    [3.563][3.93:149]()
    top2 = Text.previous_screen_line(top2, left, right)
    [3.563]
    [3.77]
    top2 = Text.previous_screen_line(State, top2, left, right)
  • replacement in text.lua at line 370
    [3.83][3.3093:3130]()
    State.screen_top1 = Text.to1(top2)
    [3.83]
    [3.3130]
    State.screen_top1 = Text.to1(State, top2)
  • replacement in text.lua at line 373
    [3.3220][3.3:93](),[3.67004][3.3:93](),[3.704][3.3:93]()
    Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(left, right)
    [3.3220]
    [3.3221]
    Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State, left, right)
  • replacement in text.lua at line 383
    [3.2991][3.3364:3423]()
    local top2 = Text.to2(State.screen_bottom1, left, right)
    [3.2991]
    [3.3031]
    local top2 = Text.to2(State, State.screen_bottom1, left, right)
  • replacement in text.lua at line 387
    [3.3124][3.3124:3158]()
    local new_top1 = Text.to1(top2)
    [3.3124]
    [3.3424]
    local new_top1 = Text.to1(State, top2)
  • replacement in text.lua at line 397
    [3.3782][3.94:184](),[3.67641][3.94:184](),[3.1094][3.94:184]()
    Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(left, right)
    [3.3782]
    [3.3783]
    Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State, left, right)
  • replacement in text.lua at line 399
    [3.3830][3.96:184](),[3.67696][3.96:184](),[3.1214][3.96:184]()
    Text.redraw_all() -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [3.3830]
    [3.142]
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
  • replacement in text.lua at line 457
    [3.6132][3.3:59](),[3.70279][3.3:59](),[3.2871][3.3:59]()
    if Text.cursor_at_final_screen_line(left, right) then
    [3.6132]
    [3.2916]
    if Text.cursor_at_final_screen_line(State, left, right) then
  • replacement in text.lua at line 473
    [3.3562][3.265:321]()
    Text.snap_cursor_to_bottom_of_screen(left, right)
    [3.3562]
    [3.6623]
    Text.snap_cursor_to_bottom_of_screen(State, left, right)
  • replacement in text.lua at line 492
    [3.4678][3.322:378]()
    Text.snap_cursor_to_bottom_of_screen(left, right)
    [3.4678]
    [3.7294]
    Text.snap_cursor_to_bottom_of_screen(State, left, right)
  • replacement in text.lua at line 511
    [2.362][3.379:433](),[3.46][3.379:433]()
    Text.snap_cursor_to_bottom_of_screen(left, right)
    [2.362]
    [3.6543]
    Text.snap_cursor_to_bottom_of_screen(State, left, right)
  • replacement in text.lua at line 560
    [2.411][3.434:488](),[3.85][3.434:488]()
    Text.snap_cursor_to_bottom_of_screen(left, right)
    [2.411]
    [3.36]
    Text.snap_cursor_to_bottom_of_screen(State, left, right)
  • replacement in text.lua at line 589
    [3.606][3.606:664](),[3.246][3.150:206](),[3.664][3.150:206](),[3.73630][3.150:206](),[3.6636][3.150:206](),[3.206][3.665:704]()
    local top2 = Text.to2(State.screen_top1, left, right)
    top2 = Text.previous_screen_line(top2, left, right)
    State.screen_top1 = Text.to1(top2)
    [3.606]
    [3.568]
    local top2 = Text.to2(State, State.screen_top1, left, right)
    top2 = Text.previous_screen_line(State, top2, left, right)
    State.screen_top1 = Text.to1(State, top2)
  • replacement in text.lua at line 598
    [2.460][3.489:543](),[3.202][3.489:543]()
    Text.snap_cursor_to_bottom_of_screen(left, right)
    [2.460]
    [3.245]
    Text.snap_cursor_to_bottom_of_screen(State, left, right)
  • replacement in text.lua at line 630
    [3.6][3.60:115](),[3.115][3.74497:74824]()
    function Text.cursor_at_final_screen_line(left, right)
    Text.populate_screen_line_starting_pos(Editor_state.lines[Editor_state.cursor1.line], left, right)
    local screen_lines = Editor_state.lines[Editor_state.cursor1.line].screen_line_starting_pos
    --? print(screen_lines[#screen_lines], Editor_state.cursor1.pos)
    return screen_lines[#screen_lines] <= Editor_state.cursor1.pos
    [3.6]
    [3.1933]
    function Text.cursor_at_final_screen_line(State, left, right)
    Text.populate_screen_line_starting_pos(State.lines[State.cursor1.line], left, right)
    local screen_lines = State.lines[State.cursor1.line].screen_line_starting_pos
    --? print(screen_lines[#screen_lines], State.cursor1.pos)
    return screen_lines[#screen_lines] <= State.cursor1.pos
  • replacement in text.lua at line 637
    [3.1938][3.185:282](),[3.282][3.74825:74994]()
    function Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(left, right)
    local y = Editor_state.margin_top
    while Editor_state.cursor1.line <= #Editor_state.lines do
    if Editor_state.lines[Editor_state.cursor1.line].mode == 'text' then
    [3.1938]
    [3.166]
    function Text.move_cursor_down_to_next_text_line_while_scrolling_again_if_necessary(State, left, right)
    local y = State.margin_top
    while State.cursor1.line <= #State.lines do
    if State.lines[State.cursor1.line].mode == 'text' then
  • replacement in text.lua at line 643
    [3.186][3.74995:75228]()
    --? print('cursor skips', Editor_state.cursor1.line)
    y = y + Editor_state.drawing_padding_height + Drawing.pixels(Editor_state.lines[Editor_state.cursor1.line].h)
    Editor_state.cursor1.line = Editor_state.cursor1.line + 1
    [3.186]
    [3.220]
    --? print('cursor skips', State.cursor1.line)
    y = y + State.drawing_padding_height + Drawing.pixels(State.lines[State.cursor1.line].h)
    State.cursor1.line = State.cursor1.line + 1
  • replacement in text.lua at line 648
    [3.287][3.75229:75411]()
    if Editor_state.cursor1.line > #Editor_state.lines then
    assert(Editor_state.cursor1.line == #Editor_state.lines+1)
    table.insert(Editor_state.lines, {mode='text', data=''})
    [3.287]
    [3.402]
    if State.cursor1.line > #State.lines then
    assert(State.cursor1.line == #State.lines+1)
    table.insert(State.lines, {mode='text', data=''})
  • replacement in text.lua at line 652
    [3.408][3.75412:75549]()
    --? print(y, App.screen.height, App.screen.height-Editor_state.line_height)
    if y > App.screen.height - Editor_state.line_height then
    [3.408]
    [3.1554]
    --? print(y, App.screen.height, App.screen.height-State.line_height)
    if y > App.screen.height - State.line_height then
  • replacement in text.lua at line 655
    [3.1581][3.544:598]()
    Text.snap_cursor_to_bottom_of_screen(left, right)
    [3.1581]
    [3.529]
    Text.snap_cursor_to_bottom_of_screen(State, left, right)
  • replacement in text.lua at line 659
    [3.540][3.75550:75594](),[3.75594][3.599:658](),[3.325][3.599:658](),[3.658][3.75595:75654]()
    -- should never modify Editor_state.cursor1
    function Text.snap_cursor_to_bottom_of_screen(left, right)
    local top2 = Text.to2(Editor_state.cursor1, left, right)
    [3.540]
    [3.533]
    -- should never modify State.cursor1
    function Text.snap_cursor_to_bottom_of_screen(State, left, right)
    local top2 = Text.to2(State, State.cursor1, left, right)
  • replacement in text.lua at line 663
    [3.580][3.75655:75840]()
    --? print('cursor pos '..tostring(Editor_state.cursor1.pos)..' is on the #'..tostring(top2.screen_line)..' screen line down')
    local y = App.screen.height - Editor_state.line_height
    [3.580]
    [3.455]
    --? print('cursor pos '..tostring(State.cursor1.pos)..' is on the #'..tostring(top2.screen_line)..' screen line down')
    local y = App.screen.height - State.line_height
  • replacement in text.lua at line 669
    [3.394][3.75841:76011]()
    if top2.screen_line > 1 or Editor_state.lines[top2.line-1].mode == 'text' then
    local h = Editor_state.line_height
    if y - h < Editor_state.margin_top then
    [3.394]
    [3.545]
    if top2.screen_line > 1 or State.lines[top2.line-1].mode == 'text' then
    local h = State.line_height
    if y - h < State.margin_top then
  • replacement in text.lua at line 677
    [3.614][3.76012:76076]()
    assert(Editor_state.lines[top2.line-1].mode == 'drawing')
    [3.614]
    [3.665]
    assert(State.lines[top2.line-1].mode == 'drawing')
  • replacement in text.lua at line 680
    [3.767][3.76077:76227]()
    local h = Editor_state.drawing_padding_height + Drawing.pixels(Editor_state.lines[top2.line-1].h)
    if y - h < Editor_state.margin_top then
    [3.767]
    [3.857]
    local h = State.drawing_padding_height + Drawing.pixels(State.lines[top2.line-1].h)
    if y - h < State.margin_top then
  • replacement in text.lua at line 687
    [3.883][3.207:263]()
    top2 = Text.previous_screen_line(top2, left, right)
    [3.883]
    [3.925]
    top2 = Text.previous_screen_line(State, top2, left, right)
  • replacement in text.lua at line 690
    [3.1066][3.76228:76362](),[3.76362][3.185:273](),[3.1161][3.185:273]()
    Editor_state.screen_top1 = Text.to1(top2)
    --? print('top1 finally:', Editor_state.screen_top1.line, Editor_state.screen_top1.pos)
    Text.redraw_all() -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [3.1066]
    [3.931]
    State.screen_top1 = Text.to1(State, top2)
    --? print('top1 finally:', State.screen_top1.line, State.screen_top1.pos)
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
  • replacement in text.lua at line 695
    [3.936][3.3:48]()
    function Text.in_line(line, x,y, left,right)
    [3.936]
    [3.1014]
    function Text.in_line(State, line, x,y, left,right)
  • replacement in text.lua at line 700
    [3.578][3.76363:76498]()
    return y < line.starty + Editor_state.line_height*(#line.screen_line_starting_pos - Text.screen_line_index(line, line.startpos) + 1)
    [3.578]
    [3.95]
    return y < line.starty + State.line_height*(#line.screen_line_starting_pos - Text.screen_line_index(line, line.startpos) + 1)
  • replacement in text.lua at line 704
    [3.1150][3.3:59]()
    function Text.to_pos_on_line(line, mx, my, left, right)
    [3.1150]
    [3.3]
    function Text.to_pos_on_line(State, line, mx, my, left, right)
  • replacement in text.lua at line 716
    [3.1037][3.76499:76546]()
    local nexty = y + Editor_state.line_height
    [3.1037]
    [3.1098]
    local nexty = y + State.line_height
  • edit in text.lua at line 733
    [3.468][3.1324:1502](),[3.1502][3.76547:76592](),[3.7701][3.1533:1643](),[3.76592][3.1533:1643](),[3.1533][3.1533:1643](),[3.1643][3.76593:76638]()
    -- manual test:
    -- line: abc
    -- def
    -- gh
    -- fragments: abc, def, gh
    -- click inside e
    -- line_starting_pos = 1 + 3 = 4
    -- nearest_cursor_pos('defgh', mx) = 2
    -- Editor_state.cursor1.pos = 4 + 2 - 1 = 5
    -- manual test:
    -- click inside h
    -- line_starting_pos = 1 + 3 + 3 = 7
    -- nearest_cursor_pos('gh', mx) = 2
    -- Editor_state.cursor1.pos = 7 + 2 - 1 = 8
  • replacement in text.lua at line 836
    [3.3295][3.294:331](),[3.331][3.76639:76697]()
    function Text.to2(pos1, left, right)
    if Editor_state.lines[pos1.line].mode == 'drawing' then
    [3.3295]
    [3.46]
    function Text.to2(State, pos1, left, right)
    if State.lines[pos1.line].mode == 'drawing' then
  • replacement in text.lua at line 841
    [3.7808][3.76698:76930]()
    Text.populate_screen_line_starting_pos(Editor_state.lines[pos1.line], left, right)
    for i=#Editor_state.lines[pos1.line].screen_line_starting_pos,1,-1 do
    local spos = Editor_state.lines[pos1.line].screen_line_starting_pos[i]
    [3.7808]
    [3.352]
    Text.populate_screen_line_starting_pos(State.lines[pos1.line], left, right)
    for i=#State.lines[pos1.line].screen_line_starting_pos,1,-1 do
    local spos = State.lines[pos1.line].screen_line_starting_pos[i]
  • replacement in text.lua at line 854
    [3.8216][3.8216:8240]()
    function Text.to1(pos2)
    [3.8216]
    [3.8240]
    function Text.to1(State, pos2)
  • replacement in text.lua at line 857
    [3.8326][3.76931:77043]()
    result.pos = Editor_state.lines[pos2.line].screen_line_starting_pos[pos2.screen_line] + pos2.screen_pos - 1
    [3.8326]
    [3.8421]
    result.pos = State.lines[pos2.line].screen_line_starting_pos[pos2.screen_line] + pos2.screen_pos - 1
  • edit in text.lua at line 890
    [3.1005][3.77044:77212]()
    print(Editor_state.cursor1.line, Editor_state.cursor1.pos, #Editor_state.lines[Editor_state.cursor1.line].data, Editor_state.lines[Editor_state.cursor1.line].data)
  • replacement in text.lua at line 896
    [3.564][3.264:318]()
    function Text.previous_screen_line(pos2, left, right)
    [3.564]
    [3.1432]
    function Text.previous_screen_line(State, pos2, left, right)
  • replacement in text.lua at line 901
    [3.1582][3.77213:77277]()
    elseif Editor_state.lines[pos2.line-1].mode == 'drawing' then
    [3.1582]
    [3.1633]
    elseif State.lines[pos2.line-1].mode == 'drawing' then
  • replacement in text.lua at line 904
    [3.1699][3.77278:77528]()
    local l = Editor_state.lines[pos2.line-1]
    Text.populate_screen_line_starting_pos(Editor_state.lines[pos2.line-1], left, right)
    return {line=pos2.line-1, screen_line=#Editor_state.lines[pos2.line-1].screen_line_starting_pos, screen_pos=1}
    [3.1699]
    [3.1960]
    local l = State.lines[pos2.line-1]
    Text.populate_screen_line_starting_pos(State.lines[pos2.line-1], left, right)
    return {line=pos2.line-1, screen_line=#State.lines[pos2.line-1].screen_line_starting_pos, screen_pos=1}
  • replacement in text.lua at line 935
    [3.3998][3.434:489](),[3.489][3.77529:77696]()
    function Text.tweak_screen_top_and_cursor(left, right)
    --? print('a', Editor_state.selection1.line)
    if Editor_state.screen_top1.pos == 1 then return end
    local line = Editor_state.lines[Editor_state.screen_top1.line]
    [3.3998]
    [3.866]
    -- resize helper
    function Text.tweak_screen_top_and_cursor(State, left, right)
    --? print('a', State.selection1.line)
    if State.screen_top1.pos == 1 then return end
    local line = State.lines[State.screen_top1.line]
  • replacement in text.lua at line 943
    [3.314][3.77697:77745]()
    if pos == Editor_state.screen_top1.pos then
    [3.314]
    [3.349]
    if pos == State.screen_top1.pos then
  • replacement in text.lua at line 946
    [3.369][3.77746:77793]()
    if pos > Editor_state.screen_top1.pos then
    [3.369]
    [3.403]
    if pos > State.screen_top1.pos then
  • replacement in text.lua at line 949
    [3.516][3.77794:77925]()
    if Editor_state.screen_top1.pos - prev < pos - Editor_state.screen_top1.pos then
    Editor_state.screen_top1.pos = prev
    [3.516]
    [3.608]
    if State.screen_top1.pos - prev < pos - State.screen_top1.pos then
    State.screen_top1.pos = prev
  • replacement in text.lua at line 952
    [3.619][3.77926:77969]()
    Editor_state.screen_top1.pos = pos
    [3.619]
    [3.649]
    State.screen_top1.pos = pos
  • replacement in text.lua at line 958
    [3.720][3.77970:78211]()
    if Text.lt1(Editor_state.cursor1, Editor_state.screen_top1) then
    Editor_state.cursor1 = {line=Editor_state.screen_top1.line, pos=Editor_state.screen_top1.pos}
    elseif Editor_state.cursor1.line >= Editor_state.screen_bottom1.line then
    [3.720]
    [3.870]
    if Text.lt1(State.cursor1, State.screen_top1) then
    State.cursor1 = {line=State.screen_top1.line, pos=State.screen_top1.pos}
    elseif State.cursor1.line >= State.screen_bottom1.line then
  • replacement in text.lua at line 962
    [3.895][2.807:864]()
    if Text.cursor_past_screen_bottom(Editor_state) then
    [3.895]
    [3.956]
    if Text.cursor_past_screen_bottom(State) then
  • replacement in text.lua at line 964
    [3.981][3.78212:78364](),[3.78364][3.60:155](),[3.57][3.60:155]()
    local line = Editor_state.lines[Editor_state.screen_bottom1.line]
    Editor_state.cursor1 = {
    line=Editor_state.screen_bottom1.line,
    pos=Text.to_pos_on_line(line, App.screen.width-5, App.screen.height-5, left, right),
    [3.981]
    [3.139]
    local line = State.lines[State.screen_bottom1.line]
    State.cursor1 = {
    line=State.screen_bottom1.line,
    pos=Text.to_pos_on_line(State, line, App.screen.width-5, App.screen.height-5, left, right),
  • replacement in text.lua at line 984
    [3.1161][3.3998:4025](),[3.3998][3.3998:4025]()
    function Text.redraw_all()
    [3.1161]
    [3.698]
    function Text.redraw_all(State)
  • replacement in text.lua at line 986
    [3.732][3.78575:78621]()
    for _,line in ipairs(Editor_state.lines) do
    [3.732]
    [3.1828]
    for _,line in ipairs(State.lines) do
  • replacement in select.lua at line 96
    [3.46375][3.88:139](),[3.139][3.158:229]()
    if Text.in_line(line, x,y, left, right) then
    return line_index, Text.to_pos_on_line(line, x,y, left, right)
    [3.46375]
    [3.46471]
    if Text.in_line(State, line, x,y, left, right) then
    return line_index, Text.to_pos_on_line(State, line, x,y, left, right)
  • replacement in main.lua at line 116
    [3.540][3.197:217]()
    Text.redraw_all()
    [3.477]
    [3.86117]
    Text.redraw_all(Editor_state)
  • replacement in main.lua at line 118
    [3.86199][3.86199:86305]()
    Text.tweak_screen_top_and_cursor(Editor_state.margin_left, App.screen.height-Editor_state.margin_right)
    [3.86199]
    [3.154]
    Text.tweak_screen_top_and_cursor(Editor_state, Editor_state.margin_left, App.screen.height-Editor_state.margin_right)
  • replacement in edit.lua at line 206
    [3.7091][3.4697:4791]()
    if Text.in_line(line, x,y, State.margin_left, App.screen.width-State.margin_right) then
    [3.7091]
    [3.7173]
    if Text.in_line(State, line, x,y, State.margin_left, App.screen.width-State.margin_right) then
  • replacement in edit.lua at line 221
    [3.7859][3.4962:5067]()
    pos=Text.to_pos_on_line(line, x, y, State.margin_left, App.screen.width-State.margin_right),
    [3.7859]
    [3.7952]
    pos=Text.to_pos_on_line(State, line, x, y, State.margin_left, App.screen.width-State.margin_right),
  • replacement in edit.lua at line 251
    [3.8882][3.5530:5626]()
    if Text.in_line(line, x,y, State.margin_left, App.screen.width-State.margin_right) then
    [3.8882]
    [3.8966]
    if Text.in_line(State, line, x,y, State.margin_left, App.screen.width-State.margin_right) then
  • replacement in edit.lua at line 255
    [3.9058][3.5656:5763]()
    pos=Text.to_pos_on_line(line, x, y, State.margin_left, App.screen.width-State.margin_right),
    [3.9058]
    [3.9153]
    pos=Text.to_pos_on_line(State, line, x, y, State.margin_left, App.screen.width-State.margin_right),
  • replacement in edit.lua at line 311
    [3.7184][3.11170:11262](),[3.103193][3.11170:11262](),[3.11170][3.11170:11262]()
    Text.redraw_all() -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [3.7184]
    [3.11262]
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
  • replacement in edit.lua at line 334
    [3.7806][3.12035:12057](),[3.103941][3.12035:12057](),[3.12035][3.12035:12057]()
    Text.redraw_all()
    [3.7806]
    [3.12057]
    Text.redraw_all(State)
  • replacement in edit.lua at line 337
    [3.7857][3.12130:12152](),[3.103999][3.12130:12152](),[3.12130][3.12130:12152]()
    Text.redraw_all()
    [3.7857]
    [3.12152]
    Text.redraw_all(State)
  • replacement in edit.lua at line 340
    [3.12214][3.12214:12236]()
    Text.redraw_all()
    [3.12214]
    [3.12236]
    Text.redraw_all(State)
  • replacement in edit.lua at line 350
    [3.8139][3.12595:12687](),[3.104316][3.12595:12687](),[3.12595][3.12595:12687]()
    Text.redraw_all() -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [3.8139]
    [3.470]
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks
  • replacement in edit.lua at line 362
    [3.8421][3.13075:13167](),[3.104633][3.13075:13167](),[3.13075][3.13075:13167]()
    Text.redraw_all() -- if we're scrolling, reclaim all fragments to avoid memory leaks
    [3.8421]
    [3.498]
    Text.redraw_all(State) -- if we're scrolling, reclaim all fragments to avoid memory leaks