diff --git a/lib/ace/commands/command_manager.js b/lib/ace/commands/command_manager.js index 439d5832..8f3fcbad 100644 --- a/lib/ace/commands/command_manager.js +++ b/lib/ace/commands/command_manager.js @@ -146,8 +146,13 @@ var CommandManager = function(platform, commands) { if (this.recording) { this.macro.pop(); this.exec = this.normal_exec; + + if (!this.macro.length) + this.macro = this.oldMacro; + return this.recording = false; } + this.oldMacro = this.macro; this.macro = []; this.normal_exec = this.exec; this.exec = function(command, editor, args) { @@ -158,10 +163,10 @@ var CommandManager = function(platform, commands) { }; this.replay = function(editor) { - if (this.$inReplay) + if (this.$inReplay || !this.macro) return; - if (!this.macro || this.recording) + if (this.recording) return this.toggleRecording(); try {