-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pressing u
will undo all the stack.
#2007
Comments
And now it's doing it again in another project. When I reloaded the project the bug stopped. The only similarity between the two instances of the bug is that it happened both times on an HTML-like file (first time on a This is the list of the extensions that I have installed and their versions:
|
Having same issue Extension List
|
Putting this inside
|
@Chillee
for the redo. |
@petejkim You're correct! Thanks! |
Terrible, confusing behavior. I cannot tell what has been undone, more times than not it's too much. Please make it VIM-like Thanks @Chillee for the fix. This is better than the default behavior, too much is better than too little. Is there a way to have this undo block edits, etc? |
@tbsf We try, but unluckily bug-free software is hard to write :( I don't believe so. Not without a significant amount of work. |
Is anyone here NOT using enableNeovim? Just want to rule that out... |
vim.enableNeovim is set to false for me |
Great thanks, just wanted to make sure |
Next time this happens to someone, can you check to see if you have the same file open twice in vscode please, then either thumbs up this for yes, or thumbs down it for no |
I can confirm this bug as well: Runtime:
Extensions:
Only custom vim settings are:
I did not have two copies of the file open (voted above) |
I had the issue too and the temporary fix with the keyBindings seems to help. It's a very disturbing behavior to me as ViM is my main editor. I basically did the clicks to undo stuff for a while because of that bug... |
No actually the temporary fix of @Chillee is still not the behavior of ViM. If you are in insert mode and remove character with backspace, go to normal mode and press u, every character will be undo one by one. |
I also have this bug. I am disabling this plugin for now. Looking forward to a fix. I press u and all characters in the document are deleted one by one. |
FWIW, I also am experiencing this bug. Hitting undo is like rolling the dice. |
@cecton Yes, unluckily it's a temporary fix that's not very good. It's why we haven't rolled it out as a default. |
@Chillee still you and all the contributors are doing an amazing job with this plugin. Thanks 👍 I think Vi is a really complicate editor to emulate the behavior. I use some times a "normal" editor on other's computer but I have grown so much with Vi that anything else feels cumbersome to use. |
I've been evangelizing VS Code at my office for the past few months for TypeScript work. Most of us use vim, and this fantastic plugin is key to VSCode being a viable option at all. Fantastic work! However, this issue is a huge pain for many of us. I've paired with at least 5 people who have run into this issue and considered switching editors as a result. It is by far our number one pain point with VS Code. I've asked on our slack channel for others to upvote this issue, but I can say for certain that I know close to ten other people directly who feel pain from this issue. Hopefully this issue is still on the radar. |
This happened to me last night. It's very scary seeing your editor deleting lines that was not supposed to delete and you haven't add the file to VCS yet. Please if possible prioritize this bug! |
Happy to help debug it – it might be a conflict with another extension? |
Just nuked like an hour of work in front of my eyes. I am very sad. I have fresh VS Code with ESlint, Vetur, Vim, that's it. I only had one copy of the file open. Version 1.19.1 (1.19.1) |
My installed plugins re #2007 (comment)
|
@lmiller1990 If it happens to you again don't panic and just press ⌃R. Then ⌘⇧P and look for the Reload Window command. That should fix it. |
Given the information we have I think we can safely say that it is not caused by some conflict with another extension, but rather with how VSCodeVim handles the Undo stack. Now that I've had this bug more times than I can count, in various situations, my guess would be that VSCodeVim identifies all the changes as a single action. The bug wouldn't be in the Undo itself but with the way the extension determines the boundary between two undoable actions. |
Just ran into this issue, lost 45 minutes of work. I clicked the 😕 but, honestly, this makes all of VSCode unusable, not just the plugin, because not having reliable vim keybindings in my editor is a deal breaker for me. |
I've still never run into this problem, but I'll commit to spending a chunk of time in a couple days either fixing this issue (hopefully), or at least implementing some kind of failsafe to prevent it from deleting so much work :( |
I opened an issue on another plugin thinking the bug was there, but now reading this I'm starting to think it's here. This is the specific combination that seems to kick it off. Neither seem to cause the issue I'm seeing on their own.
Here's what happened. I was changing some user settings, then clicked over to a Clojure file. Parinfer asked me if I wanted to let it reformat the document (it needs to be formatted in a certain way for it to work) so I said yes. Everything seemed to be fine, then I started editing the file, made a mistake, hit I hadn't had any issues with the Vim port yet, so I figured it was Parinfer, and when I disabled it, the issue went away. Then I tried again today, and saw the same problem (committed my changes first so I wouldn't lose anything). This time it replaced it with my So, I opened an issue on Parinfer about it, but I'm also thinking it might be related to this issue as well. |
I also just experienced this - almost didn't notice that I had deleted a couple hours of work. Redoing with Ctr+R and reloading the workspace to go back to normal undo behavior did the trick, but I'm not sure how to reproduce the bug. |
This happened to me after using the Rename Symbol command. I'd expect any kind of refactoring that's done by VSCode as opposed to VSCodeVim to interact badly with VSCodeVim's undo stack. |
FWIW, I have a very simple minimal example. You can do this in a new/existing buffer.
The result is that everything will be undone. |
@coreysharris while I definitely experience this bug all the time, your reproduction steps don't actually recreate the issue for me. 😞 I'm wondering if there is some more global state that is causing this. Are you able to recreate the issue with your steps after you quit and start VSCode? |
I disabled all other extensions and restarted VSCode. I can still reproduce by following the steps above. Here's my version info: |
Unfortunately I'm unable to reproduce using these steps. |
FWIW, those steps also don't reproduce it for me. Each The only way I can make the above gif occur is by using the VSCode undo ( |
Ah, yes I do have that workaround in my settings. Here's everything vim-related: // ViM settings
"vim.normalModeKeyBindingsNonRecursive": [{
"before": ["u"],
"after": [],
"commands": [{
"command": "undo",
"args": []
}]
},
{
"before": ["<C-r>"],
"after": [],
"commands": [{
"command": "redo",
"args": []
}]
}
],
"vim.useSystemClipboard": true,
"vim.easymotion": true,
"vim.easymotionMarkerWidthPerChar": 12,
"vim.easymotionMarkerFontFamily": "Fira Code",
"vim.easymotionMarkerFontWeight": "normal",
"vim.foldfix": true,
"vim.leader": ",",
"vim.sneak": true, |
My two cents: I get this problem when I do multiple edits without leaving insert mode.
This is what I experience, but others may be experiencing something else. I work mainly in JS/TS/MD files. In this case, a possible solution might be to detect any movement in insert mode, and at that point mark a boundary/ending for the latest undo action. (It is also worth noting that sometimes VSCode's native undo appears to group separate edits together, and sometimes it doesn't. I'm not sure why. I observed this when using VSCodeVim, not in default mode.) |
There seem to be corner cases where this can cause you to irretrievably lose text. I haven't figured out the exact pattern yet but I think it's in combination with VSCode's native undo behavior. Being a vim newbie I sometimes still grab the mouse or enter non-vim keystrokes accidentally. When you do this it's possible to get into a situation where vscode-vim deletes some text from the buffer but afterward it isn't in either vscode or vscode-vim's undo stack. There's no way to get it back. That can be pretty disastrous depending on what and how much got removed. This is probably related to both this issue and the one about syncing undo stacks. |
Definitely looking forward to this issue. I had my files delete a LOT multiple times and just recently realized it is the u key going beserk. Thanks for all your work devs. |
Same exact issue here, lots of text lost & extremely infuriating, but the shortcut provided Thanks to the team for your hard work. |
u
will undo all the stack.
Thanks a lot @khanhhuy Not only did it solved the recursive problem but also the problem of not being able to use "u" to undo inside jupyter notebooks. yours, |
Note that this is a separate issue and will be fixed in upcoming release. |
I have been having this problem again. Originally adding the bindings to |
This seems to fix my problem, wondering what the state is as there has not been any comments on this for over 1 year. |
Manually overriding the And for good reasons as it turns out: However in many cases, VSCodeVim currently seems to be pretty blind for many automated edits that VS Code does based on intellisense suggestions, a problem which causes these edits to be missed in VSCodeVim history. So pressing So I really think there is an actual problem that needs to be solved, not just a key remapping to the normal undo/redo. |
I hope this can get fixed someday, I switched from vscode to DataSpell for ML development as their vim mode is integrated into the editor and never has problems with undo. But, I understand this is a complex issue to fix, potentially intractable without support from MS to harmonize the histories somehow. |
FYI This specific bug hasn't happened to me for quite some time (at least a year? two maybe?). I still have issues with undo but it's not this one. I am considering closing the issue but apparently some people still experience it. @eduarddejong @willtalmadge Do you confirm? |
@yacinehmito I experienced this problem for the first time today. |
@yacinehmito |
I keep getting running into this issue, but it seems random. Today I found one very reproducible pattern.
Expected:
Actual: Oddly, if I make typos, have to hit delete, etc, while entering the original insert... it changes the final result!?! Again, probably due to the "shuffling"? vscodevim v1.28.0 |
Also have this issue, Mac M1, last vscode version.. neovim not installed. Q: is neovim still an improvement? there were some recommendations starting the thread, but that's from 2017. |
The VSCodeVim team prioritizes issues based on reaction count.
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
This is a bug report
Environment:
What happened:
I press
u
in Normal mode in an editor window. Every single action in the undo stack was undone. Here's a GIF:What did you expect to happen:
I expected the last action on the stack to be undone.
How to reproduce it:
I have no idea. I was reliably triggering the bug with the exact buffer I had but at some point it stopped doing it. Then it did it again.
The text was updated successfully, but these errors were encountered: