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
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
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 host writes top_line and height per render frame; the engine reads to decide where the cursor must land for visibility (cf. scroll_off).

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!.
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.

Traits§

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.