replace all should not change the selection

This commit is contained in:
Fabian Jakobs 2011-02-14 07:54:28 +01:00
commit 7206c60dc6

View file

@ -1016,13 +1016,16 @@ var Editor =function(renderer, session) {
if (!ranges.length)
return;
var selection = this.getSelectionRange();
this.clearSelection();
this.selection.moveCursorTo(0, 0);
this.$blockScrolling += 1;
for (var i = ranges.length - 1; i >= 0; --i)
this.$tryReplace(ranges[i], replacement);
if (ranges[0] !== null)
this.selection.setSelectionRange(ranges[0]);
this.$blockScrolling -= 1;
this.selection.setSelectionRange(selection);
},
this.$tryReplace = function(range, replacement) {