Merge lines.love

[?]
Aug 18, 2022, 8:11 PM
TACI4LU622F462UCH5ZKSFT24NFT7EBA7GBXSHZ24IN2LEQOZNQAC

Dependencies

  • [2] EFSO7K7S Merge lines.love
  • [3] GNQC72UX generalize a function
  • [4] 2LEXWUW3 get rid of some ridiculous code
  • [5] Z5HLXU4P add state arg to a few functions
  • [6] WLJCIXYM add state arg to a few functions
  • [7] 2TQR4PSY add args to some functions
  • [8] LF7BWEG4 group all editor globals
  • [9] SVJZZDC3 snapshot - no, that's all wrong
  • [10] MXA3RZYK deduce left/right from state where possible
  • [11] PR4KIAZD first stab at equally hacky cursor down support
  • [12] MD3W5IRA new fork: rip out drawing support
  • [13] MUJTM6RE bring back a level of wrapping
  • [14] NHNP76LG swap return values
  • [15] S63M6DMQ dead code
  • [16] ELJNEPW2 simplify cursor-on-screen check
  • [17] CPZGQT72 go through and fix similar issues
  • [18] TGHAJBES use line cache for drawings as well
  • [19] MDXGMZU2 disable all debug prints
  • [20] V5MJRFOZ bugfix: down arrow doesn't scroll up unnecessarily
  • [21] ZPUQSPQP extract a few methods
  • [22] HTWAM4NZ bugfix: scrolling in left/right movements
  • [23] MP2TBKU6 bugfix: crash in Text.up() after return
  • [24] T57DTBX6 add args to some functions
  • [25] XNFTJHC4 split keyboard handling between Text and Drawing
  • [*] BULPIBEG beginnings of a module for the text editor

Change contents

  • edit in text.lua at line 429
    [5.4502][5.4502:4881](),[5.1705][5.2443:2453](),[5.4881][5.2443:2453](),[5.2443][5.2443:2453]()
    --? print('previous screen line starts at pos '..tostring(screen_line_starting_pos)..' of its line')
    if State.screen_top1.line > State.cursor1.line then
    State.screen_top1.line = State.cursor1.line
    State.screen_top1.pos = screen_line_starting_pos
    --? print('pos of top of screen is also '..tostring(State.screen_top1.pos)..' of the same line')
    end
  • resurrect zombie in text.lua at line 437
    [5.2441][5.4197:4427](),[5.2441][5.4197:4427]()
    local new_screen_line_starting_byte_offset = Text.offset(State.lines[State.cursor1.line].data, new_screen_line_starting_pos)
    local s = string.sub(State.lines[State.cursor1.line].data, new_screen_line_starting_byte_offset)
  • edit in text.lua at line 495
    [5.4849][2.4:4](),[5.4849][2.4:4](),[2.4][5.209:273](),[5.7851][5.209:273](),[5.7851][5.209:273]()
    local botpos = Text.pos_at_start_of_cursor_screen_line(State)