Minga.RenderModel.Window (Minga v0.1.0)

Copy Markdown View Source

Canonical visible model for one buffer-like window.

The Content stage builds this model from current-frame data. Frontend adapters encode it for GUI or composite it into cells for TUI proof-of-concept paths. The struct is pure data and lives in core so products can produce window content without importing MingaEditor.

Summary

Types

content_kind()

@type content_kind() :: :buffer | :agent_chat | :agent_prompt

cursor_shape()

@type cursor_shape() :: :block | :beam | :underline

rect()

@type rect() ::
  {row :: non_neg_integer(), col :: non_neg_integer(),
   width :: non_neg_integer(), height :: non_neg_integer()}

t()

@type t() :: %Minga.RenderModel.Window{
  annotations: [Minga.RenderModel.Window.Annotation.t()],
  content_epoch: non_neg_integer(),
  content_kind: content_kind(),
  cursor_col: non_neg_integer(),
  cursor_row: non_neg_integer(),
  cursor_shape: cursor_shape(),
  cursor_visible: boolean(),
  cursorline: Minga.RenderModel.Window.Cursorline.t() | nil,
  diagnostic_ranges: [Minga.RenderModel.Window.DiagnosticRange.t()],
  document_highlights: [Minga.RenderModel.Window.DocumentHighlight.t()],
  full_refresh: boolean(),
  geometry: Minga.RenderModel.Window.PaneGeometry.t() | nil,
  gutter: Minga.RenderModel.Window.Gutter.t() | nil,
  indent_guides: Minga.RenderModel.Window.IndentGuides.t() | nil,
  rect: rect(),
  rows: [Minga.RenderModel.Window.Row.t()],
  scroll_left: non_neg_integer(),
  search_matches: [Minga.RenderModel.Window.SearchMatch.t()],
  selection: Minga.RenderModel.Window.Selection.t() | nil,
  window_id: pos_integer()
}