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
- Buffer
Id - Opaque buffer identifier owned by the host. Engine echoes it back
in
Host::Intentvariants 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. - Editor
Snapshot - Coarse editor snapshot suitable for serde round-tripping.
- Highlight
- Modifiers
- Modifier bits accompanying every keystroke.
- Mouse
Event - Options
- Editor settings surfaced via
:set. Per SPEC. Consumed once trait extraction lands; today’s legacySettings(in [crate::editor]) continues to drive runtime behaviour. - Pos
- Grapheme-indexed position.
lineis zero-based row;colis zero-based grapheme column within that line. - Render
Frame - Engine render frame consumed by the host once per redraw.
- Selection
- A single anchored selection. Empty (caret-only) when
anchor == head. - Selection
Set - Ordered set of selections. Always non-empty in valid states;
primaryindexes the cursor visible to vim mode. - Style
- Engine-native style. Replaces direct ratatui
Styleuse in the public API once phase 5 trait extraction completes; until then both coexist. - Viewport
- Visible region of a buffer. The host writes
top_lineandheightper render frame; the engine reads to decide where the cursor must land for visibility (cf.scroll_off).
Enums§
- Cursor
Shape - Cursor shape intent emitted on mode transitions. Hosts honor it via
Host::emit_cursor_shapeonce the trait extraction lands. - Engine
Error - Errors surfaced from the engine to the host. Intentionally narrow —
callsites that fail in user-facing ways return
Result<_, EngineError>; internal invariant breaks usedebug_assert!. - Highlight
Kind - 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. - Mouse
Kind - Option
Value - Typed value for
Options::set_by_name/Options::get_by_name. - Selection
Kind - What kind of region a
Selectioncovers. - Snapshot
Mode - Status-line mode summary. Bridges to the legacy
crate::VimModewithout leaking the full FSM type into the snapshot wire format. - Special
Key - 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 thatbuffr-modal::BuffrHostand the (future)sqeel-tuiHost impl align against.