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 after visual select doesn't behave like in vi #119

Closed
quarnster opened this issue Apr 7, 2012 · 3 comments
Closed

Undo after visual select doesn't behave like in vi #119

quarnster opened this issue Apr 7, 2012 · 3 comments

Comments

@quarnster
Copy link
Contributor

Try the following:

  1. Open up a new buffer
  2. Hit i to enter insert mode
  3. Type TesT
  4. Hit escape to exit insert mode
  5. Hit v to begin a visual selection
  6. Hit b to select to the start of the word
  7. Hit u
  8. Hit u
  9. Hit u

In vi, these last three steps:

  1. TesT -> test
  2. test -> TesT
  3. TesT -> (nothing)

With this plugin you instead get:

  1. TesT -> test
  2. test -> TesT (+ TesT is selected and we're now in visual mode)
  3. TesT -> test

So the selection is an undo level but shouldn't be. Any ideas how to fix this? Can I get the undo stack in some way?

@misfo
Copy link
Collaborator

misfo commented Apr 7, 2012

To figure out if it's a bug in Vintage or in Sublime's undo code, try the same steps using Sublime's standard undo instead of pressing u. Also, can you reproduce the problem when making the selection with Sublime's standard selection keybindings (i.e. shift with arrow keys)?

@quarnster
Copy link
Contributor Author

If I replace the last two u's with cmd+z it does two undos, but still enters visual mode for the first undo operation.

There's no difference between selecting the text using visual mode and shift + arrow keys.

The problem steams from that 'u' in visual mode turns the text into lower case, but u when in command mode is undo. In vim, pressing the second u does NOT enter visual mode again whereas vintage does, so the 3rd press of u does not do undo but does a lower case operation again (ie same as the first u). So if you keep pressing u, you just go into an infinite loop between lowercasing the text and undoing the lower case operation in Vintage, but in vim you get undo operations after the first lower case operation.

quarnster added a commit to quarnster/Vintage that referenced this issue Apr 7, 2012
@quarnster
Copy link
Contributor Author

Closing this since it's the same as #120 which has one potential solution in it.

quarnster added a commit to quarnster/Vintage that referenced this issue May 19, 2012
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

No branches or pull requests

2 participants