keep existing macro if nothing new is recorded
This commit is contained in:
parent
96b6abb615
commit
b9515ddb01
1 changed files with 7 additions and 2 deletions
|
|
@ -146,8 +146,13 @@ var CommandManager = function(platform, commands) {
|
||||||
if (this.recording) {
|
if (this.recording) {
|
||||||
this.macro.pop();
|
this.macro.pop();
|
||||||
this.exec = this.normal_exec;
|
this.exec = this.normal_exec;
|
||||||
|
|
||||||
|
if (!this.macro.length)
|
||||||
|
this.macro = this.oldMacro;
|
||||||
|
|
||||||
return this.recording = false;
|
return this.recording = false;
|
||||||
}
|
}
|
||||||
|
this.oldMacro = this.macro;
|
||||||
this.macro = [];
|
this.macro = [];
|
||||||
this.normal_exec = this.exec;
|
this.normal_exec = this.exec;
|
||||||
this.exec = function(command, editor, args) {
|
this.exec = function(command, editor, args) {
|
||||||
|
|
@ -158,10 +163,10 @@ var CommandManager = function(platform, commands) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.replay = function(editor) {
|
this.replay = function(editor) {
|
||||||
if (this.$inReplay)
|
if (this.$inReplay || !this.macro)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!this.macro || this.recording)
|
if (this.recording)
|
||||||
return this.toggleRecording();
|
return this.toggleRecording();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue