diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index 9e907b3d..d3ae0ee0 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -541,7 +541,7 @@ var EditSession = function(text, mode) { if (firstDelta.action == "insertText" || firstDelta.action == "insertLines") this.selection.moveCursorToPosition(firstDelta.range.start); if (firstDelta.action == "removeText" || firstDelta.action == "removeLines") - this.selection.setSelectionRange(Range.fromPoints(firstDelta.range.start, lastDelta.range.end)); + this.selection.setSelectionRange(Range.fromPoints(lastDelta.range.start, firstDelta.range.end)); }, this.redoChanges = function(deltas) { @@ -560,7 +560,7 @@ var EditSession = function(text, mode) { if (firstDelta.action == "insertText" || firstDelta.action == "insertLines") this.selection.setSelectionRange(Range.fromPoints(firstDelta.range.start, lastDelta.range.end)); if (firstDelta.action == "removeText" || firstDelta.action == "removeLines") - this.selection.moveCursorToPosition(firstDelta.range.start); + this.selection.moveCursorToPosition(lastDelta.range.start); }, this.replace = function(range, text) {