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 damage;
24pub mod edit;
25pub mod r#gen;
26pub mod id;
27pub mod mode;
28pub mod motion;
29pub mod position;
30pub mod range;
31pub mod selection;
32
33pub use action::{Action, CountedAction};
34pub use damage::{Damage, LineDelta};
35pub use edit::{Edit, EditKind};
36pub use r#gen::EditGen;
37pub use id::{BufferId, CaretId, WindowId};
38pub use mode::{CursorShape, Mode, ModeTransition};
39pub use motion::{Motion, Operator};
40pub use position::Position;
41pub use range::Range;
42pub use selection::{Cursor, Cursors, Selection};