Minga.RenderModel.Window.Row (Minga v0.1.0)

Copy Markdown View Source

A single visual row in the semantic window.

Represents one display row as the GUI should render it. The BEAM has already resolved word wrap, folding, virtual text splicing, and conceal ranges. The text field contains the final composed UTF-8 string.

Row Types

  • :normal — a regular buffer line (or the visible portion after wrapping)
  • :fold_start — a fold summary line (text includes the fold indicator)
  • :virtual_line — an injected virtual line from decorations (no buffer content)
  • :block — a block decoration row rendered by a callback
  • :wrap_continuation — a continuation row from word wrapping

Summary

Functions

Computes a content hash for cache invalidation.

Returns a small discriminator suitable for the low bits of stable_id/4.

Builds a stable row identity for decoration-driven rows.

Builds a compact, deterministic row identity for retained GUI texture reuse.

Types

row_id()

@type row_id() :: non_neg_integer()

row_type()

@type row_type() ::
  :normal | :fold_start | :virtual_line | :block | :wrap_continuation

t()

@type t() :: %Minga.RenderModel.Window.Row{
  buf_line: non_neg_integer(),
  content_hash: non_neg_integer(),
  row_id: row_id(),
  row_type: row_type(),
  spans: [Minga.RenderModel.Window.Span.t()],
  text: String.t(),
  visual_index: non_neg_integer()
}

Functions

compute_hash(text, spans)

@spec compute_hash(String.t(), [Minga.RenderModel.Window.Span.t()]) ::
  non_neg_integer()

Computes a content hash for cache invalidation.

discriminator(value)

@spec discriminator(term()) :: non_neg_integer()

Returns a small discriminator suitable for the low bits of stable_id/4.

stable_decoration_id(row_type, buf_line, decoration_key)

@spec stable_decoration_id(row_type(), non_neg_integer(), term()) :: row_id()

Builds a stable row identity for decoration-driven rows.

stable_id(row_type, buf_line, visual_index \\ 0, discriminator \\ 0)

Builds a compact, deterministic row identity for retained GUI texture reuse.