Expand description
escriba-core — foundational types.
No I/O. No rendering. No tatara-lisp. Just the typed vocabulary every other escriba crate speaks:
Position— line + column, 0-indexed, UTF-8 char offsets.Range— half-open[start, end).Cursor— anchor + head (for selection growth).Selection— multi-cursor ordered set.Mode— the vim-ish modal state.Motion/Operator— compose into commands.Edit— primitive mutation.Action— top-level dispatched-to-buffer command.BufferId/WindowId— opaque identifiers.
Every type derives schemars::JsonSchema so escriba-api can emit an
OpenAPI spec over the full domain surface — the editor’s entire public
shape is spec-first by construction.
Re-exports§
pub use action::Action;pub use action::CountedAction;pub use action::HighlightEffect;pub use action::TextEffect;pub use damage::Damage;pub use damage::LineDelta;pub use edit::Edit;pub use edit::EditKind;pub use gen::EditGen;pub use id::BufferId;pub use id::CaretId;pub use id::WindowId;pub use jumplist::JUMPLIST_LIMIT;pub use jumplist::JumpList;pub use mode::CursorShape;pub use mode::Mode;pub use mode::ModeTransition;pub use motion::Motion;pub use motion::Operator;pub use motion::TextObject;pub use position::Position;pub use range::Range;pub use selection::Cursor;pub use selection::Cursors;pub use selection::Selection;
Modules§
- action
- damage
Damage+LineDelta— the typed dirty-region boundary.- edit
- gen
EditGen— the monotonic edit-generation stamp.- id
- Opaque identifiers — one counter per domain. All are transparent newtypes so serde emits them as plain numbers.
- jumplist
- The jumplist — where you were before the editor moved you a long way.
- mode
- motion
- position
- range
- selection
Structs§
- Anchored
- A value computed against a specific edit generation.
- Bytes
- UTF-8 bytes — what
&strindexing and theregexcrate speak. - Chars
- Unicode scalar values — what escriba’s own
Positionand match offsets use. - Offset
- An offset counted in a specific
Scale. - Ruler
- Converts between scales for one specific text.
- Utf16
Units - UTF-16 code units — what LSP specifies, and nothing else.
Enums§
- Bound
- Does a search from an anchor consider the anchor itself?
Traits§
- Scale
- A unit an offset can be counted in.