document a missing editor API

This commit is contained in:
Kartik K. Agaram 2023-12-19 10:41:53 -08:00
parent 81883d7dca
commit 3520682605
1 changed files with 6 additions and 3 deletions

View File

@ -203,9 +203,6 @@ early warning if you break something.
editor state on the app window as requested in the call to editor state on the app window as requested in the call to
`edit.initialize_state` that created `state`. `edit.initialize_state` that created `state`.
* `edit.update(state, dt)` -- call this from `App.update` to periodically
auto-save editor contents to disk.
* `edit.mouse_press(state, x,y, mouse_button)` and `edit.mouse_release(x,y, * `edit.mouse_press(state, x,y, mouse_button)` and `edit.mouse_release(x,y,
mouse_button)` -- call these to position the cursor or select some text. mouse_button)` -- call these to position the cursor or select some text.
@ -223,6 +220,12 @@ early warning if you break something.
* `Text.redraw_all(state)` -- call this to clear and recompute any cached * `Text.redraw_all(state)` -- call this to clear and recompute any cached
state as the cursor moves and the buffer scrolls. state as the cursor moves and the buffer scrolls.
* `edit.update(state, dt)` -- call this from `App.update` to periodically
auto-save editor contents to disk.
* `edit.quit(state)` -- call this from `App.quit` to ensure any final edits
get saved before quitting.
If you need more precise control, look at the comment at the top of If you need more precise control, look at the comment at the top of
`edit.initialize_state` in edit.lua. In brief, the widget contains an array of `edit.initialize_state` in edit.lua. In brief, the widget contains an array of
`lines`. Positions in the buffer are described in _schema-1_ locations `lines`. Positions in the buffer are described in _schema-1_ locations