MingaEditor.SemanticWindow.Selection (Minga v0.1.0)

Copy Markdown View Source

Visual selection overlay in display coordinates.

Sent as coordinate ranges so the GUI can render selection as Metal quads behind text, avoiding line re-rasterization when the selection changes.

Summary

Functions

Builds a selection from the render context's visual_selection.

Types

selection_type()

@type selection_type() :: :char | :line | :block

t()

@type t() :: %MingaEditor.SemanticWindow.Selection{
  end_col: non_neg_integer(),
  end_row: non_neg_integer(),
  start_col: non_neg_integer(),
  start_row: non_neg_integer(),
  type: selection_type()
}

Functions

from_visual_selection(arg1, viewport_top)

@spec from_visual_selection(
  nil
  | {:char, {non_neg_integer(), non_neg_integer()},
     {non_neg_integer(), non_neg_integer()}}
  | {:line, non_neg_integer(), non_neg_integer()},
  non_neg_integer()
) :: t() | nil

Builds a selection from the render context's visual_selection.