GPUI.Text.Selection (gpui v0.2.0)

Copy Markdown View Source

A directed selection represented by anchor and head positions.

Summary

Functions

Creates a collapsed selection at a logical position.

Creates a directed selection from anchor to head.

Types

t()

@type t() :: %GPUI.Text.Selection{
  anchor: GPUI.Text.Position.t(),
  head: GPUI.Text.Position.t(),
  id: String.t(),
  primary: boolean()
}

Functions

caret(id, position, opts \\ [])

@spec caret(String.t(), GPUI.Text.Position.t(), keyword()) :: t()

Creates a collapsed selection at a logical position.

new(id, anchor, head, opts \\ [])

Creates a directed selection from anchor to head.