Permalink
Browse files

add folding rules to new modes

  • Loading branch information...
1 parent 3bc8726 commit 730084b6d134fdbcf7fad1cf1dfdc96299fa7234 @nightwing nightwing committed Nov 22, 2012
@@ -42,7 +42,7 @@ var oop = require("../lib/oop");
function Mode() {
this.$tokenizer = new Tokenizer(new Rules().getRules());
- this.$outdent = new Outdent();
+ this.$outdent = new Outdent();
this.foldingRules = new FoldMode();
}
@@ -44,10 +44,12 @@ var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var DartHighlightRules = require("./dart_highlight_rules").DartHighlightRules;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function() {
var highlighter = new DartHighlightRules();
-
+ this.foldingRules = new CStyleFoldMode();
+
this.$tokenizer = new Tokenizer(highlighter.getRules());
};
oop.inherits(Mode, TextMode);
@@ -19,7 +19,6 @@ define(function(require, exports, module) {
this.toggleCommentLines = function(state, doc, startRow, endRow) {
var outdent = true;
- var outentedRows = [];
var re = /^(\s*)\/\//;
for (var i=startRow; i<= endRow; i++) {
@@ -44,9 +44,11 @@ var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var HamlHighlightRules = require("./haml_highlight_rules").HamlHighlightRules;
+var FoldMode = require("./folding/coffee").FoldMode;
var Mode = function() {
var highlighter = new HamlHighlightRules();
+ this.foldingRules = new FoldMode();
this.$tokenizer = new Tokenizer(highlighter.getRules());
};
@@ -44,9 +44,11 @@ var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var MakefileHighlightRules = require("./makefile_highlight_rules").MakefileHighlightRules;
+var FoldMode = require("./folding/coffee").FoldMode;
var Mode = function() {
var highlighter = new MakefileHighlightRules();
+ this.foldingRules = new FoldMode();
this.$tokenizer = new Tokenizer(highlighter.getRules());
};
@@ -44,10 +44,12 @@ var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var ObjectiveCHighlightRules = require("./objectivec_highlight_rules").ObjectiveCHighlightRules;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
var Mode = function() {
var highlighter = new ObjectiveCHighlightRules();
-
+ this.foldingRules = new CStyleFoldMode();
+
this.$tokenizer = new Tokenizer(highlighter.getRules());
};
oop.inherits(Mode, TextMode);
@@ -44,9 +44,11 @@ var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var StylusHighlightRules = require("./stylus_highlight_rules").StylusHighlightRules;
+var FoldMode = require("./folding/coffee").FoldMode;
var Mode = function() {
var highlighter = new StylusHighlightRules();
+ this.foldingRules = new FoldMode();
this.$tokenizer = new Tokenizer(highlighter.getRules());
};
View
@@ -44,10 +44,12 @@ var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var %language%HighlightRules = require("./%languageHighlightFilename%_highlight_rules").%language%HighlightRules;
+// TODO: pick appropriate fold mode
+var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function() {
var highlighter = new %language%HighlightRules();
-
+ this.foldingRules = new FoldMode();
this.$tokenizer = new Tokenizer(highlighter.getRules());
};
oop.inherits(Mode, TextMode);

0 comments on commit 730084b

Please sign in to comment.