fix tokenizer caching. Fixes #256

This commit is contained in:
Fabian Jakobs 2011-05-23 08:45:33 +00:00
commit 0e4993f015

View file

@ -141,6 +141,9 @@ var BackgroundTokenizer = function(tokenizer, editor) {
if (firstRow > 0 && this.lines[firstRow - 1]) {
state = this.lines[firstRow - 1].state;
doCache = true;
} else if (firstRow == 0) {
state = "start";
doCache = true;
}
var lines = this.doc.getLines(firstRow, lastRow);
@ -150,6 +153,7 @@ var BackgroundTokenizer = function(tokenizer, editor) {
var state = tokens.state;
rows.push(tokens);
console.log("do cache", doCache, row, state)
if (doCache) {
this.lines[row] = tokens;
}