experiment: knob for readonly editor

[?]
Jun 8, 2023, 5:16 AM
4L3UAM75XNO54CYAZ5O26L2CZMKEU25FIZNOL4RWTZSWEWENSRNQC

Dependencies

  • [2] 6ECYOEHY bugfix: obsolete location for attribute
  • [3] PV2YA7KS subsection headings in a long switch
  • [4] IM3RBHY2 spurious args
  • [5] TLEW46AQ Merge text0
  • [6] H5UZI3YN editor documentation
  • [7] QCPXQ2E3 add state arg to a few functions
  • [8] 4KOI3E6R remove some redundant checks
  • [9] UHB4GARJ left/right margin -> left/right coordinates
  • [10] I64IPGJX avoid saving fragments in lines
  • [11] LNUHQOGH start passing in Editor_state explicitly
  • [12] 3MAZEQK5 add state arg to Text.textinput
  • [13] DHI6IJCN selecting text and deleting selections
  • [14] CG3264MM move
  • [15] SPSW74Y5 add state arg to Text.keychord_pressed
  • [16] 5ZA3BRNY add state arg to a few functions
  • [17] IFTYOERM line.y -> line_cache.starty in a few more places
  • [18] 2L5MEZV3 experiment: new edit namespace
  • [19] 4EGQRXDA bugfix: naming points
  • [20] X75QPYVW move Selection1 clearing past business logic
  • [21] ZHLO7K3M add args to some functions
  • [22] LF7BWEG4 group all editor globals
  • [23] EMHRPJ3R no, that's not right
  • [24] OGD5RAQK bugfix: naming points in drawings
  • [25] HLIF3YQE Merge text0
  • [26] 3HHPHDOO couple of typos
  • [27] GZ2OYPSH configurable colors and cursor in editor widget
  • [28] MTJEVRJR add state arg to a few functions
  • [29] VJ77YABH more efficient undo/redo
  • [30] H6QZ7GRR more precise name
  • [31] PTDO2SOT add state arg to schedule_save
  • [32] VZJHGWSP Merge lines.love
  • [33] 2CK5QI7W make love event names consistent
  • [34] S2MISTTM add state arg to a few functions
  • [35] HALS7E5U more clearly skip prints before screen top
  • [36] Z5HLXU4P add state arg to a few functions
  • [37] Z4XRNDTR find text
  • [38] TOKSRJMD show how to load lines in editor
  • [39] MD3W5IRA new fork: rip out drawing support
  • [40] XNFTJHC4 split keyboard handling between Text and Drawing
  • [41] GN3C6AGM bugfix in changing shape mid-stroke
  • [*] BULPIBEG beginnings of a module for the text editor
  • [*] J2SVGR2E experiment: blinking cursor
  • [*] X3F7ECSL add state arg to some functions
  • [*] N2NUGNN4 include a brief reference enabling many useful apps

Change contents

  • replacement in text.lua at line 48
    [7.854][7.3633:3671]()
    elseif not hide_cursor then
    [7.854]
    [5.6]
    elseif hide_cursor then
    Text.pretend_draw_cursor(State, State.left+Text.x(screen_line, State.cursor1.pos-pos+1), y)
    else
  • edit in text.lua at line 81
    [44.198]
    [45.1491]
    State.cursor_x = x
    State.cursor_y = y+State.line_height
    end
    function Text.pretend_draw_cursor(State, x, y)
  • replacement in text.lua at line 148
    [7.1137][7.1137:1180]()
    function Text.keychord_press(State, chord)
    [7.1137]
    [7.48]
    function Text.keychord_press(State, chord, readonly)
  • edit in text.lua at line 150
    [7.121]
    [7.1]
    if not readonly then
  • edit in text.lua at line 248
    [7.1891]
    [7.209]
    end
    end
  • replacement in text.lua at line 251
    [7.247][7.247:277]()
    elseif chord == 'left' then
    [7.247]
    [4.3]
    if chord == 'left' then
  • replacement in reference.md at line 234
    [6.1196][6.1196:1274]()
    * `edit.keychord_press(state, chord, key)` and `edit.key_release(state, key)`
    [6.1196]
    [6.1274]
    * `edit.keychord_press(state, chord, key, readonly)` and `edit.key_release(state, key)`
  • replacement in reference.md at line 237
    [6.1418][6.1418:1442]()
    clipboard, undo/redo.
    [6.1418]
    [6.1442]
    clipboard, undo/redo. Setting `readonly` will disable mutating keystrokes.
  • replacement in edit.lua at line 241
    [7.9696][7.5558:5593]()
    function edit.text_input(State, t)
    [7.9696]
    [7.170]
    function edit.text_input(State, t, readonly)
  • replacement in edit.lua at line 246
    [7.2586][7.10285:10292](),[7.6749][7.10285:10292](),[7.102724][7.10285:10292](),[7.10285][7.10285:10292]()
    else
    [7.2117]
    [7.26]
    elseif not readonly then
  • replacement in edit.lua at line 253
    [7.10343][7.5627:5675](),[7.5675][7.6800:6831](),[7.6800][7.6800:6831]()
    function edit.keychord_press(State, chord, key)
    if State.selection1.line and
    [7.10343]
    [7.10522]
    function edit.keychord_press(State, chord, key, readonly)
    if not readonly and State.selection1.line and
  • replacement in edit.lua at line 302
    [3.36][7.12236:12265](),[7.6870][7.12236:12265](),[7.12236][7.12236:12265]()
    elseif chord == 'C-z' then
    [3.36]
    [2.15]
    elseif not readonly and chord == 'C-z' then
  • replacement in edit.lua at line 316
    [7.12717][7.12717:12746]()
    elseif chord == 'C-y' then
    [7.12717]
    [7.835]
    elseif not readonly and chord == 'C-y' then
  • replacement in edit.lua at line 338
    [7.13403][7.13403:13432]()
    elseif chord == 'C-x' then
    [7.13403]
    [7.1051]
    elseif not readonly and chord == 'C-x' then
  • replacement in edit.lua at line 345
    [7.551][7.13660:13689](),[7.13660][7.13660:13689]()
    elseif chord == 'C-v' then
    [7.551]
    [2.123]
    elseif not readonly and chord == 'C-v' then
  • replacement in edit.lua at line 368
    [7.1400][7.5720:5758]()
    Text.keychord_press(State, chord)
    [7.1400]
    [7.15990]
    Text.keychord_press(State, chord, readonly)