# `Minga.Buffer.Position`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga/buffer/position.ex#L1)

Resolves editor positions into concrete places in document text.

A position is still stored as `{line, column}` for the rest of the editor, but this module owns the translation between that editor-facing coordinate and the document's internal text point.

# `point`

```elixir
@type point() :: non_neg_integer()
```

An absolute point in the document text.

# `t`

```elixir
@type t() :: {line :: non_neg_integer(), column :: non_neg_integer()}
```

A zero-indexed editor position.

# `after_character_at`

```elixir
@spec after_character_at(String.t(), point()) :: point()
```

Returns the point immediately after the character at `point`.

# `display_column`

```elixir
@spec display_column(Minga.Buffer.Document.t(), t()) :: non_neg_integer()
```

Returns the on-screen column for an editor position.

# `from_point`

```elixir
@spec from_point(Minga.Buffer.Document.t(), point()) :: t()
```

Returns the editor position at a document point.

# `last_character_on_line`

```elixir
@spec last_character_on_line(String.t()) :: non_neg_integer()
```

Returns the position of the last selectable character on a line.

# `point_for`

```elixir
@spec point_for(Minga.Buffer.Document.t(), t()) :: point()
```

Returns the document point for an editor position.

# `point_in`

```elixir
@spec point_in(
  Minga.Buffer.Lines.line_starts(),
  non_neg_integer(),
  non_neg_integer(),
  non_neg_integer()
) :: point()
```

Returns the document point for an editor position against an existing line index.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
