GPUI.Text.BlockProjection (gpui v0.2.0)

Copy Markdown View Source

A non-editable block rendered adjacent to an explicit logical text line.

Blocks are visual annotations only. They do not enter the Rope, create visual rows inside text layout, affect selections, or participate in history.

Summary

Functions

Creates a bounded non-editable block adjacent to a logical text line.

Validates a block projection's bounded text and presentation values.

Types

placement()

@type placement() :: :before | :after

rgb()

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

t()

@type t() :: %GPUI.Text.BlockProjection{
  background: rgb() | nil,
  color: rgb(),
  height: pos_integer(),
  line: non_neg_integer(),
  placement: placement(),
  text: String.t()
}

Functions

new(line, text, opts \\ [])

@spec new(non_neg_integer(), String.t(), keyword()) :: t()

Creates a bounded non-editable block adjacent to a logical text line.

validate!(block)

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

Validates a block projection's bounded text and presentation values.