bugfix: infinite loop inside a very narrow window

akkartik
Nov 25, 2023, 3:22 AM
AIHGJ4BTQNEUC22KVGVL6J7QNS6HVUSJJJWBTWFMSRTKOM6H64EQC

Dependencies

  • [2] I64IPGJX avoid saving fragments in lines
  • [3] GZ5WULJV switch source side to new screen-line-based render
  • [4] UPCIYZEU drop an unnecessary level of indent
  • [5] KKMFQDR4 editing source code from within the app
  • [*] BULPIBEG beginnings of a module for the text editor

Change contents

  • replacement in text.lua at line 106
    [2.1892][2.1892:1962]()
    -- everything works if bpos == 0, but is a little inefficient
    [2.1892]
    [2.1962]
    if x == 0 and bpos == 0 then
    assert(false, ("Infinite loop while line-wrapping. Editor is %dpx wide; window is %dpx wide"):format(State.width, App.screen.width))
    end
  • replacement in source_text.lua at line 131
    [3.2886][3.2886:2956]()
    -- everything works if bpos == 0, but is a little inefficient
    [3.2886]
    [3.2956]
    if x == 0 and bpos == 0 then
    assert(false, ("Infinite loop while line-wrapping. Editor is %dpx wide; window is %dpx wide"):format(State.width, App.screen.width))
    end