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
|
|
@ -265,20 +265,16 @@ function UndoManagerProxy(undoManager, session) {
|
|||
}
|
||||
|
||||
this.undo = function() {
|
||||
var u = this.$u;
|
||||
var deltas = u.$undoStack.pop();
|
||||
if (deltas) {
|
||||
this.$doc.undoChanges(deltas);
|
||||
u.$redoStack.push(deltas);
|
||||
var selectionRange = this.$u.undo(true);
|
||||
if (selectionRange) {
|
||||
this.$doc.selection.setSelectionRange(selectionRange);
|
||||
}
|
||||
}
|
||||
|
||||
this.redo = function() {
|
||||
var u = this.$u;
|
||||
var deltas = u.$redoStack.pop();
|
||||
if (deltas) {
|
||||
this.$doc.redoChanges(deltas);
|
||||
u.$undoStack.push(deltas);
|
||||
var selectionRange = this.$u.redo(true);
|
||||
if (selectionRange) {
|
||||
this.$doc.selection.setSelectionRange(selectionRange);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue