Skip to content

Commit

Permalink
Undo steps shouldn't enter visual mode. Issue sublimehq#119
Browse files Browse the repository at this point in the history
  • Loading branch information
quarnster committed Apr 7, 2012
1 parent 8ceecfc commit ee194fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Default.sublime-keymap
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"context": [{"key": "setting.command_mode"}]
},

{ "keys": ["u"], "command": "undo", "context": [{"key": "setting.command_mode"}] },
{ "keys": ["u"], "command": "vintage_undo", "context": [{"key": "setting.command_mode"}] },
{
"keys": ["ctrl+r"], "command": "redo",
"context": [{"key": "setting.command_mode"}, {"key": "setting.vintage_ctrl_keys"}]
Expand Down
5 changes: 5 additions & 0 deletions vintage.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,11 @@ def run(self, edit):
self.view.run_command("lower_case")
self.view.run_command("exit_visual_mode")

class VintageUndo(sublime_plugin.TextCommand):
def run(self, edit):
self.view.run_command("undo")
self.view.sel().clear()

# Sequence is used as part of glue_marked_undo_groups: the marked undo groups
# are rewritten into a single sequence command, that accepts all the previous
# commands
Expand Down

0 comments on commit ee194fc

Please sign in to comment.