Builds a RenderWindow from the same data the Content stage uses.
Called during build_window_content/2 when the frontend has GUI
capabilities. Captures the pre-resolved semantic data that the GUI
needs, without duplicating the draw logic.
The builder reads from:
WindowScroll(viewport, lines, cursor, fold map, visible_line_map)Context.t()(visual selection, search matches, highlight, decorations)- Buffer diagnostics (for inline ranges)
All positions are converted to display coordinates (relative to the window's content rect, with fold/wrap adjustments applied).
Summary
Functions
Builds a RenderWindow for one editor window.
Builds a RenderWindow and reports retained-row statistics (#2287).
Returns the source buffer position for a click in wrapped composed rows.
Types
@type build_stats() :: MingaEditor.RenderModel.Window.BuildResult.t()
@type state() :: MingaEditor.State.t() | MingaEditor.RenderPipeline.Input.t()
Functions
@spec build( state(), MingaEditor.RenderPipeline.Scroll.WindowScroll.t(), MingaEditor.Renderer.Context.t(), keyword() ) :: Minga.RenderModel.Window.t()
Builds a RenderWindow for one editor window.
Called from the Content stage with the same WindowScroll and
Context that drive the draw-based rendering.
@spec build_with_stats( state(), MingaEditor.RenderPipeline.Scroll.WindowScroll.t(), MingaEditor.Renderer.Context.t(), keyword() ) :: {Minga.RenderModel.Window.t(), build_stats()}
Builds a RenderWindow and reports retained-row statistics (#2287).
Identical output to build/4 but also returns how many rows were freshly
rasterized and the retained-row map to carry into the next frame. Pass the
previous frame's retained rows via the :retained_rows option so unchanged
rows are reused verbatim instead of being recomposed.
@spec wrapped_source_position( [String.t()], non_neg_integer(), non_neg_integer(), non_neg_integer(), MingaEditor.Renderer.Context.t(), map() ) :: {:ok, non_neg_integer(), non_neg_integer()} | :error
Returns the source buffer position for a click in wrapped composed rows.