# Fix divergence bug in undo/redo · gitcafe/zed

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

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

Visibility: public

Requested revision: ab236a6008a388e16a6c360ea76e16cfcae82d71

Requested commit: ab236a6008a388e16a6c360ea76e16cfcae82d71

Commit: ab236a6008a388e16a6c360ea76e16cfcae82d71

Tree: ea09a3cd4ed014c757c1bf02211b0150b150c29d

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Fix divergence bug in undo/redo

As part of #1405, we changed the way we performed undo and redo to
support combining transactions that were not temporally adjacent for
IME purposes.

We introduced a bug with that release that caused divergence
when performing undo: the bug was caused by only changing the visibility
of fragments whose insertion id was contained in the undo operation. However,
an undo operation also affects deletions which we were mistakenly not
considering. Randomized tests caught this but I guess we didn't run enough
of them.

```

## Parents

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

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