remove some duplication

[?]
Aug 14, 2022, 3:10 PM
5STHSG4UB2SC4EZWOQHPQM43BLC4X2EJTNSSYRF35XEYVMTOID5AC

Dependencies

  • [2] ERQKFTPV extract method
  • [3] PYLBFWWE overzealous search-and-replace
  • [4] YGCT2D2O start loading settings as applicable
  • [5] SPNMXTYR have file API operate on state object
  • [6] 5T2E3PDV couple of bugfixes to file-handling
  • [7] LNUHQOGH start passing in Editor_state explicitly
  • [8] MGOQ5XAV start uppercasing globals
  • [9] O6T3TPXD bugfix: position cursor up top when loading file
  • [10] PWHZPJJM always show current filename in window title
  • [11] Z4KNS42N to open a file without a terminal, drag it on!
  • [12] BJ5X5O4A let's prevent the text cursor from ever getting on a drawing
  • [13] ILOA5BYF separate data structure for each line's cache data
  • [14] AVQ5MC5D finish uppercasing all globals
  • [15] LF7BWEG4 group all editor globals
  • [16] 2RXZ3PGO beginning of a new approach to scroll+wrap
  • [17] OTIBCAUJ love2d scaffold
  • [18] 2L5MEZV3 experiment: new edit namespace

Change contents

  • replacement in main.lua at line 50
    [4.7698][2.45:81]()
    edit.fixup_cursor(Editor_state)
    [4.7698]
    [4.460]
    if Editor_state.cursor1.line > #Editor_state.lines or Editor_state.lines[Editor_state.cursor1.line].mode ~= 'text' then
    edit.fixup_cursor(Editor_state)
    end
  • replacement in main.lua at line 130
    [4.16][4.86726:86772](),[4.211][4.500:532](),[4.86772][4.500:532](),[4.500][4.500:532](),[4.532][4.86773:86809](),[4.9246][4.16:28](),[4.86809][4.16:28](),[4.802][4.16:28](),[4.28][4.554:568](),[4.802][4.554:568](),[4.554][4.554:568]()
    for i,line in ipairs(Editor_state.lines) do
    if line.mode == 'text' then
    Editor_state.cursor1.line = i
    break
    end
    end
    [4.16]
    [3.8]
    edit.fixup_cursor(Editor_state)
  • replacement in edit.lua at line 122
    [2.123][2.123:347]()
    if State.cursor1.line > #State.lines or State.lines[State.cursor1.line].mode ~= 'text' then
    for i,line in ipairs(State.lines) do
    if line.mode == 'text' then
    State.cursor1.line = i
    break
    end
    [2.123]
    [2.347]
    for i,line in ipairs(State.lines) do
    if line.mode == 'text' then
    State.cursor1.line = i
    break