# `MingaEditor.InlineOverlay.Prompt`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/inline_overlay/prompt.ex#L1)

Shared prompt-input and scroll mechanics for inline overlays.

Inline ask and inline edit edit a `:prompt` string while `:status` is
`:input`, and scroll their body with a `:scroll` offset clamped at zero.
Those transitions only touch fields common to both variant structs, so
they live here once instead of being copied per variant.

Each function takes and returns the variant's own struct, so the variant
modules keep their `@enforce_keys`, kind-specific fields, and terminal
transitions while delegating these shared edits.

# `overlay`

```elixir
@type overlay() :: %{
  :__struct__ =&gt; module(),
  :prompt =&gt; String.t(),
  :status =&gt; atom(),
  :scroll =&gt; non_neg_integer(),
  optional(atom()) =&gt; term()
}
```

An overlay struct carrying `:prompt`, `:status`, and `:scroll`.

# `append_input`

```elixir
@spec append_input(overlay(), String.t()) :: overlay()
```

Appends text to the prompt while the overlay is accepting input.

# `backspace`

```elixir
@spec backspace(overlay()) :: overlay()
```

Deletes one prompt grapheme while the overlay is accepting input.

# `scroll`

```elixir
@spec scroll(overlay(), integer()) :: overlay()
```

Scrolls the overlay body, clamped at zero.

---

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