more scrolling fixes

This commit is contained in:
Fabian Jakobs 2012-04-12 16:40:58 +02:00
commit 24eccde63e
2 changed files with 14 additions and 11 deletions

View file

@ -611,7 +611,7 @@ var Editor = function(renderer, session) {
}; };
this.getAnimatedScroll = function(){ this.getAnimatedScroll = function(){
this.renderer.getAnimatedScroll(); return this.renderer.getAnimatedScroll();
}; };
this.setShowInvisibles = function(showInvisibles) { this.setShowInvisibles = function(showInvisibles) {
@ -1243,16 +1243,19 @@ var Editor = function(renderer, session) {
this.selection.setSelectionRange(range); this.selection.setSelectionRange(range);
this.$blockScrolling -= 1; this.$blockScrolling -= 1;
if (this.getAnimatedScroll()) {
var cursor = this.getCursorPosition(); var cursor = this.getCursorPosition();
if (!this.isRowFullyVisible(cursor.row)) if (!this.isRowFullyVisible(cursor.row))
this.scrollToLine(cursor.row, true); this.scrollToLine(cursor.row, true);
//@todo scroll X //@todo scroll X
//if (!this.isRowFullyVisible(cursor.row)) //if (!this.isColumnFullyVisible(cursor.column))
//this.scrollToLine(cursor.row, true); //this.scrollToRow(cursor.column);
}
else {
this.renderer.scrollSelectionIntoView(range.start, range.end); this.renderer.scrollSelectionIntoView(range.start, range.end);
} }
}
}; };
this.undo = function() { this.undo = function() {