Fix handling of undo/redo stack in splits do the right thing.
This commit is contained in:
parent
ffeda1ae05
commit
f332e2b900
3 changed files with 26 additions and 18 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue