Fixed a typo in placeholder that was stopping the cancel to work
This commit is contained in:
parent
fcded20cbe
commit
1283b11f0e
1 changed files with 2 additions and 2 deletions
|
|
@ -60,7 +60,7 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass)
|
||||||
|
|
||||||
this.$pos = pos;
|
this.$pos = pos;
|
||||||
// Used for reset
|
// Used for reset
|
||||||
this.$undoStackDepth = session.getUndoManager().$undoStack ? session.getUndoManager().$undoStack.length : -1;
|
this.$undoStackDepth = session.getUndoManager().$undostack ? session.getUndoManager().$undostack.length : -1;
|
||||||
this.setup();
|
this.setup();
|
||||||
|
|
||||||
session.selection.on("changeCursor", this.$onCursorChange);
|
session.selection.on("changeCursor", this.$onCursorChange);
|
||||||
|
|
@ -202,7 +202,7 @@ var PlaceHolder = function(session, length, pos, others, mainClass, othersClass)
|
||||||
if(this.$undoStackDepth === -1)
|
if(this.$undoStackDepth === -1)
|
||||||
throw Error("Canceling placeholders only supported with undo manager attached to session.");
|
throw Error("Canceling placeholders only supported with undo manager attached to session.");
|
||||||
var undoManager = this.session.getUndoManager();
|
var undoManager = this.session.getUndoManager();
|
||||||
var undosRequired = undoManager.$undoStack.length - this.$undoStackDepth;
|
var undosRequired = undoManager.$undostack.length - this.$undoStackDepth;
|
||||||
for (var i = 0; i < undosRequired; i++) {
|
for (var i = 0; i < undosRequired; i++) {
|
||||||
undoManager.undo(true);
|
undoManager.undo(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue