Fix handling of undo/redo stack in splits do the right thing.

This commit is contained in:
Julian Viereck 2011-05-21 20:04:53 +02:00
commit f332e2b900
3 changed files with 26 additions and 18 deletions

View file

@ -52,20 +52,26 @@ var UndoManager = function() {
this.$redoStack = [];
};
this.undo = function() {
this.undo = function(dontSelect) {
var deltas = this.$undoStack.pop();
var undoSelectionRange = null;
if (deltas) {
this.$doc.undoChanges(deltas);
undoSelectionRange =
this.$doc.undoChanges(deltas, dontSelect);
this.$redoStack.push(deltas);
}
return undoSelectionRange;
};
this.redo = function() {
this.redo = function(dontSelect) {
var deltas = this.$redoStack.pop();
var redoSelectionRange = null;
if (deltas) {
this.$doc.redoChanges(deltas);
redoSelectionRange =
this.$doc.redoChanges(deltas, dontSelect);
this.$undoStack.push(deltas);
}
return redoSelectionRange;
};
this.reset = function() {