# Introduce \`Editor::insert_flaps\` and \`Editor::remove_flaps\` \(\#12096\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/f3710877f1262dffc648e359e1f8ff76ab41d554)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: f3710877f1262dffc648e359e1f8ff76ab41d554

Requested commit: f3710877f1262dffc648e359e1f8ff76ab41d554

Commit: f3710877f1262dffc648e359e1f8ff76ab41d554

Tree: 751a978d362fed20dd9216d55b51227bff72d814

Author: Antonio Scandurra

Committer: GitHub

## Message

```
Introduce `Editor::insert_flaps` and `Editor::remove_flaps` (#12096)

This pull request introduces the ability to add flaps, custom foldable
regions whose first foldable line can be associated with:

- A toggle in the gutter
- A trailer showed at the end of the line, before the inline blame
information


https://github.com/zed-industries/zed/assets/482957/c53a9148-f31a-4743-af64-18afa73c404c

To achieve this, we changed `FoldMap::fold` to accept a piece of text to
display when the range is folded. We use this capability in flaps to
avoid displaying the ellipsis character.

We want to use this new API in the assistant to fold context while still
giving visual cues as to what that context is.

Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Max <max@zed.dev>
```

## Parents

- [b89f360199c768e84fb1c294e4322e6ba1bc19bc](https://git.cafe/gitcafe/zed/commit/b89f360199c768e84fb1c294e4322e6ba1bc19bc?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/f3710877f1262dffc648e359e1f8ff76ab41d554?format=markdown)
