Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Undo add new line for every existing lines

Open brian-tran-dev opened this issue 6 years ago • 9 comments

Describe the bug When I press 'u' to undo all the changes, it adds new line for every existing lines in my file while ctrl-z doesn't do the same thing.

To Reproduce Steps to reproduce the behavior:

  1. Go into a file
  2. Make changes
  3. Hold u to undo all the changes

Expected behavior New lines getting added for every existing line.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.11.2
  • VSCode version: 1.39.1
  • OS: Window

brian-tran-dev avatar Oct 15 '19 01:10 brian-tran-dev

It happens to me too :( And bad thing: I can't "undo" or "redo" those whitelines. So I'm stuck to close the file without saving.

paparent avatar Apr 15 '20 11:04 paparent

I have been dealing with this issues since I started using vscode mid 2019. I cannot find STR, just holding down u does not induce this bug for me, however it does have something to do with undo. Annoyingly once this starts you cannot close the tab in a large file until the entire file has had a new line inserted at every line. This issue occurs multiple times a day for me.

Extension (VsCodeVim) version: 1.13.1 VSCode version: 1.44.0 OS: Window 10

Extension (VsCodeVim) version: 1.13.1 VSCode version: 1.43.1 OS: Debian 10.3

GalloglyP avatar Apr 24 '20 15:04 GalloglyP

This has been happening for a long time for me too. For most of that time I thought it was random, but I can now confirm that the pattern is that it is related to the "u" action somehow. The only solution is to hopefully have saved recently, because you have to close without saving to get back to a previous state. All history is lost as far as undo/redo is concerned.

SomnaW avatar Oct 03 '20 02:10 SomnaW

This doesn't happen all the time for me, but it does happen frequently. I speculate it happens after hitting Ctrl-t, which I do by mistake a lot.

@paparent I have found that Ctrl+z does undo the changes. I usually hold it down to get everything. But you have to be careful to not lose other changes.

rcmosher avatar Dec 09 '20 20:12 rcmosher

This happens to me as well, multiple times a day. I haven't found a reliable way to reproduce. It always happens after using undo with "u" key.

nicholasgrout avatar Mar 04 '21 17:03 nicholasgrout

This happens to me, too. It mainly seems to happen if I undo two or more steps, the first undo normally completes just fine. As the others have described, I must also resort to closing the file.

It's surprising that not more users are complaining about this bug. It seems to indicate that this only occurs when something else is also present, e.g. some other extension is installed (Prettier maybe?) or some specific VsCodeVim configuration is used.

thomassvensen avatar May 15 '21 09:05 thomassvensen

Have had this happen on files with >1000 lines. Pray the file was saved before adding a necessary change, otherwise the "press and hold ctrl-z" approach is the only way to get it back.

For now, I am going to try replacing the undo/redo commands with the built-in commands as brought up in this other issue (undo/redo in VSCodeVim is seriously borked in more ways than one) https://github.com/VSCodeVim/Vim/issues/2007#issuecomment-329660927

grapereader avatar Aug 18 '21 22:08 grapereader

Man this bug is really annoying. Hope it gets fixed. It's been more than 2 years since OP has posted and reported it. It seems to happen randomly but frequently during the day. Have lost my work multiple times due to this bug. I use vscode in Win10.

ahmadsdn avatar Jan 09 '22 12:01 ahmadsdn

Surprised this issue doesn't have more replies. This has probably happened to me once per day for the last three or four years, perhaps longer. The only solution is "revert file". Does anyone have any idea what causes it?

rhys-vdw avatar Jul 29 '22 09:07 rhys-vdw