Expand description
lattice-host – the renderer-agnostic editor substrate.
This crate is the home of the editor’s logic: App state,
dispatch, picker sources, mode lifecycle, LSP coordination,
options cascade, keymap registry, buffer registry, folds,
search, completion engine, file ops, oil + file-tree state.
It depends on lattice-core, lattice-grammar,
lattice-config, lattice-mode, lattice-picker,
lattice-completion, lattice-lsp, lattice-runtime,
lattice-syntax, and the other domain crates. It does not
depend on any renderer crate – lattice-ui-tui and the
future lattice-ui-gpui both depend on this, never the other
way around.
The public entry point (Phase 5.6+) will be:
pub fn run(app: App, renderer: impl lattice_render::Renderer) -> Result<()>§Phase 5 status
Phase 5.1 (this slice): the crate is empty. The seam exists;
the workspace builds with the new crate declared; downstream
consumers can depend on it. Phase 5.2 begins the actual
migration of renderer-agnostic modules out of
lattice-ui-tui.
See docs/dev/architecture/phase-5-extraction.md for the
slice plan and module classification.
Re-exports§
pub use renderer::MinimalRenderer;pub use renderer::Renderer;
Modules§
- action
- Action enum – the dispatch language of the editor.
- actions
- App-side action registrations – the
CommandKind::Actionpeers of the grammar’s built-in motions / operators / text- objects (lattice_grammar::builtins) and built-in ex-commands (lattice_grammar::ex_commands). - activator
- M.2.b.2 (2026-06-01):
impl ModeActivator for Editor. - autoread
- Autoread — external-change detection + refresh for file-backed
Document buffers (vim’s
autoread). - boot_
context - Boot-composition: the
BootContext— the host’s generic-primitive surface. - buffer_
registry - Unified buffer registry (DESIGN.md §5.9).
- buffers
- Buffer kind + id + flags – moved from
lattice-ui-tuito the renderer-agnostic substrate in Phase 5.2 first wave. - cells_
worker - Background cell-builder worker — replaces per-frame
shape_linewith an off-thread cell matrix build. - chord
- Re-export shim for the chord primitives.
- command_
line_ expand_ mode - MB.2 (rich minibuffer, tier 2):
command-line-expand-mode. - command_
line_ mode - MB.1 (rich minibuffer, tier 1):
command-line-mode. - cursor_
shape - Vim-style cursor shape derived from
ModalState. - dashboard
- Host-side applier for the
*dashboard*launch page (DB.2). - decline
- AP.0.2 — the layer peel behind
Effect::Declined, in one place. - diagnostics_
query - L4b (lsp-architecture.md §15): host-side
lattice_lsp::modes::DiagnosticsQueryimpl backinglsp-diagnostics-mode’s mode-ownedglhandler. - diff
- Host façade over the diff subsystem, which now lives in the
lattice-diffcrate (moved out oflattice-hostat BC.6/DX.6). - dispatch
- Renderer-neutral action dispatch.
- display_
matrix - Per-line display cache — the substrate that retires the
per-character
lattice_cells::CellMatrix. - editor
- editor_
actor EditorActor— the editor runs on its own thread.- error_
list - CM.2 (2026-07-22): the error list — a persistent,
cross-file list of navigable locations with an index, walked by
generic host dispatch (
:cnext/:cprev/:ccand the Builtin]q/[qchords). - excommand
- Phase 2->3 ex-command parser.
- file_
tree - File-tree buffer model – re-exported from
lattice-file-tree. - fold_
provider - D.3.f.0 (2026-05-29):
FoldProvidersubstrate. - folds
- Computed folds (DESIGN.md §5.1, §15:18; user-facing reference
at
docs/user/folding.md). - grep_
highlight - PH.3: concrete grep-preview highlighter.
- help
- Help buffer model – re-exported from
lattice-help. - help_
topics - Help topic registry – re-exported from
lattice-help::topics. - highlights
- Phase 5.8.AF.6 / Slice X2.6: this module is intentionally empty
after the legacy
refresh_highlights_window+VisibleHighlightsKeywere retired. display-line B4.2: the worker-published visible-spans cell this module used to point at was also deleted (the dead span/ row prepaint cache); syntax colour now flows through the cells /DisplayMatrixsubstrate, and overlay backgrounds throughlattice_host::overlay_worker. The path is renderer-agnostic; noEditormethod is needed for it. - host_
generators - App-state-dependent completion generators.
- indent_
guides - Indentation guides — the per-pane layer both renderers paint from.
- input
- Translate canonical
KeyChordvalues intoActions. - keymap
- Re-export shim for the static keymap catalog +
keymap_entry!macro. - keymap_
cancel - CG.1 — the foreground-cancel binding (
<C-g>). - keymap_
entry - Static keymap catalog +
keymap_entry!macro (DESIGN.md §5.2.3). - keymap_
help - K.3.2 (2026-06-02): help-prefix (
<C-h>map) bindings. - keymap_
insert - Insert-mode binding registration + drift-test helpers.
- keymap_
mode_ contributions - K.2.4 — host translation pass for mode-contributed keymaps.
- keymap_
normal - Normal-mode binding registration + lookup helper.
- keymap_
registry - Re-export shim —
KeymapCapability,KeymapError,KeymapHandle,KeymapRegistry,LayerId, andPushLayerKindmoved tolattice-keymapin K.3 (2026-06-07).KeymapReverseLookupHandlestays here because it implementslattice_completion::KeymapReverseLookup—lattice-keymapcannot depend onlattice-completion. - keymap_
replace - Replace-mode binding registration + drift-test helpers.
- keymap_
select - Select-mode dispatch (SN.3d.1).
- keymap_
terminal - Keystroke → ANSI byte encoder for Terminal-Insert mode.
- keymap_
trie - Re-export shim —
KeymapTrie,KeymapLayer,BoundCommand, andLookupResultmoved tolattice-keymapin K.3 (2026-06-07). Existinguse crate::keymap_trie::{...}callers in this crate continue to work unchanged. - keymap_
visual - Visual-mode binding registration + drift-test helpers.
- lsp_
helpers - Phase 5.5.LSP.1 step 2: pure LSP utility helpers, lifted from
lattice_ui_tui::app. These functions translate between the editor’s internal byte-indexed shapes andlsp-types’s wire shapes (UTF-16 column positions, hover-content markdown). They depend only onlattice_core::Buffer,lattice_grammar::Position, andlattice_lsp::position– all host-side – so they have no reason to live in the renderer crate. - lsp_
watcher - LSP file-watcher subsystem (Phase 5.8.AF.5 / Slice 1).
- messages
*messages*buffer management onEditor.- mode_
action_ handlers - SN.3c.0: boot-time registration of modes’ declarative global
action handlers (
Mode::action_handlers). - modeline
- Built-in modeline element vocabulary + shared per-pane content resolution (slice ML.1a-render).
- modes
- Major modes for buffer kinds owned by the TUI layer.
- mouse
- MO.2: editor-body mouse hit-testing.
- oil
- Oil buffer model – re-exported from
lattice-oil. - operator_
chord_ wirer - CM.2: the host’s answer to a plugin operator that declared a chord.
- overlay_
worker - Background overlay worker — static-overlay bucketing off the UI thread.
- pane
- M.4 follow-up: pane geometry moved to
lattice-core::ui::pane. Re-exported here for transitional compatibility. - pane_
group - D.4.a (2026-05-29): pane-group substrate.
- pane_
history - PBH.1: per-pane buffer history — the trail of buffers one pane has
shown, walkable with
<C-6>(back) /<C-7>(forward). - pane_
render - Mode-keyed pane render resolution (renderer-agnostic algorithm).
- per_
buffer_ cache PerBufferCache<T>— per-buffer cache primitive for the 5.8.AF.5 Slice 3b migration.- popup
- Popup placement model – re-exported from
lattice-core::ui::popup. - preview
- Preview isolation (PI series).
- prompt_
line_ mode prompt-line-mode: the generic one-line minibuffer text prompt backingEffect::OpenPrompt.- render_
state RenderState— the renderer’s read contract with the host.- renderer
- The host-side
Renderertrait. - search_
line_ mode - MB.5a (rich minibuffer):
search-line-mode. - state
- Small App-helper state types – pure data, no renderer coupling.
- sticky_
context - TC.3b — the sticky-context layer both renderers paint from.
- synthetic_
buffers - Synthetic-buffer management on
Editor. - tutor
- Tutor subsystem — session data, minor mode, headerline, and score persistence.
- ui
- Renderer-neutral UI types: theme, style, color.
- vcs
- Layer 2 VCS subsystem — auto-inline-diff against HEAD.
- versioned
Versioned<T>— a tiny newtype wrapper that bumps a monotonicu64version on every&mutaccess viaDerefMut.- virtual_
rows_ worker - D.0a.1 (2026-05-29) — Virtual-rows worker.
- visual
- Visual-mode selection helpers — renderer-neutral computation
of the highlighted range when
editor.modal == Visual(_). - wasm_
context - TC.3a — WASM sticky context: producer → per-buffer scope cache → resolver.
- wasm_
decorations - PL8.E — WASM gutter decorations: producer → per-buffer cache → renderer.
- wasm_
media - IM.7 — WASM inline media: producer → per-buffer blocks → virtual rows.
Macros§
- keymap_
entry - Construct a
KeymapEntrywith the row’s source location captured at the macro invocation site. Forms:
Functions§
- disable_
autoload - Suppress boot-time plugin auto-discovery for this process.
- flush_
plugin_ stores - Write out every plugin’s store before the process exits.