Reset the $redoStack of the undoManager once a delta is executed. Add Range.setStart/setEnd.

This commit is contained in:
Julian Viereck 2011-04-29 12:15:19 +02:00
commit 86a0e98c36
2 changed files with 21 additions and 0 deletions

View file

@ -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)) {

View file

@ -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() {