# `Minga.Editing.Motion.VisualLine`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga/editing/motion/visual_line.ex#L1)

Visual-line motions for soft word-wrapping.

When word-wrap is enabled, a single logical line may span multiple
screen rows. These functions move the cursor by visual rows rather
than logical lines, keeping the cursor at the same visual column
(or as close as possible) across wrapped rows.

These replace `j`/`k` when wrap is on. The original `j`/`k` behavior
(logical line movement) is available via `gj`/`gk`.

# `position`

```elixir
@type position() :: Minga.Buffer.Document.position()
```

# `visual_down`

```elixir
@spec visual_down(Minga.Buffer.Document.t(), position(), pos_integer()) :: position()
```

Move down by one visual row within a wrapped buffer.

If the cursor is on a visual row that has more rows below it (within
the same logical line), moves to the next visual row. Otherwise moves
to the first visual row of the next logical line.

# `visual_line_end`

```elixir
@spec visual_line_end(Minga.Buffer.Document.t(), position(), pos_integer()) ::
  position()
```

Move to the end of the current visual row.

When the cursor is on a visual row within a wrapped line, moves to
the last column of that visual row.

# `visual_line_start`

```elixir
@spec visual_line_start(Minga.Buffer.Document.t(), position(), pos_integer()) ::
  position()
```

Move to the start of the current visual row.

When the cursor is on a continuation row of a wrapped line, moves to
the first column of that visual row (not the logical line start).

# `visual_up`

```elixir
@spec visual_up(Minga.Buffer.Document.t(), position(), pos_integer()) :: position()
```

Move up by one visual row within a wrapped buffer.

If the cursor is on a visual row that has rows above it (within the
same logical line), moves to the previous visual row. Otherwise moves
to the last visual row of the previous logical line.

---

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