add state arg to Text.textinput

[?]
Jul 12, 2022, 11:33 PM
3MAZEQK5AR3IJJ2ENHHYDPDICIK645NE5QWR54Z52BHGHE6VR5XQC

Dependencies

  • [2] LF7BWEG4 group all editor globals
  • [3] XNFTJHC4 split keyboard handling between Text and Drawing
  • [4] PFT5Y2ZY move
  • [5] G6OYAYHU paste in text with M-v
  • [6] PTDO2SOT add state arg to schedule_save
  • [7] LNUHQOGH start passing in Editor_state explicitly
  • [8] BYG5CEMV support for naming points
  • [9] IRCKL6VN extract scrolling logic out of insert_at_cursor
  • [10] VJ77YABH more efficient undo/redo
  • [11] AOIRVVJA revert selection logic to before commit 3ffc2ed8f
  • [12] JFFUF5AL override mouse state lookups in tests
  • [13] AVLAYODP much simpler
  • [14] R5OKMVVC fix a regression in line wrapping
  • [15] 2ZYV7D3W handle tab characters
  • [16] 5UG5PQ6K undo commit 861c57b533
  • [17] 2L5MEZV3 experiment: new edit namespace
  • [18] DRFE3B3Z mouse buttons are integers, not strings
  • [*] BULPIBEG beginnings of a module for the text editor

Change contents

  • replacement in text.lua at line 137
    [3.73][3.1:28](),[3.1568][3.1:28]()
    function Text.textinput(t)
    [3.1568]
    [3.1143]
    function Text.textinput(State, t)
  • replacement in text.lua at line 140
    [3.76][2.55727:55973]()
    local before = snapshot(Editor_state.cursor1.line)
    --? print(Editor_state.screen_top1.line, Editor_state.screen_top1.pos, Editor_state.cursor1.line, Editor_state.cursor1.pos, Editor_state.screen_bottom1.line, Editor_state.screen_bottom1.pos)
    [3.76]
    [3.1]
    local before = snapshot(State.cursor1.line)
    --? print(State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
  • replacement in text.lua at line 143
    [3.28][2.55974:56526]()
    if Editor_state.cursor_y >= App.screen.height - Editor_state.line_height then
    Text.populate_screen_line_starting_pos(Editor_state.lines[Editor_state.cursor1.line], Editor_state.margin_left, App.screen.width-Editor_state.margin_right)
    Text.snap_cursor_to_bottom_of_screen(Editor_state.margin_left, App.screen.width-Editor_state.margin_right)
    --? print('=>', Editor_state.screen_top1.line, Editor_state.screen_top1.pos, Editor_state.cursor1.line, Editor_state.cursor1.pos, Editor_state.screen_bottom1.line, Editor_state.screen_bottom1.pos)
    [3.28]
    [3.396]
    if State.cursor_y >= App.screen.height - State.line_height then
    Text.populate_screen_line_starting_pos(State.lines[State.cursor1.line], State.margin_left, App.screen.width-State.margin_right)
    Text.snap_cursor_to_bottom_of_screen(State.margin_left, App.screen.width-State.margin_right)
    --? print('=>', State.screen_top1.line, State.screen_top1.pos, State.cursor1.line, State.cursor1.pos, State.screen_bottom1.line, State.screen_bottom1.pos)
  • replacement in text.lua at line 148
    [3.402][2.56527:56607]()
    record_undo_event({before=before, after=snapshot(Editor_state.cursor1.line)})
    [3.402]
    [3.60]
    record_undo_event({before=before, after=snapshot(State.cursor1.line)})
  • replacement in edit.lua at line 290
    [3.10292][3.10292:10314]()
    Text.textinput(t)
    [3.10292]
    [3.10314]
    Text.textinput(State, t)