GPUI.Text.RichRun (gpui v0.2.0-rc.1)

Copy Markdown View Source

A neutral shaping run for immutable rich text.

The half-open range uses zero-based {line, utf16_offset} positions. Runs carry renderer facts only; Markdown, syntax, diagnostics, and product policy remain consumer-owned. link is an opaque bounded application value emitted through the rich text component's ordinary link event.

Summary

Functions

Validates the bounded styles, colors, range, and optional link of a rich run.

Types

rgb()

@type rgb() :: 0..16_777_215

t()

@type t() :: %GPUI.Text.RichRun{
  background: rgb() | nil,
  color: rgb() | nil,
  font_style: atom() | nil,
  font_weight: atom() | nil,
  link: String.t() | nil,
  range: GPUI.Text.Range.t(),
  strikethrough: rgb() | nil,
  underline: rgb() | nil,
  underline_style: underline_style() | nil
}

underline_style()

@type underline_style() :: :solid | :wavy

Functions

new(range, opts \\ [])

@spec new(
  GPUI.Text.Range.t(),
  keyword()
) :: t()

validate!(run)

@spec validate!(t()) :: :ok

Validates the bounded styles, colors, range, and optional link of a rich run.