diff --git a/lib/ace/Document.js b/lib/ace/Document.js index 13a87dba..ee9f025e 100644 --- a/lib/ace/Document.js +++ b/lib/ace/Document.js @@ -513,9 +513,7 @@ var Document = function(text, mode) { this.$remove(range, fromUndo); - this.fireChangeEvent(range.start.row, - !range.isMultiLine() ? range.start.row - : undefined); + this.fireChangeEvent(range.start.row, range.isMultiLine() ? undefined : range.start.row); return range.start; }; diff --git a/lib/ace/RenderLoop.js b/lib/ace/RenderLoop.js index 97c02a83..c1fcd490 100644 --- a/lib/ace/RenderLoop.js +++ b/lib/ace/RenderLoop.js @@ -16,6 +16,8 @@ var RenderLoop = function(onRender) { (function() { this.schedule = function(change) { +// this.onRender(change); +// return; this.changes = this.changes | change; if (!this.pending) { this.pending = true; diff --git a/lib/ace/VirtualRenderer.js b/lib/ace/VirtualRenderer.js index b92df7ec..dbf08e1e 100644 --- a/lib/ace/VirtualRenderer.js +++ b/lib/ace/VirtualRenderer.js @@ -120,6 +120,9 @@ var VirtualRenderer = function(container, theme) { * Triggers partial update of the text layer */ this.updateLines = function(firstRow, lastRow) { + if (lastRow === undefined) + lastRow = Infinity; + if (!this.$changedLines) { this.$changedLines = { firstRow: firstRow, @@ -133,8 +136,6 @@ var VirtualRenderer = function(container, theme) { if (this.$changedLines.lastRow < lastRow) this.$changedLines.lastRow = lastRow; } - if (this.$changedLines.lastRow === undefined) - this.$changedLines.lastRow = Infinity; this.$loop.schedule(this.CHANGE_LINES); }; @@ -186,6 +187,7 @@ var VirtualRenderer = function(container, theme) { }; this.setTokenizer = function(tokenizer) { + this.$tokenizer = tokenizer; this.$textLayer.setTokenizer(tokenizer); this.$loop.schedule(this.CHANGE_TEXT); }; @@ -301,7 +303,7 @@ var VirtualRenderer = function(container, theme) { }; this.$renderChanges = function(changes) { - if (!changes) + if (!changes || !this.doc || !this.$tokenizer) return; // text, scrolling and resize changes can cause the view port size to change