MingaEditor.SemanticWindow.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 (after virtual text splicing and conceal application). The GUI frontend applies these spans directly when building NSAttributedString; it never maps syntax tokens to theme colors.

Attributes byte layout

The attrs field packs boolean flags into a single byte:

  • bit 0: bold
  • bit 1: italic
  • bit 2: underline
  • bit 3: strikethrough
  • bit 4: underline_curl (wavy diagnostic underline)

Summary

Functions

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

Types

t()

@type t() :: %MingaEditor.SemanticWindow.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)

@spec from_face(Minga.Core.Face.t(), non_neg_integer(), non_neg_integer()) :: t()

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