# vim: Fix clear exchange not working \(\#25804\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 82338e2c477a4e33e729632224f7238d521c0b37

Requested commit: 82338e2c477a4e33e729632224f7238d521c0b37

Commit: 82338e2c477a4e33e729632224f7238d521c0b37

Tree: 231f89129b1b22fe4c323a6ff825e59ef6dc9d98

Author: Thomas Heartman

Committer: GitHub

## Message

```
vim: Fix clear exchange not working (#25804)

Fixes two issues with the Vim exchange implementation:

1. The clear exchange implementation **didn't** clear the exchange. This
was due to us asking the editor to clear normal highlights instead of
background highlights.
2. Calling clear exchange also wouldn't cause the operator to be
cleared, so you would be left in operator = "cx".

I've added tests for both of these cases.

Partially closes #25750. It doesn't address the problem with dot repeat
not working for my custom bindings, but I don't know what would cause
that. I'd love to hear some thoughts on why that is. That might be a
problem on my part or it might be something with the code. Input would
be appreciated.

Release Notes:

- Fixed: Vim exchange's "clear exchange" function didn't clear the
exchange and kept you in operator pending mode.
```

## Parents

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

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