Fix bug in TextLayer.updateLines

This commit is contained in:
Julian Viereck 2011-04-25 01:06:42 +02:00
commit 4beecc086a
2 changed files with 12 additions and 1 deletions

View file

@ -1498,6 +1498,10 @@ var EditSession = function(text, mode) {
return [];
}
this.containsRow = function(row) {
return row >= this.start.row && row <= this.end.row;
}
this.walk = function(callback, endRow, endColumn) {
var lastEnd = 0,
folds = this.folds,

View file

@ -190,8 +190,15 @@ var Text = function(parentEl) {
lineElementsIdx = 0;
for (var row = config.firstRow; row < first; row++) {
var foldLine = this.session.getFoldLine(row);
if (foldLine) {
if (foldLine.containsRow(first)) {
break;
} else {
row = foldLine.end.row;
}
}
lineElementsIdx ++;
row = this.session.getRowFoldEnd(row);
}
for (var i=first; i<=last; i++) {