Skip to main content

Module pane_render

Module pane_render 

Source
Expand description

Mode-keyed pane render resolution (renderer-agnostic algorithm).

Phase 5.6: the algorithm that walks a buffer’s active modes (minors most-recently-activated first, then the major) lives host-side here; the per-renderer storage of provider fn-pointers stays renderer-specific (TUI uses ratatui::Frame-typed fns; a future GPUI renderer will use its own native shapes). Renderers implement ProviderLookup over their own registry and call resolve_pane_render_mode to find the ModeId whose provider should drive a pane.

See docs/dev/architecture/phase-5-extraction.md “Hard Case §2” → “Post-Option-E revision (slice 5.6)”. The trait-object plan from the original draft is superseded — composition made the registry naturally renderer-specific, so the only shared piece is the mode-walking lookup.

Traits§

ProviderLookup
Renderer-supplied “is this mode registered?” probe. Each renderer implements this trait on its own typed pane-render registry; the host walks modes via resolve_pane_render_mode and asks the probe whether the candidate ModeId has a provider.

Functions§

resolve_pane_render_mode
Resolve the ModeId whose pane-render provider should drive the pane displaying buffer_id. Walks active minors in reverse activation order (most-recently activated wins — same priority the option resolver uses) before falling back to the major. Returns None when no active mode has a provider registered, in which case the renderer uses its default document path.