Vim icon indicating copy to clipboard operation
Vim copied to clipboard

A sequence of undone changes cannot be redone past the last one

Open strogonoff opened this issue 2 years ago • 4 comments

Describe the bug A sequence of undone changes cannot be redone past the last one. Possible data loss.

To Reproduce Steps to reproduce the behavior:

  1. Make some changes
  2. Undo 5 times with u
  3. Redo 5 times with ctrl+r
  4. Only the first redo (of the last undo) works

Expected behavior All undone changes are re-applied.

Screenshots

Environment (please complete the following information):

  • Extension (VsCodeVim) version: v1.23.2
  • VSCode version: 1.71.0-insider b0895f9
  • OS: macOS

Additional context

  • Sometimes it works, but when it doesn’t it’s a data loss scenario unless the file was saved before the undo took place.
  • A few days ago I had to re-write a couple dozen LoC from memory due to this bug.
  • Didn’t happen until the last time I let VSC and extension upgrade themselves. Now it happens every day many times.
  • Increasing undo history to 500+ didn’t help.

strogonoff avatar Aug 10 '22 09:08 strogonoff

I've also been having this issue for the last week (weeks?). Undo no longer works past the first change. In the meantime I've bound U to native undo, but this is problematic with find/replace, formatting, etc.

Environment: Extension version: vscodevim v1.23.2 VSCode Version: 1.71.0-insider (Universal) Commit: dced70bbf36d3c53c08e791da1791ac7fc42519b Date: 2022-08-10T05:18:38.020Z Electron: 19.0.11 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Darwin arm64 20.6.0 Sandboxed: Yes

parkerault avatar Aug 11 '22 19:08 parkerault

@parkerault I can reproduce this too. My original issue was with redo, but right now undo is also broken, all invocations after the first one do nothing. It does not happen all the time, but it happens every few days and it’s painful.

strogonoff avatar Aug 27 '22 02:08 strogonoff

Might be related to #4854. I have done a few changes as a test, and it looks like undo history gets essentially flushed once it stumbles across the first change that involved a visual selection (v).

strogonoff avatar Aug 27 '22 02:08 strogonoff

I'm experiencing this too. Undos generally don't work past the first one. I just end up using the vscode undo/redo with ctrl + z and ctrl + shift + z. this has been broken for several months for me. Anyone figure out a fix?

SeanPhilippi avatar Sep 01 '22 18:09 SeanPhilippi

This is quite recent to me, I'd say it started failing during the last few days. The undo/redo history is seriously broken, I have to use Cmd+z/Cmd+shift+z to realistically use the undo functionality.

macOS Monterrey vsCodeVim: v1.24.1 Visual Studio Code Version: 1.72.2

prodigel avatar Oct 22 '22 20:10 prodigel

This is happening to me with VS Code Insiders 1.74. But the strange thing is that sometimes undo is fine.

weiying-chen avatar Dec 03 '22 16:12 weiying-chen