MingaEditor.DisplayList (Minga v0.1.0)

Copy Markdown View Source

Cell-grid draw primitives for chrome surfaces.

The buffer/window render path is fully semantic: editor windows build Minga.RenderModel.Window models that frontend adapters encode directly (see MingaEditor.RenderPipeline.Content and RenderModel.Window.Builder). The dead cell-grid window carriers (Frame, WindowFrame) and their line producers were removed in #2241.

The per-surface chrome painters (completion menu, dashboard, hover/signature popups, modeline, tab bar, float popups, etc.) were deleted in #2311; the semantic frontends render those surfaces natively. draw/4 and the Overlay carrier are retained for the remaining legitimate consumers:

  • Renderer.Gutter — the styled-run gutter draw primitives (line numbers and git signs) emitted alongside the semantic window model.
  • Minga.Core.Decorations.BlockDecoration — raw draw tuples for extension block decorations.
  • FloatingWindow.Spec / HoverPopup / SignatureHelp — the :content draw list type used to compute popup geometry for box/3.
  • RenderPipeline.Chrome / ComposeHelpers — the Overlay carrier, whose cursor field still resolves the picker cursor in Compose.
  • The Board and Git Porcelain extension shell renderers.

Types

  • draw() — a pending draw: {row, col, text, style}.
  • text_run() — column + text + style (no row; row is the map key).
  • display_line() — a list of text runs for one screen row.
  • render_layer() — rows mapped to their display lines.

Summary

Types

RGB color as a 24-bit integer (e.g. 0xFF6C6B).

All text runs on one screen row.

A pending draw command: {row, col, text, Face.t()}.

Screen rows mapped to their display lines.

Style: a resolved Face struct.

A single styled text span at a specific column.

Functions

Creates a draw tuple with a Face style.

Types

color()

@type color() :: non_neg_integer()

RGB color as a 24-bit integer (e.g. 0xFF6C6B).

display_line()

@type display_line() :: [text_run()]

All text runs on one screen row.

draw()

A pending draw command: {row, col, text, Face.t()}.

This is the intermediate representation that chrome-surface painters produce.

render_layer()

@type render_layer() :: %{required(non_neg_integer()) => display_line()}

Screen rows mapped to their display lines.

style()

@type style() :: Minga.Core.Face.t()

Style: a resolved Face struct.

text_run()

@type text_run() ::
  {col :: non_neg_integer(), text :: String.t(), style :: Minga.Core.Face.t()}

A single styled text span at a specific column.

Functions

draw(row, col, text, face \\ Face.new())

Creates a draw tuple with a Face style.

Examples

iex> DisplayList.draw(0, 5, "hello")
{0, 5, "hello", %Face{name: "_"}}

iex> DisplayList.draw(0, 5, "hello", Face.new(fg: 0xFF0000, bold: true))
{0, 5, "hello", %Face{name: "_", fg: 0xFF0000, bold: true}}