simplify cursor-on-screen check

[?]
Aug 17, 2022, 4:36 PM
ELJNEPW26FUIIFY6D24274J7KZICRLE3TJHCFNRVLR5NZBNNV37AC

Dependencies

  • [2] 5BMR5HRT click to the left of a line
  • [3] HTWAM4NZ bugfix: scrolling in left/right movements
  • [4] F65ADDGL add state arg to a few functions
  • [5] ILOA5BYF separate data structure for each line's cache data
  • [6] NHNP76LG swap return values
  • [7] 2TQR4PSY add args to some functions
  • [8] YJJ4X4JG bugfix: avoid scrolling on 'end'
  • [9] 2L5MEZV3 experiment: new edit namespace
  • [10] 62PZGSUC optimization: moving cursor to next word
  • [11] MXA3RZYK deduce left/right from state where possible
  • [12] LNUHQOGH start passing in Editor_state explicitly
  • [13] WJBZZQE4 fold together two largely similar cases
  • [14] ZPUQSPQP extract a few methods
  • [15] LF7BWEG4 group all editor globals
  • [16] WLJCIXYM add state arg to a few functions
  • [17] TGHAJBES use line cache for drawings as well
  • [18] UHB4GARJ left/right margin -> left/right coordinates
  • [19] Z5HLXU4P add state arg to a few functions
  • [20] QCPXQ2E3 add state arg to a few functions
  • [21] KECEMMMR extract couple of functions
  • [22] WOXIYUTL bugfix: manage screen_top and cursor when resizing
  • [23] QCQTMUZ7 add args to some functions
  • [*] BULPIBEG beginnings of a module for the text editor

Change contents

  • replacement in text.lua at line 531
    [3.7909][3.314:362]()
    if Text.cursor_past_screen_bottom(State) then
    [3.7909]
    [3.1873]
    if Text.cursor_out_of_screen(State) then
  • replacement in text.lua at line 580
    [3.42][3.363:411]()
    if Text.cursor_past_screen_bottom(State) then
    [3.42]
    [3.2031]
    if Text.cursor_out_of_screen(State) then
  • replacement in text.lua at line 618
    [3.780][3.412:460]()
    if Text.cursor_past_screen_bottom(State) then
    [3.780]
    [3.2238]
    if Text.cursor_out_of_screen(State) then
  • replacement in text.lua at line 971
    [3.895][3.5601:5651]()
    if Text.cursor_past_screen_bottom(State) then
    [3.895]
    [3.956]
    if Text.cursor_out_of_screen(State) then
  • replacement in text.lua at line 982
    [3.192][3.865:912]()
    function Text.cursor_past_screen_bottom(State)
    [3.192]
    [3.234]
    function Text.cursor_out_of_screen(State)
  • replacement in text.lua at line 984
    [3.247][3.913:978]()
    return State.cursor_y >= App.screen.height - State.line_height
    [3.247]
    [3.300]
    return State.cursor_y == nil
  • replacement in edit.lua at line 137
    [2.1165][3.2879:2901](),[3.2879][3.2879:2901]()
    State.cursor_y = -1
    [2.1165]
    [3.22423]
    State.cursor_x = nil
    State.cursor_y = nil
  • edit in edit.lua at line 179
    [3.5853][3.5853:5859](),[3.5859][3.3990:4060]()
    end
    if State.cursor_y == -1 then
    State.cursor_y = App.screen.height
  • replacement in edit.lua at line 409
    [3.14227][3.1281:1331]()
    if Text.cursor_past_screen_bottom(State) then
    [3.14227]
    [3.23041]
    if Text.cursor_out_of_screen(State) then