diff --git a/lib/ace/editor.js b/lib/ace/editor.js index 2854eaaf..73873b4a 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -601,10 +601,14 @@ var Editor = function(renderer, session) { * **/ this.onDocumentChange = function(e) { - this.renderer.updateLines(e.data.range.start.row, e.data.range.end.row); + + // Rerender and emit "change" event. + var range = e.data.range; + var lastRow = (range.start.row == range.end.row ? range.end.row : Infinity); + this.renderer.updateLines(range.start.row, lastRow); this._emit("change", e); - // update cursor because tab characters can influence the cursor position. + // Update cursor because tab characters can influence the cursor position. this.$cursorChange(); }; diff --git a/lib/ace/layer/gutter.js b/lib/ace/layer/gutter.js index 9d813d2a..82dcf245 100644 --- a/lib/ace/layer/gutter.js +++ b/lib/ace/layer/gutter.js @@ -109,7 +109,7 @@ var Gutter = function(parentEl) { if (len === 0) { // do nothing } else if (delta.action == "delete") { - this.$annotations.splice(firstRow, len, null); + this.$annotations.splice(firstRow, len + 1, null); } else { var args = new Array(len + 1); args.unshift(firstRow, 1);