Skip to main content

Module pane_render

Module pane_render 

Source
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§

PaneRenderProvider
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).
PaneRenderRegistry
Boot-time registry. Owned by App; keyed by ModeId.

Type Aliases§

PaneRenderFn
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, an is_active flag, and the pane index (for inactive-pane stash lookups).
PaneStatusFn
Status-line label for one pane. Returned to the renderer’s draw_pane_status_line so it can paint the bottom row.