MingaEditor.Renderer.TextPresentation (Minga v0.1.0)

Copy Markdown View Source

Immutable source correspondence retained for frontend text-pointer input.

Summary

Functions

Resolves one rank-addressed row after verifying its durable row id.

Resolves one already-located visual row through the shared source mapping.

Reuses the prior presentation only when its immutable interaction identity matches.

Types

rows()

@type rows() ::
  {:resident, MingaEditor.RenderModel.Window.ResidentStore.t()}
  | {:windowed, tuple()}

t()

@type t() :: %MingaEditor.Renderer.TextPresentation{
  buffer: pid(),
  identity: term(),
  presentation_id: pos_integer(),
  rows: rows(),
  source_version: non_neg_integer(),
  window_id: MingaEditor.Window.id()
}

Functions

new(window_id, buffer, source_version, identity, rows)

@spec new(MingaEditor.Window.id(), pid(), non_neg_integer(), term(), rows()) :: t()

resolve(presentation, row_index, row_id, utf16_offset)

@spec resolve(t(), non_neg_integer(), non_neg_integer(), non_neg_integer()) ::
  {:ok, MingaEditor.Mouse.Target.Text.t()}
  | {:error, :row_not_found | :row_id_mismatch | :not_source_backed}

Resolves one rank-addressed row after verifying its durable row id.

resolve_row(window_id, buffer, source_version, row, row_id, utf16_offset)

@spec resolve_row(
  MingaEditor.Window.id(),
  pid(),
  non_neg_integer(),
  MingaEditor.RenderModel.Window.VisualRow.t(),
  non_neg_integer(),
  non_neg_integer()
) ::
  {:ok, MingaEditor.Mouse.Target.Text.t()}
  | {:error, :row_id_mismatch | :not_source_backed}

Resolves one already-located visual row through the shared source mapping.

retain(presentation, window_id, buffer, version, identity, rows)

@spec retain(
  t() | nil,
  MingaEditor.Window.id(),
  pid(),
  non_neg_integer(),
  term(),
  rows()
) :: t()

Reuses the prior presentation only when its immutable interaction identity matches.