# Improve vim undo \(\#9317\) · gitcafe/zed

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

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

Visibility: public

Requested revision: bffde43c12bc2d85a5a5595e41e3f7131a4ff274

Requested commit: bffde43c12bc2d85a5a5595e41e3f7131a4ff274

Commit: bffde43c12bc2d85a5a5595e41e3f7131a4ff274

Tree: aa5a66d804deaacedc4a7df8c4319a004d4225dd

Author: Conrad Irwin

Committer: GitHub

## Message

```
Improve vim undo (#9317)

The important change here is to ensure that undo never lands you in
visual mode; but we also take care to restore the selection the same way
vim does (visual line goes to beginning of line, visual block to the top
left, etc.).

To help make this behaviour feel right we also group any deletions that
started insert mode with the first text inserted.

Fixes: #7521

Release Notes:

- vim: Improved undo. It will now restore you to normal mode in the same
position as vim, and group deletions caused by `c` or `s` with the
concomitant insert.
([#7521](https://github.com/zed-industries/zed/issues/7521)).
```

## Parents

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

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