Skip to content
This repository
Browse code

add folding rules to new modes

  • Loading branch information...
commit 730084b6d134fdbcf7fad1cf1dfdc96299fa7234 1 parent 3bc8726
Harutyun Amirjanyan authored November 22, 2012
2  lib/ace/mode/coffee.js
@@ -42,7 +42,7 @@ var oop = require("../lib/oop");
42 42
 
43 43
 function Mode() {
44 44
     this.$tokenizer = new Tokenizer(new Rules().getRules());
45  
-    this.$outdent   = new Outdent();
  45
+    this.$outdent = new Outdent();
46 46
     this.foldingRules = new FoldMode();
47 47
 }
48 48
 
4  lib/ace/mode/dart.js
@@ -44,10 +44,12 @@ var oop = require("../lib/oop");
44 44
 var TextMode = require("./text").Mode;
45 45
 var Tokenizer = require("../tokenizer").Tokenizer;
46 46
 var DartHighlightRules = require("./dart_highlight_rules").DartHighlightRules;
  47
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
47 48
 
48 49
 var Mode = function() {
49 50
     var highlighter = new DartHighlightRules();
50  
-    
  51
+    this.foldingRules = new CStyleFoldMode();
  52
+
51 53
     this.$tokenizer = new Tokenizer(highlighter.getRules());
52 54
 };
53 55
 oop.inherits(Mode, TextMode);
1  lib/ace/mode/golang.js
@@ -19,7 +19,6 @@ define(function(require, exports, module) {
19 19
         
20 20
         this.toggleCommentLines = function(state, doc, startRow, endRow) {
21 21
             var outdent = true;
22  
-            var outentedRows = [];
23 22
             var re = /^(\s*)\/\//;
24 23
 
25 24
             for (var i=startRow; i<= endRow; i++) {
2  lib/ace/mode/haml.js
@@ -44,9 +44,11 @@ var oop = require("../lib/oop");
44 44
 var TextMode = require("./text").Mode;
45 45
 var Tokenizer = require("../tokenizer").Tokenizer;
46 46
 var HamlHighlightRules = require("./haml_highlight_rules").HamlHighlightRules;
  47
+var FoldMode = require("./folding/coffee").FoldMode;
47 48
 
48 49
 var Mode = function() {
49 50
     var highlighter = new HamlHighlightRules();
  51
+    this.foldingRules = new FoldMode();    
50 52
     
51 53
     this.$tokenizer = new Tokenizer(highlighter.getRules());
52 54
 };
2  lib/ace/mode/makefile.js
@@ -44,9 +44,11 @@ var oop = require("../lib/oop");
44 44
 var TextMode = require("./text").Mode;
45 45
 var Tokenizer = require("../tokenizer").Tokenizer;
46 46
 var MakefileHighlightRules = require("./makefile_highlight_rules").MakefileHighlightRules;
  47
+var FoldMode = require("./folding/coffee").FoldMode;
47 48
 
48 49
 var Mode = function() {
49 50
     var highlighter = new MakefileHighlightRules();
  51
+    this.foldingRules = new FoldMode();
50 52
     
51 53
     this.$tokenizer = new Tokenizer(highlighter.getRules());
52 54
 };
4  lib/ace/mode/objectivec.js
@@ -44,10 +44,12 @@ var oop = require("../lib/oop");
44 44
 var TextMode = require("./text").Mode;
45 45
 var Tokenizer = require("../tokenizer").Tokenizer;
46 46
 var ObjectiveCHighlightRules = require("./objectivec_highlight_rules").ObjectiveCHighlightRules;
  47
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
47 48
 
48 49
 var Mode = function() {
49 50
     var highlighter = new ObjectiveCHighlightRules();
50  
-    
  51
+    this.foldingRules = new CStyleFoldMode();
  52
+
51 53
     this.$tokenizer = new Tokenizer(highlighter.getRules());
52 54
 };
53 55
 oop.inherits(Mode, TextMode);
2  lib/ace/mode/stylus.js
@@ -44,9 +44,11 @@ var oop = require("../lib/oop");
44 44
 var TextMode = require("./text").Mode;
45 45
 var Tokenizer = require("../tokenizer").Tokenizer;
46 46
 var StylusHighlightRules = require("./stylus_highlight_rules").StylusHighlightRules;
  47
+var FoldMode = require("./folding/coffee").FoldMode;
47 48
 
48 49
 var Mode = function() {
49 50
     var highlighter = new StylusHighlightRules();
  51
+    this.foldingRules = new FoldMode();
50 52
     
51 53
     this.$tokenizer = new Tokenizer(highlighter.getRules());
52 54
 };
4  tool/mode.tmpl.js
@@ -44,10 +44,12 @@ var oop = require("../lib/oop");
44 44
 var TextMode = require("./text").Mode;
45 45
 var Tokenizer = require("../tokenizer").Tokenizer;
46 46
 var %language%HighlightRules = require("./%languageHighlightFilename%_highlight_rules").%language%HighlightRules;
  47
+// TODO: pick appropriate fold mode
  48
+var FoldMode = require("./folding/cstyle").FoldMode;
47 49
 
48 50
 var Mode = function() {
49 51
     var highlighter = new %language%HighlightRules();
50  
-    
  52
+    this.foldingRules = new FoldMode();
51 53
     this.$tokenizer = new Tokenizer(highlighter.getRules());
52 54
 };
53 55
 oop.inherits(Mode, TextMode);

0 notes on commit 730084b

Please sign in to comment.
Something went wrong with that request. Please try again.