Fix render bugs

Both were introduced in 2e6f12725b.
This commit is contained in:
aldendaniels 2014-01-01 12:04:12 -06:00
commit 026af74016
2 changed files with 7 additions and 3 deletions

View file

@ -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();
};

View file

@ -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);