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 jumplist;
28pub mod mode;
29pub mod motion;
30pub mod position;
31pub mod range;
32pub mod selection;
33
34pub use action::{Action, CountedAction, HighlightEffect, TextEffect};
35pub use damage::{Damage, LineDelta};
36pub use edit::{Edit, EditKind};
37pub use r#gen::EditGen;
38pub use id::{BufferId, CaretId, WindowId};
39pub use jumplist::{JUMPLIST_LIMIT, JumpList};
40// memori lives in its own leaf crate so `escriba-search` — which sits BELOW
41// core in the dependency graph — can use it too. Re-exported here so position
42// code in core and above reads naturally without naming a second crate.
43pub use escriba_memori::{Anchored, Bound, Bytes, Chars, Offset, Ruler, Scale, Utf16Units};
44pub use mode::{CursorShape, Mode, ModeTransition};
45pub use motion::{Motion, Operator, TextObject};
46pub use position::Position;
47pub use range::Range;
48pub use selection::{Cursor, Cursors, Selection};