Skip to main content

escriba_core/
lib.rs

1//! `escriba-core` — foundational types.
2//!
3//! No I/O. No rendering. No tatara-lisp. Just the typed vocabulary every
4//! other escriba crate speaks:
5//!
6//!   - [`Position`] — line + column, 0-indexed, UTF-8 char offsets.
7//!   - [`Range`] — half-open `[start, end)`.
8//!   - [`Cursor`] — anchor + head (for selection growth).
9//!   - [`Selection`] — multi-cursor ordered set.
10//!   - [`Mode`] — the vim-ish modal state.
11//!   - [`Motion`] / [`Operator`] — compose into commands.
12//!   - [`Edit`] — primitive mutation.
13//!   - [`Action`] — top-level dispatched-to-buffer command.
14//!   - [`BufferId`] / [`WindowId`] — opaque identifiers.
15//!
16//! Every type derives `schemars::JsonSchema` so escriba-api can emit an
17//! OpenAPI spec over the full domain surface — the editor's entire public
18//! shape is spec-first by construction.
19
20extern crate self as escriba_core;
21
22pub mod action;
23pub mod edit;
24pub mod id;
25pub mod mode;
26pub mod motion;
27pub mod position;
28pub mod range;
29pub mod selection;
30
31pub use action::{Action, CountedAction};
32pub use edit::{Edit, EditKind};
33pub use id::{BufferId, CaretId, WindowId};
34pub use mode::{Mode, ModeTransition};
35pub use motion::{Motion, Operator};
36pub use position::Position;
37pub use range::Range;
38pub use selection::{Cursor, Selection};