scroll selection into view only after find/replace
Conflicts: lib/ace/editor.js
This commit is contained in:
parent
99dedd25b5
commit
b44d19ed63
1 changed files with 8 additions and 7 deletions
|
|
@ -316,11 +316,7 @@ var Editor = function(renderer, session) {
|
||||||
this.renderer.updateCursor();
|
this.renderer.updateCursor();
|
||||||
|
|
||||||
if (!this.$blockScrolling) {
|
if (!this.$blockScrolling) {
|
||||||
var selection = this.getSelection();
|
this.renderer.scrollCursorIntoView();
|
||||||
if (selection.isEmpty())
|
|
||||||
this.renderer.scrollCursorIntoView(selection.getCursor());
|
|
||||||
else
|
|
||||||
this.renderer.scrollSelectionIntoView(selection.getSelectionLead(), selection.getSelectionAnchor());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// move text input over the cursor
|
// move text input over the cursor
|
||||||
|
|
@ -1155,11 +1151,13 @@ var Editor = function(renderer, session) {
|
||||||
if (!range)
|
if (!range)
|
||||||
return replaced;
|
return replaced;
|
||||||
|
|
||||||
if(this.$tryReplace(range, replacement)) {
|
if (this.$tryReplace(range, replacement)) {
|
||||||
replaced = 1;
|
replaced = 1;
|
||||||
}
|
}
|
||||||
if (range !== null)
|
if (range !== null) {
|
||||||
this.selection.setSelectionRange(range);
|
this.selection.setSelectionRange(range);
|
||||||
|
this.renderer.scrollSelectionIntoView(range.start, range.end);
|
||||||
|
}
|
||||||
|
|
||||||
return replaced;
|
return replaced;
|
||||||
};
|
};
|
||||||
|
|
@ -1240,6 +1238,7 @@ var Editor = function(renderer, session) {
|
||||||
var range = this.$search.find(this.session);
|
var range = this.$search.find(this.session);
|
||||||
if (range) {
|
if (range) {
|
||||||
this.session.unfold(range);
|
this.session.unfold(range);
|
||||||
|
|
||||||
this.$blockScrolling += 1;
|
this.$blockScrolling += 1;
|
||||||
this.selection.setSelectionRange(range);
|
this.selection.setSelectionRange(range);
|
||||||
this.$blockScrolling -= 1;
|
this.$blockScrolling -= 1;
|
||||||
|
|
@ -1251,6 +1250,8 @@ var Editor = function(renderer, session) {
|
||||||
//@todo scroll X
|
//@todo scroll X
|
||||||
//if (!this.isRowFullyVisible(cursor.row))
|
//if (!this.isRowFullyVisible(cursor.row))
|
||||||
//this.scrollToLine(cursor.row, true);
|
//this.scrollToLine(cursor.row, true);
|
||||||
|
|
||||||
|
this.renderer.scrollSelectionIntoView(range.start, range.end);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue