remove some duplication

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

Dependencies

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

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