canvist_editor
The platform-agnostic editing engine behind canvist, built on canvist_model. It has no UI: hosts send it input and draw what it returns.
- One state: the document, selection, stored marks, and IME composition change through one path, so they never disagree.
- Commands: typing, deleting by grapheme, word, or line, Enter and Backspace that understand lists and quotes, marks, block types, and copy and paste.
- Selection motion: by grapheme and word (UAX #29), line, and document. The layout engine answers line and vertical moves.
- Extensions: history, keymaps (
Modis Cmd on Apple platforms and Ctrl elsewhere), input rules such as##to a heading, and paste rules, so an app pays only for what it registers. - Typed handles: registering an extension returns the only typed way to reach its commands and queries.
can()dry runs and all-or-nothingchain()s change nothing unless they apply.
Dynamic hosts call commands by name with checked arguments, and Editor::metadata_json describes every command for generated bindings. The StarterKit extensions are in canvist_extensions.