undo/redo search and replace operations is non-atomic and slow
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
undo/redo a "search and replace" operation is non-atomic and thus very slow.
First I had the issue with the search and replace being non-atomic. But I found this issue which suggested activating neovim, and it worked:
https://github.com/VSCodeVim/Vim/issues/737
However, it did not make the undo/redo atomic.
To Reproduce
- Open a non-trivial file (200 rows and 30 replaces takes almost 2 full seconds on my laptop)
- Type
: - Type
%s/something/blahblahblah/gand hit enter - Type
u
I can see how the undo operation slowly rewrites the document. If I press ctrl+r to redo the operation it is also slow and non-atomic.
Expected behavior
An atomic and quick undo/redo.
Environment (please complete the following information):
- Extension (VsCodeVim) version: 1.11.3
- VSCode version: 1.40.1
- OS: Windows 10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the search-and-replace sequence on a non-trivial file: enter :%s/something/blahblahblah/g, then undo with u and redo with ctrl+r. Trace the command and undo/redo handling from that entry point; done means both operations are quick and atomic rather than visibly rewriting the document.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100