replaceAll shouldn't change scroll position

This commit is contained in:
nightwing 2012-04-15 18:33:48 +04:00
commit 119d733fb5

View file

@ -1163,11 +1163,12 @@ var Editor = function(renderer, session) {
if (!ranges.length)
return replaced;
this.$blockScrolling += 1;
var selection = this.getSelectionRange();
this.clearSelection();
this.selection.moveCursorTo(0, 0);
this.$blockScrolling += 1;
for (var i = ranges.length - 1; i >= 0; --i) {
if(this.$tryReplace(ranges[i], replacement)) {
replaced++;