don't scroll on selectAll
This commit is contained in:
parent
4ca58558f1
commit
9ddc3dbc3b
2 changed files with 14 additions and 7 deletions
|
|
@ -233,11 +233,11 @@ var Editor =function(renderer, doc) {
|
|||
this.renderer.updateLines(rows.first, rows.last);
|
||||
};
|
||||
|
||||
this.onCursorChange = function() {
|
||||
this.onCursorChange = function(e) {
|
||||
this.$highlightBrackets();
|
||||
this.renderer.updateCursor(this.getCursorPosition(), this.$overwrite);
|
||||
|
||||
if (!this.$blockScrolling) {
|
||||
if (!this.$blockScrolling && (!e || !e.blockScrolling)) {
|
||||
this.renderer.scrollCursorIntoView();
|
||||
}
|
||||
this.$updateHighlightActiveLine();
|
||||
|
|
@ -256,7 +256,7 @@ var Editor =function(renderer, doc) {
|
|||
}
|
||||
};
|
||||
|
||||
this.onSelectionChange = function() {
|
||||
this.onSelectionChange = function(e) {
|
||||
if (this.$selectionMarker) {
|
||||
this.renderer.removeMarker(this.$selectionMarker);
|
||||
}
|
||||
|
|
@ -268,7 +268,7 @@ var Editor =function(renderer, doc) {
|
|||
this.$selectionMarker = this.renderer.addMarker(range, "ace_selection", style);
|
||||
}
|
||||
|
||||
this.onCursorChange();
|
||||
this.onCursorChange(e);
|
||||
};
|
||||
|
||||
this.onDocumentChangeBreakpoint = function() {
|
||||
|
|
|
|||
|
|
@ -150,9 +150,16 @@ var Selection = function(doc) {
|
|||
var lastRow = this.doc.getLength() - 1;
|
||||
this.setSelectionAnchor(lastRow, this.doc.getLine(lastRow).length);
|
||||
|
||||
this.$moveSelection(function() {
|
||||
this.moveCursorTo(0, 0);
|
||||
});
|
||||
if (!this.selectionAnchor) {
|
||||
this.selectionAnchor = this.$clone(this.selectionLead);
|
||||
}
|
||||
|
||||
var cursor = {row:0, column:0};
|
||||
// only dispatch change if the cursor actually changed
|
||||
if (cursor.row !== this.selectionLead.row || cursor.column !== this.selectionLead.column) {
|
||||
this.selectionLead = cursor;
|
||||
this._dispatchEvent("changeSelection", {blockScrolling: true});
|
||||
}
|
||||
};
|
||||
|
||||
this.setSelectionRange = function(range, reverse) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue