# `MingaEditor.State.Registers`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/state/registers.ex#L1)

Groups register-related fields from EditorState.

Tracks the named register store and the currently selected register
(set by `"x` before an operator).

Each register entry is a `{text, type}` tuple where type is `:charwise`
or `:linewise`. Linewise entries (from `yy`, `dd`, visual-line yank)
paste as new lines; charwise entries paste inline at the cursor.

# `entry`

```elixir
@type entry() :: {String.t(), reg_type()}
```

A register entry: text content paired with its paste type.

# `reg_type`

```elixir
@type reg_type() :: :charwise | :linewise
```

Whether register content should paste as whole lines or inline text.

# `registers`

```elixir
@type registers() :: %{required(String.t()) =&gt; entry()}
```

Register store. Keys are register names:
- `""` — unnamed (default)
- `"0"` — last yank
- `"a"`–`"z"` — named
- `"+"` — system clipboard (virtual; read/write via Minga.Clipboard)
- `"_"` — black hole (never stored)

# `t`

```elixir
@type t() :: %MingaEditor.State.Registers{active: String.t(), registers: registers()}
```

# `get`

```elixir
@spec get(t(), String.t()) :: entry() | nil
```

Gets the entry for the named register `name`. Returns `{text, type}` or `nil`.

# `put`

```elixir
@spec put(t(), String.t(), String.t(), reg_type()) :: t()
```

Puts `text` into the named register `name` with the given type.

# `reset_active`

```elixir
@spec reset_active(t()) :: t()
```

Resets the active register selection to unnamed.

# `set_active`

```elixir
@spec set_active(t(), String.t()) :: t()
```

Sets the active register to `name`.

---

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