From f902cfdcf6f03338da9fb617cf15d5d2ef5ff47a Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 12 Aug 2014 12:33:12 +0100 Subject: [PATCH] Monkey patch ace until cursor patches come from upstream --- services/web/public/js/ace/ace.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/services/web/public/js/ace/ace.js b/services/web/public/js/ace/ace.js index 818cd4b7a8..25f11ec327 100644 --- a/services/web/public/js/ace/ace.js +++ b/services/web/public/js/ace/ace.js @@ -11428,6 +11428,7 @@ var Editor = function(renderer, session) { this._signal("change", e); this.$cursorChange(); + this.$updateHighlightActiveLine(); }; this.onTokenizerUpdate = function(e) { @@ -14853,8 +14854,10 @@ var VirtualRenderer = function(container, theme) { this.$changedLines.lastRow = lastRow; } - if (this.$changedLines.firstRow > this.layerConfig.lastRow || - this.$changedLines.lastRow < this.layerConfig.firstRow) + if (this.$changedLines.lastRow < this.layerConfig.firstRow) + this.$changedLines.lastRow = this.layerConfig.lastRow + + if (this.$changedLines.firstRow > this.layerConfig.lastRow) return; this.$loop.schedule(this.CHANGE_LINES); }; @@ -15218,6 +15221,11 @@ var VirtualRenderer = function(container, theme) { changes & this.CHANGE_H_SCROLL ) { changes |= this.$computeLayerConfig(); + if (config.firstRow != this.layerConfig.firstRow && config.firstRowScreen == this.layerConfig.firstRowScreen) { + this.scrollTop = this.scrollTop + (config.firstRow - this.layerConfig.firstRow) * this.lineHeight; + changes = changes | this.CHANGE_SCROLL; + changes |= this.$computeLayerConfig(); + } config = this.layerConfig; this.$updateScrollBarV(); if (changes & this.CHANGE_H_SCROLL)