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

Patch for issue #119 #120

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Patch for issue #119 #120

wants to merge 3 commits into from

Conversation

quarnster
Copy link
Contributor

Just realized it was very straight forward to get the desired behavior.

@quarnster
Copy link
Contributor Author

Actually, this is still not quite. While pressing u multiple times now does indeed do multiple undo steps, pressing for example 'i' does not enter insert mode and x doesn't delete characters now, so something is still amiss.

@quarnster
Copy link
Contributor Author

This is working now with commit 5e3909a :)

Please merge.

@michaelphines
Copy link

Thanks quarnster! This works great. I've been bitten by this more than once.

Holding u to undo and going back just a bit too far and then realizing that your redo buffer is empty is very sad.

@jordwalke
Copy link

Thanks you! Would love to see this merged.

@jordwalke
Copy link

Here's why this bug makes Vintage mode unusable. If you press "u", and enter visual mode, it is possible to hit another "u" and trigger a case change. This is horrible because it ruins your undo tree! Now you can't redo to recover where you were in the editing process. Does anyone know how to solve this with keymappings in the mean time?

@jordwalke
Copy link

@quarnster: You may want to amend the diff with support for Redo. #5e3909a fixes undo, but not redo.

@jordwalke
Copy link

In addition to the VintageUndo commit, I believe this needs to be added. Thoughts?

class VintageRedo(sublime_plugin.WindowCommand):
    def run(self):
        # Needs to be a window command as running the undo command while the
        # undo stack is being updated (like being inside of an edit in a
        # TextCommand) causes problems
        self.window.active_view().run_command("redo")
        self.window.active_view().run_command("exit_visual_mode")

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 this pull request may close these issues.

3 participants