# Reduce \`display_map\` snapshot creation \(\#39354\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7e97fcaacb1dd83eaf666f52d5a88bf4c6c29127

Requested commit: 7e97fcaacb1dd83eaf666f52d5a88bf4c6c29127

Commit: 7e97fcaacb1dd83eaf666f52d5a88bf4c6c29127

Tree: 6dd350cd7b9731633c8994a9e659b3c6be3810aa

Author: Remco Smits

Committer: GitHub

## Message

```
Reduce `display_map` snapshot creation (#39354)

Re-applies https://github.com/zed-industries/zed/pull/30840

This PR re-applies the initial
[PR](https://github.com/zed-industries/zed/pull/30840). As it was closed
because it was hard to land, because of the many conflicts. This PR
re-applies the changes for it.

In several cases we were creating multiple display_map
snapshots within the same root-level function call.
Creating a display_map snapshot is quite slow, and in some
cases we were creating the snapshot multiple times.

Release Notes:

- N/A
```

## Parents

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

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