Skip to content

Commit

Permalink
Made VintageUndo a WindowCommand after discussion with Jon.
Browse files Browse the repository at this point in the history
Solves issue sublimehq#119
  • Loading branch information
quarnster committed May 19, 2012
1 parent dc8a441 commit 5e3909a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions vintage.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,10 +750,13 @@ 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.run_command("exit_visual_mode")
class VintageUndo(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("undo")
self.window.active_view().run_command("exit_visual_mode")

# 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
Expand Down

0 comments on commit 5e3909a

Please sign in to comment.