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

Copy Markdown View Source

A zero-based logical text position.

utf16_offset counts UTF-16 code units from the beginning of line. It is deliberately explicit so positions can be exchanged with language servers without treating byte, code-point, and UTF-16 offsets as interchangeable.

Summary

Types

t()

@type t() :: %GPUI.Text.Position{
  line: non_neg_integer(),
  utf16_offset: non_neg_integer()
}

Functions

new(line, utf16_offset)

@spec new(non_neg_integer(), non_neg_integer()) :: t()