Skip to content
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

Undo don't work after full search and replace #1589

Closed
Matheus-de-Souza opened this issue Apr 27, 2017 · 7 comments · Fixed by #1725
Closed

Undo don't work after full search and replace #1589

Matheus-de-Souza opened this issue Apr 27, 2017 · 7 comments · Fixed by #1725

Comments

@Matheus-de-Souza
Copy link

  • Click thumbs-up 👍 on this issue if you want it!
  • Click confused 😕 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


What did you do?

[On Normal Mode]
:%s/pedido/perfil/gi [enter] u

I did a full search and replace, but I typed bad the last part of the expression. I should type 'gI' not 'gi'

Then I tried to undo, but it did not work.

What did you expect to happen?

I expect a "undo"

What happened instead?

Nothing

Technical details:

  • VSCode Version: 1.11.1
  • VsCodeVim Version: Lastest
  • OS: Windows
@Chillee
Copy link
Member

Chillee commented Apr 28, 2017

I can't replicate this exact issue. Could you explain it a bit more on what you're doing? (Did you just open up a file, etc.)

I can only replicate a similar issue where multiple search and replaces followed by an undo undoes all of the search and replaces.

@Matheus-de-Souza
Copy link
Author

It's wierd because sometimes it works and sometimes doesn't...

@Chillee
Copy link
Member

Chillee commented May 4, 2017

@Matheus-de-Souza Does it have to do with how many matches you have? Like, does it work for small files but not large ones?

@Chillee
Copy link
Member

Chillee commented May 4, 2017

I can replicate this consistently with any find and replace that matches more than about 23 words.

@Chillee
Copy link
Member

Chillee commented May 24, 2017

This is fixed with the new "enableNeovim" option (on master).

@Chillee
Copy link
Member

Chillee commented May 29, 2017

@johnfn I have a question. This issue is still present, but I know the cause (but not the reasoning). The issue is that when you undo, only the last 50 changes are kept, due to this line: https://github.com/VSCodeVim/Vim/blob/master/package.json#L448 combined with this line: https://github.com/VSCodeVim/Vim/blob/master/src/history/historyTracker.ts#L414

Is there any reason we have that line? Setting that line to something super high fixes all of these issues.

@johnfn
Copy link
Member

johnfn commented Jun 3, 2017

@Chillee sorry for slow response. notification spam makes it hard to find important things to respond to.

I honestly have no clue why that was added. It appears to be an incorrect overloading of the vim.history setting, which i think was initially added to track the number of SEARCH items (and maybe ex commands?) to store. I can't imagine why you'd want to truncate the undo history, that seems like a recipe for sadness.

I'm fine with changing it back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants