replaceAll shouldn't change scroll position
This commit is contained in:
parent
01d053c46b
commit
119d733fb5
1 changed files with 2 additions and 1 deletions
|
|
@ -1163,11 +1163,12 @@ var Editor = function(renderer, session) {
|
||||||
if (!ranges.length)
|
if (!ranges.length)
|
||||||
return replaced;
|
return replaced;
|
||||||
|
|
||||||
|
this.$blockScrolling += 1;
|
||||||
|
|
||||||
var selection = this.getSelectionRange();
|
var selection = this.getSelectionRange();
|
||||||
this.clearSelection();
|
this.clearSelection();
|
||||||
this.selection.moveCursorTo(0, 0);
|
this.selection.moveCursorTo(0, 0);
|
||||||
|
|
||||||
this.$blockScrolling += 1;
|
|
||||||
for (var i = ranges.length - 1; i >= 0; --i) {
|
for (var i = ranges.length - 1; i >= 0; --i) {
|
||||||
if(this.$tryReplace(ranges[i], replacement)) {
|
if(this.$tryReplace(ranges[i], replacement)) {
|
||||||
replaced++;
|
replaced++;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue