split mode specific code for structured folding

into separate files
This commit is contained in:
Fabian Jakobs 2011-12-01 18:19:24 +01:00
commit bbcb00acc4
27 changed files with 567 additions and 452 deletions

View file

@ -44,6 +44,7 @@ var CssMode = require("./css").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
var XmlFoldMode = require("./folding/xml").FoldMode;
var Mode = function() {
var highlighter = new HtmlHighlightRules();
@ -55,12 +56,30 @@ var Mode = function() {
"js-": JavaScriptMode,
"css-": CssMode
});
this.foldingRules = new XmlFoldMode({
"area": 1,
"base": 1,
"br": 1,
"col": 1,
"command": 1,
"embed": 1,
"hr": 1,
"img": 1,
"input": 1,
"keygen": 1,
"link": 1,
"meta": 1,
"param": 1,
"source": 1,
"track": 1,
"wbr": 1
});
};
oop.inherits(Mode, TextMode);
(function() {
this.foldingRules = "xml";
this.toggleCommentLines = function(state, doc, startRow, endRow) {
return 0;