# buffer_diff: Ensure that base text has finished parsing before completing update \(\#46054\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 88a0b310d619d22c0d7ab88564c94ae833514ec5

Requested commit: 88a0b310d619d22c0d7ab88564c94ae833514ec5

Commit: 88a0b310d619d22c0d7ab88564c94ae833514ec5

Tree: af62e775bddf2eea21c3b292f9cc95a7968cb847

Author: Cole Miller

Committer: GitHub

## Message

```
buffer_diff: Ensure that base text has finished parsing before completing update (#46054)

Follow-up to #46001 

That initial fix partly addressed the issue for diffs managed by the
`GitStore`, but not for other diffs (e.g. those managed by the
`ActionLog` or `CommitView`). The underlying issue is that we switched
to using a `Buffer` to represent the diff base text, and when updating
the diff we were calling `set_text` on this buffer and not waiting for
reparsing to finish. When the base text was represented by a series of
independent `BufferSnapshot`s, this wasn't an issue because we would
parse the base text in the background as part of computing the diff
update. This PR fixes the issue by waiting on reparsing to finish after
each call to `set_text`.

Release Notes:

- N/A
```

## Parents

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

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