allow Text.nearest_pos_less_than to return 0

[?]
Jul 20, 2022, 2:08 PM
JLU2RMC4WICQSGLPVSQNJ4OSAUNHH3IP3FT37WIPBCKCUUQE65GAC

Dependencies

  • [2] UPCIYZEU drop an unnecessary level of indent
  • [3] HGC5RGJP switch to line index in a function
  • [4] GL4Q5WCV keep text from overflowing right margin
  • [5] BULPIBEG beginnings of a module for the text editor
  • [6] ULKLJBN6 couple of renames
  • [7] KURLAXXI clean up some prints
  • [8] LF7BWEG4 group all editor globals
  • [9] IMEJA43L snapshot
  • [10] PFT5Y2ZY move
  • [11] CVSRHMJ2 experiment: slightly adaptive scrolling
  • [12] 356GY7IQ unify two similar functions
  • [13] LXTTOB33 extract a couple of files

Change contents

  • replacement in text_tests.lua at line 1047
    [3.26875][3.2596:2701](),[3.2596][3.2596:2701]()
    App.screen.check(y, 'jkl m', 'F - test_pagedown_can_start_from_middle_of_long_wrapping_line/screen:2')
    [3.26875]
    [3.26876]
    App.screen.check(y, 'jkl ', 'F - test_pagedown_can_start_from_middle_of_long_wrapping_line/screen:2')
  • replacement in text_tests.lua at line 1049
    [3.26911][3.2723:2826](),[3.2723][3.2723:2826]()
    App.screen.check(y, 'no ', 'F - test_pagedown_can_start_from_middle_of_long_wrapping_line/screen:3')
    [3.26911]
    [3.10090]
    App.screen.check(y, 'mno ', 'F - test_pagedown_can_start_from_middle_of_long_wrapping_line/screen:3')
  • replacement in text.lua at line 107
    [2.434][2.434:509]()
    assert(bpos > 0) -- avoid infinite loop when window is too narrow
    [2.434]
    [2.509]
    if bpos == 0 then break end -- avoid infinite loop when window is too narrow
  • edit in text.lua at line 803
    [3.672][3.7235:7271](),[3.3518][3.7235:7271](),[3.7235][3.7235:7271]()
    if x == 0 then
    return 1
    end
  • replacement in text.lua at line 808
    [3.7387][3.7387:7418]()
    local left, right = 1, len+1
    [3.7387]
    [3.7436]
    local left, right = 0, len+1