parent
27768230c8
commit
026af74016
2 changed files with 7 additions and 3 deletions
|
|
@ -601,10 +601,14 @@ var Editor = function(renderer, session) {
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
this.onDocumentChange = function(e) {
|
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);
|
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();
|
this.$cursorChange();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ var Gutter = function(parentEl) {
|
||||||
if (len === 0) {
|
if (len === 0) {
|
||||||
// do nothing
|
// do nothing
|
||||||
} else if (delta.action == "delete") {
|
} else if (delta.action == "delete") {
|
||||||
this.$annotations.splice(firstRow, len, null);
|
this.$annotations.splice(firstRow, len + 1, null);
|
||||||
} else {
|
} else {
|
||||||
var args = new Array(len + 1);
|
var args = new Array(len + 1);
|
||||||
args.unshift(firstRow, 1);
|
args.unshift(firstRow, 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue