bugfix: infinite loop if window is too narrow

akkartik
Nov 25, 2023, 2:06 AM
FQAZKPOOUFM7KMSOOECNZN6BZROR3P2EW2KXFXK7KFEF2WOGAQTQC

Dependencies

  • [2] OE26XIQO bring back syntax highlighting (but so ugly)
  • [3] SFRZIHVE bugfix: update all panes on resize
  • [4] I64IPGJX avoid saving fragments in lines
  • [5] UPCIYZEU drop an unnecessary level of indent
  • [*] BULPIBEG beginnings of a module for the text editor
  • [*] PRE6XPRN responsively increase/decrease font height
  • [*] VEAVIL4X resize handler

Change contents

  • replacement in text.lua at line 138
    [4.1892][4.1892:1962]()
    -- everything works if bpos == 0, but is a little inefficient
    [4.1892]
    [4.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
  • edit in 0032-update_font_settings at line 12
    [2.939]
    [2.939]
    if pane.editor_state.right < pane.editor_state.left then
    pane.editor_state.right = pane.editor_state.left+1
    end
  • edit in 0031-on.resize at line 5
    [3.197]
    [3.197]
    if pane.editor_state.right < pane.editor_state.left then
    pane.editor_state.right = pane.editor_state.left+1
    end