# `Minga.Core.Decorations.FoldRegion`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga/core/decorations/fold_region.ex#L1)

A buffer-level fold region decoration: a collapsible range with a
custom placeholder.

Unlike per-window folds (managed by `FoldMap`), decoration folds are
per-buffer. Every window showing the buffer sees the same fold state.
This is the right model for agent chat thinking blocks, tool output,
and other decoration-driven collapsible content.

The `placeholder` callback receives the fold's start line, end line,
and available width, and returns styled segments for the summary line
shown when the fold is closed.

# `placeholder_fn`

```elixir
@type placeholder_fn() ::
  (non_neg_integer(), non_neg_integer(), pos_integer() -&gt;
     [{String.t(), Minga.Core.Face.t()}])
  | nil
```

Placeholder render callback for a closed fold region.

Receives (start_line, end_line, width) and returns styled segments.
When nil, the default placeholder "··· N lines" is used.

# `t`

```elixir
@type t() :: %Minga.Core.Decorations.FoldRegion{
  closed: boolean(),
  end_line: non_neg_integer(),
  group: term() | nil,
  id: reference(),
  placeholder: placeholder_fn(),
  start_line: non_neg_integer()
}
```

# `contains?`

```elixir
@spec contains?(t(), non_neg_integer()) :: boolean()
```

Returns true if the given buffer line is within this fold (start inclusive, end inclusive).

# `hidden_count`

```elixir
@spec hidden_count(t()) :: non_neg_integer()
```

Returns the number of lines hidden when this fold is closed.

# `hides?`

```elixir
@spec hides?(t(), non_neg_integer()) :: boolean()
```

Returns true if the given buffer line is hidden by this closed fold.

---

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