Skip to main content

Module types

Module types 

Source
Expand description

Core types for the planned 0.1.0 trait surface (per SPEC.md).

These are introduced alongside the legacy sqeel-vim public API. The trait extraction (phase 5) progressively rewires the existing FSM and Editor to operate on Selection / SelectionSet / Edit / Pos. Until that work lands, the legacy types in [crate::editor] and [crate::vim] remain authoritative.

Structs§

Attrs
BufferId
Opaque buffer identifier owned by the host. Engine echoes it back in Host::Intent variants for buffer-list operations (SwitchBuffer, etc.). Generation is the host’s responsibility.
Color
ContentEdit
Engine-native representation of a single buffer mutation in the shape tree-sitter’s InputEdit consumes. Emitted by crate::Editor::mutate_edit and drained by hosts via crate::Editor::take_content_edits so the syntax layer can fan edits into a retained tree without the engine taking a tree-sitter dependency.
DefaultHost
Default no-op Host implementation. Suitable for tests, headless embedding, or any host that doesn’t yet need clipboard / cursor-shape / cancellation plumbing.
Edit
A pending or applied edit. Multi-cursor edits fan out to Vec<Edit> ordered in reverse byte offset so each entry’s positions remain valid after the prior entry applies.
EditorSnapshot
Coarse editor snapshot suitable for serde round-tripping.
Highlight
Modifiers
Modifier bits accompanying every keystroke.
MouseEvent
NoopFoldProvider
No-op FoldProvider for hosts that don’t expose folds. Every row is visible; is_row_hidden always returns false.
Options
Editor settings surfaced via :set. Per SPEC. Consumed once trait extraction lands; today’s legacy Settings (in [crate::editor]) continues to drive runtime behaviour.
Pos
Grapheme-indexed position. line is zero-based row; col is zero-based grapheme column within that line.
RenderFrame
Engine render frame consumed by the host once per redraw.
Selection
A single anchored selection. Empty (caret-only) when anchor == head.
SelectionSet
Ordered set of selections. Always non-empty in valid states; primary indexes the cursor visible to vim mode.
Style
Engine-native style. Replaces direct ratatui Style use in the public API once phase 5 trait extraction completes; until then both coexist.
Viewport
Visible region of a buffer — the runtime viewport state the host owns and mutates per render frame.

Enums§

CursorShape
Cursor shape intent emitted on mode transitions. Hosts honor it via Host::emit_cursor_shape once the trait extraction lands.
EngineError
Errors surfaced from the engine to the host. Intentionally narrow — callsites that fail in user-facing ways return Result<_, EngineError>; internal invariant breaks use debug_assert!.
FoldOp
Canonical fold-mutation op carried through FoldProvider::apply.
HighlightKind
Highlight kind emitted by the engine’s render pass. The host’s style resolver picks colors for Selection/SearchMatch/etc.; Syntax(id) carries an opaque host-supplied id whose styling lives in the host.
Input
Single input event handed to the engine.
Mode
Vim editor mode. Distinct from the legacy crate::VimMode — that one is the host-facing status-line summary; this is the engine’s internal state machine.
MouseKind
OptionValue
Typed value for Options::set_by_name / Options::get_by_name.
SelectionKind
What kind of region a Selection covers.
SnapshotMode
Status-line mode summary. Bridges to the legacy crate::VimMode without leaking the full FSM type into the snapshot wire format.
SpecialKey
Special key codes — anything that isn’t a printable character.
WrapMode
Soft-wrap mode for the renderer + scroll math + gj / gk. Engine-native equivalent of hjkl_buffer::Wrap; the engine converts at the boundary to the buffer’s runtime wrap setting.

Traits§

Buffer
Buffer super-trait — the pre-1.0 contract every backend implements.
BufferEdit
Mutating sub-trait of Buffer. Distinct trait name from the crate-root Edit struct — this one carries methods, the other is a value type.
Cursor
Cursor sub-trait of Buffer. Pre-0.1.0; signature follows SPEC.md §“Buffer trait surface”.
FoldProvider
Fold-iteration + mutation trait. The engine asks “what’s the next visible row” / “is this row hidden” through this surface, and dispatches fold mutations through FoldProvider::apply, so fold storage can live wherever the host pleases (on the buffer, in a separate host-side fold tree, or absent entirely).
Host
Host adapter consumed by the engine. Lives behind the planned Editor<B: Buffer, H: Host> generic; today it’s the contract that buffr-modal::BuffrHost and the (future) sqeel-tui Host impl align against.
Query
Read-only query sub-trait of Buffer.
Search
Search sub-trait of Buffer. The pattern is owned by the engine (see SPEC.md “Open issues”); buffers do not cache compiled regexes.