fix tokenizer caching. Fixes #256
This commit is contained in:
parent
6de1e4f5f5
commit
0e4993f015
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue