we cannot cache the tokenized state all the time :(
This commit is contained in:
parent
e32c471f8e
commit
cc38fe6200
1 changed files with 7 additions and 1 deletions
|
|
@ -97,8 +97,14 @@ var BackgroundTokenizer = function(tokenizer) {
|
||||||
if (row > 0 && this.lines[row - 1]) {
|
if (row > 0 && this.lines[row - 1]) {
|
||||||
state = this.lines[row - 1].state;
|
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");
|
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];
|
return this.lines[row];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue