diff --git a/lib/ace/editor.js b/lib/ace/editor.js index a7cf2a0a..837355c1 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -611,7 +611,7 @@ var Editor = function(renderer, session) { }; this.getAnimatedScroll = function(){ - this.renderer.getAnimatedScroll(); + return this.renderer.getAnimatedScroll(); }; this.setShowInvisibles = function(showInvisibles) { @@ -1243,15 +1243,18 @@ var Editor = function(renderer, session) { this.selection.setSelectionRange(range); this.$blockScrolling -= 1; - var cursor = this.getCursorPosition(); - if (!this.isRowFullyVisible(cursor.row)) - this.scrollToLine(cursor.row, true); - - //@todo scroll X - //if (!this.isRowFullyVisible(cursor.row)) - //this.scrollToLine(cursor.row, true); - - this.renderer.scrollSelectionIntoView(range.start, range.end); + if (this.getAnimatedScroll()) { + var cursor = this.getCursorPosition(); + if (!this.isRowFullyVisible(cursor.row)) + this.scrollToLine(cursor.row, true); + + //@todo scroll X + //if (!this.isColumnFullyVisible(cursor.column)) + //this.scrollToRow(cursor.column); + } + else { + this.renderer.scrollSelectionIntoView(range.start, range.end); + } } }; diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 079f06ed..66e35222 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -287,7 +287,7 @@ var VirtualRenderer = function(container, theme) { this.$animatedScroll = shouldAnimate; }; - this.getAnimatedScroll = function(){ + this.getAnimatedScroll = function() { return this.$animatedScroll; };