Reset the $redoStack of the undoManager once a delta is executed. Add Range.setStart/setEnd.
This commit is contained in:
parent
e871700e2e
commit
86a0e98c36
2 changed files with 21 additions and 0 deletions
|
|
@ -115,6 +115,26 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
|
|||
return this.start.row == row && this.start.column == column;
|
||||
}
|
||||
|
||||
this.setStart = function(row, column) {
|
||||
if (typeof row == "object") {
|
||||
this.start.column = row.column;
|
||||
this.start.row = row.row;
|
||||
} else {
|
||||
this.start.row = row;
|
||||
this.start.column = column;
|
||||
}
|
||||
}
|
||||
|
||||
this.setEnd = function(row, column) {
|
||||
if (typeof row == "object") {
|
||||
this.end.column = row.column;
|
||||
this.end.row = row.row;
|
||||
} else {
|
||||
this.end.row = row;
|
||||
this.end.column = column;
|
||||
}
|
||||
}
|
||||
|
||||
this.inside = function(row, column) {
|
||||
if (this.compare(row, column) == 0) {
|
||||
if (this.isEnd(row, column) || this.isStart(row, column)) {
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ var UndoManager = function() {
|
|||
var deltas = options.args[0];
|
||||
this.$doc = options.args[1];
|
||||
this.$undoStack.push(deltas);
|
||||
this.$redoStack = [];
|
||||
};
|
||||
|
||||
this.undo = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue