don't scroll on selectAll

This commit is contained in:
nightwing 2011-01-06 16:15:01 +04:00 • committed by Fabian Jakobs
commit 9ddc3dbc3b
2 changed files with 14 additions and 7 deletions

View file

@ -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) {