# Vim/Helix: Prevent undo grouping when any LSP completion \(\#53980\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 75f0940a5832c35c167582be0db9a6584491c84d

Requested commit: 75f0940a5832c35c167582be0db9a6584491c84d

Commit: 75f0940a5832c35c167582be0db9a6584491c84d

Tree: f601683dfad429a3627392bdf728b38bac392030

Author: HuaGu-Dragon

Committer: GitHub

## Message

```
Vim/Helix: Prevent undo grouping when any LSP completion (#53980)

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Summary  
Prevent undo grouping when an LSP completion includes extra edits so
that the completion and its extra edits are applied and reverted
atomically.

## Problem
When applying an LSP completion that also applies extra edits, the
editor may merge that completion into the surrounding undo group or
split the transaction while waiting for edits, causing undo to leave the
buffer in an inconsistent state.

## Solution
* Always block undo merging for completions

Closes #ISSUE

Release Notes:

- Prevent undo grouping when any LSP completion
```

## Parents

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

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