Skip to content

Commit

Permalink
first history entry is undo-able
Browse files Browse the repository at this point in the history
  • Loading branch information
ycw committed May 9, 2024
1 parent 66a31ae commit 9785ec4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/js/History.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class History {
this.editor.signals.historyChanged.active = false;

let cmd = this.undos.length > 0 ? this.undos[ this.undos.length - 1 ] : undefined; // next cmd to pop

debugger
if ( cmd === undefined || id > cmd.id ) {

cmd = this.redo();
Expand All @@ -266,7 +266,7 @@ class History {

cmd = this.undos[ this.undos.length - 1 ]; // next cmd to pop

if ( cmd === undefined || id === cmd.id ) break;
if ( cmd === undefined || id > cmd.id ) break;

this.undo();

Expand Down

0 comments on commit 9785ec4

Please sign in to comment.