def run(self, name=None): state = VintageState(self.view) if name == None and not state.is_recording: return if not state.is_recording: state._latest_macro_name = name state.is_recording = True self.view.run_command('start_record_macro') return if state.is_recording: self.view.run_command('stop_record_macro') state.is_recording = False state.reset() # Store the macro away. modifying_cmd = self.view.command_history(0, True) state.latest_macro = modifying_cmd
def run(self, name=None): state = VintageState(self.view) if name == None and not state.is_recording: return if not state.is_recording: self.view.run_command('unmark_undo_groups_for_gluing') state.latest_macro_name = name state.is_recording = True self.view.run_command('start_record_macro') return if state.is_recording: self.view.run_command('stop_record_macro') state.is_recording = False self.view.run_command('unmark_undo_groups_for_gluing') state.reset() # Store the macro away. state.macros[state.latest_macro_name] = sublime.get_macro()
def run(self, name=None): state = VintageState(self.view) if name == None and not state.is_recording: return if not state.is_recording: self.view.run_command('unmark_undo_groups_for_gluing') state.latest_macro_name = name state.is_recording = True self.view.run_command('start_record_macro') return if state.is_recording: self.view.run_command('stop_record_macro') state.is_recording = False self.view.run_command('unmark_undo_groups_for_gluing') state.reset() # Store the macro away. state.macros[state.latest_macro_name] = sublime.get_macro()