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

Copy Markdown View Source

A highlight span with pre-resolved colors and attributes.

Spans reference display columns in the composed text. They never resolve editor-local resources such as secondary font registrations; builders pass the already-resolved font_id when a span needs one.

Summary

Functions

Builds a span from a Face.t() struct and display-column range.

Clips a span to a source display-column range and rebases it into a visual row.

Types

t()

@type t() :: %Minga.RenderModel.Window.Span{
  attrs: non_neg_integer(),
  bg: non_neg_integer(),
  end_col: non_neg_integer(),
  fg: non_neg_integer(),
  font_id: non_neg_integer(),
  font_weight: non_neg_integer(),
  start_col: non_neg_integer()
}

Functions

from_face(face, start_col, end_col, font_id \\ 0)

Builds a span from a Face.t() struct and display-column range.

rebase_to_visual_row(span, source_start, source_end, indent_width)

@spec rebase_to_visual_row(
  t(),
  non_neg_integer(),
  non_neg_integer(),
  non_neg_integer()
) :: [t()]

Clips a span to a source display-column range and rebases it into a visual row.