Expand description
Mode-keyed pane render dispatch (M.4 follow-up).
Replaces the helper-side match buffer.kind in the renderer’s
draw_pane_content /
crate::app::App::pane_status_label with a ModeId-keyed
lookup. Each major / minor mode that owns its own render flow
registers a PaneRenderProvider at boot; the renderer walks
the active buffer’s minors (most-specific first) then its major
to find the provider, falling back to the document path when no
provider matches. Plugins (post-1.0) register additional modes
through the same registry.
Lives in lattice-ui-tui rather than lattice-mode because the
function signatures take ratatui types (Frame, Rect) – the
mode crate stays renderer-agnostic. A future renderer (GPUI,
web) gets its own registry with its own native signatures; the
ModeId keys are shared so the registration story is uniform
across renderers.
Structs§
- Pane
Render Provider - One mode’s pane-render contribution. Kept paired so a mode owns
both its content rendering and its status label – the two are
almost always defined together (a help pane wants
[help]in the status; a file-tree pane wants[tree] /path/to/root). - Pane
Render Registry - Boot-time registry. Owned by
App; keyed byModeId.
Type Aliases§
- Pane
Render Fn - Renderer for one pane. Receives the same arguments as the
dispatcher in
crate::render::draw_pane_content: the frame, content rect, app state, the active document snapshot (used by the document fallback path), the pane state, anis_activeflag, and the pane index (for inactive-pane stash lookups). - Pane
Status Fn - Status-line label for one pane. Returned to the renderer’s
draw_pane_status_lineso it can paint the bottom row.