we cannot cache the tokenized state all the time :(

This commit is contained in:
Fabian Jakobs 2010-09-25 10:14:24 +02:00
commit cc38fe6200

View file

@ -97,8 +97,14 @@ var BackgroundTokenizer = function(tokenizer) {
if (row > 0 && this.lines[row - 1]) {
state = this.lines[row - 1].state;
}
// TODO find a proper way to cache every line
var tokens = this.tokenizer.getLineTokens(this.textLines[row] || "", state || "start");
this.lines[row] = tokens;
if (state) {
this.lines[row] = tokens;
} else {
return tokens;
}
}
return this.lines[row];
};