# Fix unhighlighted deleted regions in diffs \(\#64202\) · gitcafe/zed

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

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

Visibility: public

Requested revision: cbffa0f5e1fc4a05b43c3e29d0c759b5d24d0f8f

Requested commit: cbffa0f5e1fc4a05b43c3e29d0c759b5d24d0f8f

Commit: cbffa0f5e1fc4a05b43c3e29d0c759b5d24d0f8f

Tree: 7452ee9373c00c1716059337ef96b9d4b55cb1dd

Author: Cole Miller

Committer: GitHub

## Message

```
Fix unhighlighted deleted regions in diffs (#64202)

#63145 exposed a bug in the the `snapshot_with_edits` and `fast_forward`
methods that we use to evolve the base text buffer for diffs: we
preserved the value of the `tree_sitter_data` field from the old
snapshot. That causes any diff whose base text has changed to have stale
bracket ranges and now stale syntax highlighting as well, which can
manifest as unhighlighted text in the deleted portion of an expanded
diff hunk.

This PR fixes the issue by clearing the `tree_sitter_data` field in
`snapshot_with_edits`.

Release Notes:

- N/A (problem exists in nightly only)
```

## Parents

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

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