make sure text redraw isn't missed when bgTokenizer state changes
This commit is contained in:
parent
d01cbaf698
commit
f4990b3a56
1 changed files with 2 additions and 7 deletions
|
|
@ -36,8 +36,6 @@ var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
|||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Tokenizes the current [[Document `Document`]] in the background, and caches the tokenized rows for future use.
|
||||
*
|
||||
* If a certain row is changed, everything below that row is re-tokenized.
|
||||
|
|
@ -50,8 +48,6 @@ var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
|||
* @param {Tokenizer} tokenizer The tokenizer to use
|
||||
* @param {Editor} editor The editor to associate with
|
||||
*
|
||||
*
|
||||
*
|
||||
* @constructor
|
||||
**/
|
||||
|
||||
|
|
@ -89,10 +85,9 @@ var BackgroundTokenizer = function(tokenizer, editor) {
|
|||
|
||||
// only check every 5 lines
|
||||
processedLines ++;
|
||||
if ((processedLines % 5 == 0) && (new Date() - workerStart) > 20) {
|
||||
if ((processedLines % 5 === 0) && (new Date() - workerStart) > 20) {
|
||||
self.running = setTimeout(self.$worker, 20);
|
||||
self.currentLine = currentLine;
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
self.currentLine = currentLine;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue