fix selection handling in undo/redoChanges
This commit is contained in:
parent
be2e78616e
commit
31695f06c0
1 changed files with 2 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue