Skip to main content

Module types

Module types 

Source
Expand description

Core types for the engine trait surface.

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] 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 hjkl_engine::Editor::mutate_edit and drained by hosts via hjkl_engine::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<EngineEdit> 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
ListChars
Invisibles rendering configuration for :set list / :set listchars.
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.
DiagInlineMode
Inline diagnostic ghost-text mode. Controls where the end-of-line // … diagnostic message is shown (Error-Lens style). Matches :set diagnostics_inline=off|current|all.
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!.
FoldMethod
Fold method. Controls how folds are automatically generated. Matches vim’s :set foldmethod.
FoldOp
A fold operation dispatched by the engine’s z… keystrokes, :fold* ex commands, and the edit-pipeline’s “edits inside a fold open it” invalidation.
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.
InsertDir
Direction for insert-mode arrow movement.
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.
ScrollDir
Scroll direction for scroll_full_page, scroll_half_page, and scroll_line controller methods.
SelectionKind
What kind of region a Selection covers.
SignColumnMode
Sign-column display mode. Controls whether a 1-cell gutter is reserved for diagnostic and git signs. Matches vim’s :set signcolumn.
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.

Constants§

CHANGE_LIST_MAX
JUMPLIST_MAX
Max jumplist depth. Matches vim default.
SEARCH_HISTORY_MAX

Traits§

BufferEdit
Mutating sub-trait of View. Distinct trait name from the crate-root Edit struct — this one carries methods, the other is a value type.
Cursor
Cursor sub-trait of View.
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: View, 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 View.
Search
Search sub-trait of View. The pattern is owned by the engine; buffers do not cache compiled regexes.
View
View super-trait — the pre-1.0 contract every backend implements.