create tokenizer only when needed

This commit is contained in:
nightwing 2013-09-09 18:08:23 +04:00
commit 811d190c95
95 changed files with 122 additions and 281 deletions

View file

@ -27,9 +27,9 @@ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutd
var Mode = function(suppressHighlighting) {
if (suppressHighlighting)
this.$tokenizer = new Tokenizer(new TextHighlightRules().getRules());
this.HighlightRules = TextHighlightRules;
else
this.$tokenizer = new Tokenizer(new TexHighlightRules().getRules());
this.HighlightRules = TexHighlightRules;
this.$outdent = new MatchingBraceOutdent();
};
oop.inherits(Mode, TextMode);