add mixed mode folding rules

This commit is contained in:
Fabian Jakobs 2011-12-02 13:19:36 +01:00
commit a37f9562e3
6 changed files with 213 additions and 8 deletions

View file

@ -44,7 +44,9 @@ var CssMode = require("./css").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
var MixedFoldMode = require("./folding/mixed").FoldMode;
var XmlFoldMode = require("./folding/xml").FoldMode;
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function() {
var highlighter = new HtmlHighlightRules();
@ -53,11 +55,11 @@ var Mode = function() {
this.$embeds = highlighter.getEmbeds();
this.createModeDelegates({
"js-": JavaScriptMode,
"css-": CssMode
"js-": JavaScriptMode,
"css-": CssMode
});
this.foldingRules = new XmlFoldMode({
this.foldingRules = new MixedFoldMode(new XmlFoldMode({
"area": 1,
"base": 1,
"br": 1,
@ -74,6 +76,9 @@ var Mode = function() {
"source": 1,
"track": 1,
"wbr": 1
}), {
"js-": new CStyleFoldMode(),
"css-": new CStyleFoldMode()
});
};
oop.inherits(Mode, TextMode);