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 behavior with {}[]()<> does not act exactly as it should #633

Closed
xconverge opened this issue Aug 21, 2016 · 2 comments · Fixed by #636
Closed

Undo behavior with {}[]()<> does not act exactly as it should #633

xconverge opened this issue Aug 21, 2016 · 2 comments · Fixed by #636

Comments

@xconverge
Copy link
Member

xconverge commented Aug 21, 2016

@johnfn took a quick stab at this issue in 7ac106d but the behavior does not fully match the way vim works yet.

When writing something where you open and close the brackets then fill in the interior, a new undo point should be created.

ex:
if(true){
}

then filling in

if(true){
int i = 0;
}

an undo point is created in the first step during insert mode, so pressing u once will get back to the first step, and pressing u again will clear it all.


Please thumbs-up 👍 this issue if it personally affects you! You can do this by clicking on the emoji-face on the top right of this post. Issues with more thumbs-up will be prioritized.


Technical details:

  • VSCode Version: 1.4.0
  • VsCodeVim Version: master as of 7ac106d
  • OS: OSX
@xconverge
Copy link
Member Author

Also, if I write something like:

0
0

then move the cursor to the first 0, and use ctrl+a to increment it, then move the cursor to the 2nd 0 and use ctrl+a to increment it. Pressing u Undoes both, it should only undo one

There is still something funky about when new undo points are created

@johnfn
Copy link
Member

johnfn commented Aug 22, 2016

Ah, that's because ctrl-a is treated as a movement, not a command. Easy fix for anyone to pick up. :)

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

Successfully merging a pull request may close this issue.

2 participants