show how to load lines in editor
This commit is contained in:
parent
d86e8f945b
commit
0fc9fc5f22
|
@ -205,6 +205,9 @@ early warning if you break something.
|
|||
`x=right`. Wraps long lines at word boundaries where possible, or in the
|
||||
middle of words (no hyphenation yet) when it must.
|
||||
|
||||
* `state.lines = load_array(lines)` -- loads the editor state with the array
|
||||
of `lines`
|
||||
|
||||
* `edit.quit()` -- calling this ensures any final edits are flushed to disk
|
||||
before the app exits.
|
||||
|
||||
|
@ -230,7 +233,9 @@ early warning if you break something.
|
|||
buffer.
|
||||
|
||||
* `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. You shouldn't need to do
|
||||
this for the most part, just run it after loading or modifying
|
||||
`state.lines`.
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue