data passed in a change event is now a delta
This commit is contained in:
parent
d436d71c20
commit
dba904d2b9
1 changed files with 9 additions and 3 deletions
|
|
@ -228,9 +228,15 @@ var Editor =function(renderer, session) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onDocumentChange = function(e) {
|
this.onDocumentChange = function(e) {
|
||||||
var data = e.data;
|
var delta = e.data;
|
||||||
this.bgTokenizer.start(data.firstRow);
|
var range = delta.range;
|
||||||
this.renderer.updateLines(data.firstRow, data.lastRow);
|
|
||||||
|
this.bgTokenizer.start(range.start.row);
|
||||||
|
if (range.start.row == range.end.row)
|
||||||
|
var lastRow = range.end.row;
|
||||||
|
else
|
||||||
|
lastRow = Infinity;
|
||||||
|
this.renderer.updateLines(range.start.row, lastRow);
|
||||||
|
|
||||||
// update cursor because tab characters can influence the cursor position
|
// update cursor because tab characters can influence the cursor position
|
||||||
this.renderer.updateCursor(this.getCursorPosition(), this.$overwrite);
|
this.renderer.updateCursor(this.getCursorPosition(), this.$overwrite);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue