diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 02ea0745..a432bd3f 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -425,8 +425,7 @@ var VirtualRenderer = function(container, theme) { var offset = this.scrollTop % this.lineHeight; var minHeight = this.$size.scrollerHeight + this.lineHeight; - // Add some space for the cursor itself plus some cursor padding - var longestLine = this.$getLongestLine() + this.$cursorPadding + 3; + var longestLine = this.$getLongestLine(); var widthChanged = !this.layerConfig ? true : (this.layerConfig.width != longestLine); var lineCount = Math.ceil(minHeight / this.lineHeight) - 1; @@ -491,7 +490,7 @@ var VirtualRenderer = function(container, theme) { }; this.$getLongestLine = function() { - var charCount = this.session.getScreenWidth(); + var charCount = this.session.getScreenWidth() + 1; if (this.$textLayer.showInvisibles) charCount += 1; @@ -561,14 +560,12 @@ var VirtualRenderer = function(container, theme) { this.scrollToX(left); } - if (this.scroller.scrollLeft + this.$size.scrollerWidth < left - + this.characterWidth + this.$cursorPadding) { + if (this.scroller.scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) { - if (left + this.characterWidth + this.$cursorPadding > this.scroller.scrollWidth) + if (left + this.characterWidth > this.scroller.scrollWidth) this.$renderChanges(this.CHANGE_SIZE); - this.scrollToX(Math.round(left + this.characterWidth + this.$cursorPadding - - this.$size.scrollerWidth)); + this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth)); } },