ace-rails-ap 0.0.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ace/rails/version.rb +1 -1
- data/vendor/assets/javascripts/ace.js +15680 -1
- data/vendor/assets/javascripts/keybinding-emacs.js +367 -1
- data/vendor/assets/javascripts/keybinding-vim.js +1635 -1
- data/vendor/assets/javascripts/mode-c9search.js +275 -0
- data/vendor/assets/javascripts/mode-c_cpp.js +744 -1
- data/vendor/assets/javascripts/mode-clojure.js +364 -1
- data/vendor/assets/javascripts/mode-coffee.js +527 -1
- data/vendor/assets/javascripts/mode-coldfusion.js +1966 -1
- data/vendor/assets/javascripts/mode-csharp.js +633 -1
- data/vendor/assets/javascripts/mode-css.js +499 -1
- data/vendor/assets/javascripts/mode-diff.js +250 -0
- data/vendor/assets/javascripts/{mode-c_cpp-uncompressed.js → mode-glsl.js} +147 -244
- data/vendor/assets/javascripts/mode-golang.js +681 -1
- data/vendor/assets/javascripts/mode-groovy.js +1240 -1
- data/vendor/assets/javascripts/mode-haxe.js +633 -1
- data/vendor/assets/javascripts/mode-html.js +2064 -1
- data/vendor/assets/javascripts/mode-java.js +1202 -1
- data/vendor/assets/javascripts/mode-javascript.js +1069 -1
- data/vendor/assets/javascripts/mode-json.js +588 -1
- data/vendor/assets/javascripts/{mode-haxe-uncompressed.js → mode-jsx.js} +189 -312
- data/vendor/assets/javascripts/mode-latex.js +95 -1
- data/vendor/assets/javascripts/mode-less.js +512 -1
- data/vendor/assets/javascripts/mode-liquid.js +1125 -1
- data/vendor/assets/javascripts/mode-lua.js +551 -1
- data/vendor/assets/javascripts/{mode-html-uncompressed.js → mode-luahtml.js} +544 -604
- data/vendor/assets/javascripts/{mode-coldfusion-uncompressed.js → mode-luapage.js} +2326 -2180
- data/vendor/assets/javascripts/mode-markdown.js +2369 -1
- data/vendor/assets/javascripts/mode-ocaml.js +464 -1
- data/vendor/assets/javascripts/mode-perl.js +432 -1
- data/vendor/assets/javascripts/mode-pgsql.js +970 -1
- data/vendor/assets/javascripts/mode-php.js +1718 -1
- data/vendor/assets/javascripts/mode-powershell.js +610 -1
- data/vendor/assets/javascripts/mode-python.js +397 -1
- data/vendor/assets/javascripts/mode-ruby.js +318 -1
- data/vendor/assets/javascripts/mode-scad.js +732 -1
- data/vendor/assets/javascripts/mode-scala.js +1237 -1
- data/vendor/assets/javascripts/mode-scss.js +537 -1
- data/vendor/assets/javascripts/mode-sh.js +250 -1
- data/vendor/assets/javascripts/mode-sql.js +140 -1
- data/vendor/assets/javascripts/mode-svg.js +1681 -1
- data/vendor/assets/javascripts/mode-tcl.js +320 -0
- data/vendor/assets/javascripts/mode-textile.js +182 -1
- data/vendor/assets/javascripts/mode-xml.js +829 -1
- data/vendor/assets/javascripts/mode-xquery.js +605 -1
- data/vendor/assets/javascripts/mode-yaml.js +189 -0
- data/vendor/assets/javascripts/theme-chrome.js +213 -1
- data/vendor/assets/javascripts/theme-clouds.js +167 -1
- data/vendor/assets/javascripts/theme-clouds_midnight.js +168 -1
- data/vendor/assets/javascripts/theme-cobalt.js +194 -1
- data/vendor/assets/javascripts/theme-crimson_editor.js +200 -1
- data/vendor/assets/javascripts/theme-dawn.js +198 -1
- data/vendor/assets/javascripts/theme-dreamweaver.js +230 -1
- data/vendor/assets/javascripts/theme-eclipse.js +157 -1
- data/vendor/assets/javascripts/theme-github.js +182 -0
- data/vendor/assets/javascripts/theme-idle_fingers.js +186 -1
- data/vendor/assets/javascripts/theme-kr_theme.js +189 -1
- data/vendor/assets/javascripts/theme-merbivore.js +189 -1
- data/vendor/assets/javascripts/theme-merbivore_soft.js +195 -1
- data/vendor/assets/javascripts/theme-mono_industrial.js +197 -1
- data/vendor/assets/javascripts/theme-monokai.js +194 -1
- data/vendor/assets/javascripts/theme-pastel_on_dark.js +199 -1
- data/vendor/assets/javascripts/theme-solarized_dark.js +180 -1
- data/vendor/assets/javascripts/theme-solarized_light.js +179 -1
- data/vendor/assets/javascripts/theme-textmate.js +216 -0
- data/vendor/assets/javascripts/theme-tomorrow.js +213 -1
- data/vendor/assets/javascripts/theme-tomorrow_night.js +213 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_blue.js +213 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_bright.js +213 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_eighties.js +209 -1
- data/vendor/assets/javascripts/theme-twilight.js +211 -1
- data/vendor/assets/javascripts/theme-vibrant_ink.js +190 -1
- data/vendor/assets/javascripts/worker-coffee.js +83 -893
- data/vendor/assets/javascripts/worker-css.js +88 -1402
- data/vendor/assets/javascripts/worker-javascript.js +97 -812
- data/vendor/assets/javascripts/worker-json.js +84 -761
- data/vendor/assets/javascripts/worker-xquery.js +66464 -0
- metadata +12 -195
- data/vendor/assets/javascripts/ace-compat-noconflict.js +0 -1
- data/vendor/assets/javascripts/ace-compat-uncompressed-noconflict.js +0 -480
- data/vendor/assets/javascripts/ace-compat-uncompressed.js +0 -480
- data/vendor/assets/javascripts/ace-compat.js +0 -1
- data/vendor/assets/javascripts/ace-noconflict.js +0 -10
- data/vendor/assets/javascripts/ace-uncompressed-noconflict.js +0 -19976
- data/vendor/assets/javascripts/ace-uncompressed.js +0 -19976
- data/vendor/assets/javascripts/keybinding-emacs-noconflict.js +0 -1
- data/vendor/assets/javascripts/keybinding-emacs-uncompressed-noconflict.js +0 -150
- data/vendor/assets/javascripts/keybinding-emacs-uncompressed.js +0 -150
- data/vendor/assets/javascripts/keybinding-vim-noconflict.js +0 -1
- data/vendor/assets/javascripts/keybinding-vim-uncompressed-noconflict.js +0 -138
- data/vendor/assets/javascripts/keybinding-vim-uncompressed.js +0 -138
- data/vendor/assets/javascripts/mode-c_cpp-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-c_cpp-uncompressed-noconflict.js +0 -919
- data/vendor/assets/javascripts/mode-clojure-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-clojure-uncompressed-noconflict.js +0 -422
- data/vendor/assets/javascripts/mode-clojure-uncompressed.js +0 -422
- data/vendor/assets/javascripts/mode-coffee-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-coffee-uncompressed-noconflict.js +0 -607
- data/vendor/assets/javascripts/mode-coffee-uncompressed.js +0 -607
- data/vendor/assets/javascripts/mode-coldfusion-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-coldfusion-uncompressed-noconflict.js +0 -2458
- data/vendor/assets/javascripts/mode-csharp-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-csharp-uncompressed-noconflict.js +0 -769
- data/vendor/assets/javascripts/mode-csharp-uncompressed.js +0 -769
- data/vendor/assets/javascripts/mode-css-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-css-uncompressed-noconflict.js +0 -641
- data/vendor/assets/javascripts/mode-css-uncompressed.js +0 -641
- data/vendor/assets/javascripts/mode-golang-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-golang-uncompressed-noconflict.js +0 -378
- data/vendor/assets/javascripts/mode-golang-uncompressed.js +0 -378
- data/vendor/assets/javascripts/mode-groovy-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-groovy-uncompressed-noconflict.js +0 -1393
- data/vendor/assets/javascripts/mode-groovy-uncompressed.js +0 -1393
- data/vendor/assets/javascripts/mode-haxe-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-haxe-uncompressed-noconflict.js +0 -769
- data/vendor/assets/javascripts/mode-html-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-html-uncompressed-noconflict.js +0 -2475
- data/vendor/assets/javascripts/mode-java-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-java-uncompressed-noconflict.js +0 -1395
- data/vendor/assets/javascripts/mode-java-uncompressed.js +0 -1395
- data/vendor/assets/javascripts/mode-javascript-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-javascript-uncompressed-noconflict.js +0 -1226
- data/vendor/assets/javascripts/mode-javascript-uncompressed.js +0 -1226
- data/vendor/assets/javascripts/mode-json-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-json-uncompressed-noconflict.js +0 -701
- data/vendor/assets/javascripts/mode-json-uncompressed.js +0 -701
- data/vendor/assets/javascripts/mode-latex-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-latex-uncompressed-noconflict.js +0 -95
- data/vendor/assets/javascripts/mode-latex-uncompressed.js +0 -95
- data/vendor/assets/javascripts/mode-less-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-less-uncompressed-noconflict.js +0 -655
- data/vendor/assets/javascripts/mode-less-uncompressed.js +0 -655
- data/vendor/assets/javascripts/mode-liquid-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-liquid-uncompressed-noconflict.js +0 -1353
- data/vendor/assets/javascripts/mode-liquid-uncompressed.js +0 -1353
- data/vendor/assets/javascripts/mode-lua-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-lua-uncompressed-noconflict.js +0 -523
- data/vendor/assets/javascripts/mode-lua-uncompressed.js +0 -523
- data/vendor/assets/javascripts/mode-markdown-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-markdown-uncompressed-noconflict.js +0 -2925
- data/vendor/assets/javascripts/mode-markdown-uncompressed.js +0 -2925
- data/vendor/assets/javascripts/mode-ocaml-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-ocaml-uncompressed-noconflict.js +0 -539
- data/vendor/assets/javascripts/mode-ocaml-uncompressed.js +0 -539
- data/vendor/assets/javascripts/mode-perl-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-perl-uncompressed-noconflict.js +0 -574
- data/vendor/assets/javascripts/mode-perl-uncompressed.js +0 -574
- data/vendor/assets/javascripts/mode-pgsql-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-pgsql-uncompressed-noconflict.js +0 -1104
- data/vendor/assets/javascripts/mode-pgsql-uncompressed.js +0 -1104
- data/vendor/assets/javascripts/mode-php-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-php-uncompressed-noconflict.js +0 -1885
- data/vendor/assets/javascripts/mode-php-uncompressed.js +0 -1885
- data/vendor/assets/javascripts/mode-powershell-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-powershell-uncompressed-noconflict.js +0 -710
- data/vendor/assets/javascripts/mode-powershell-uncompressed.js +0 -710
- data/vendor/assets/javascripts/mode-python-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-python-uncompressed-noconflict.js +0 -507
- data/vendor/assets/javascripts/mode-python-uncompressed.js +0 -507
- data/vendor/assets/javascripts/mode-ruby-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-ruby-uncompressed-noconflict.js +0 -391
- data/vendor/assets/javascripts/mode-ruby-uncompressed.js +0 -391
- data/vendor/assets/javascripts/mode-scad-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-scad-uncompressed-noconflict.js +0 -907
- data/vendor/assets/javascripts/mode-scad-uncompressed.js +0 -907
- data/vendor/assets/javascripts/mode-scala-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-scala-uncompressed-noconflict.js +0 -1395
- data/vendor/assets/javascripts/mode-scala-uncompressed.js +0 -1395
- data/vendor/assets/javascripts/mode-scss-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-scss-uncompressed-noconflict.js +0 -679
- data/vendor/assets/javascripts/mode-scss-uncompressed.js +0 -679
- data/vendor/assets/javascripts/mode-sh-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-sh-uncompressed-noconflict.js +0 -289
- data/vendor/assets/javascripts/mode-sh-uncompressed.js +0 -289
- data/vendor/assets/javascripts/mode-sql-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-sql-uncompressed-noconflict.js +0 -159
- data/vendor/assets/javascripts/mode-sql-uncompressed.js +0 -159
- data/vendor/assets/javascripts/mode-svg-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-svg-uncompressed-noconflict.js +0 -2137
- data/vendor/assets/javascripts/mode-svg-uncompressed.js +0 -2137
- data/vendor/assets/javascripts/mode-text-noconflict.js +0 -0
- data/vendor/assets/javascripts/mode-text-uncompressed-noconflict.js +0 -0
- data/vendor/assets/javascripts/mode-text-uncompressed.js +0 -0
- data/vendor/assets/javascripts/mode-textile-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-textile-uncompressed-noconflict.js +0 -254
- data/vendor/assets/javascripts/mode-textile-uncompressed.js +0 -254
- data/vendor/assets/javascripts/mode-xml-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-xml-uncompressed-noconflict.js +0 -1012
- data/vendor/assets/javascripts/mode-xml-uncompressed.js +0 -1012
- data/vendor/assets/javascripts/mode-xquery-noconflict.js +0 -1
- data/vendor/assets/javascripts/mode-xquery-uncompressed-noconflict.js +0 -540
- data/vendor/assets/javascripts/mode-xquery-uncompressed.js +0 -540
- data/vendor/assets/javascripts/theme-chrome-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-chrome-uncompressed-noconflict.js +0 -207
- data/vendor/assets/javascripts/theme-chrome-uncompressed.js +0 -207
- data/vendor/assets/javascripts/theme-clouds-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-clouds-uncompressed-noconflict.js +0 -160
- data/vendor/assets/javascripts/theme-clouds-uncompressed.js +0 -160
- data/vendor/assets/javascripts/theme-clouds_midnight-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed-noconflict.js +0 -161
- data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed.js +0 -161
- data/vendor/assets/javascripts/theme-cobalt-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-cobalt-uncompressed-noconflict.js +0 -187
- data/vendor/assets/javascripts/theme-cobalt-uncompressed.js +0 -187
- data/vendor/assets/javascripts/theme-crimson_editor-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-crimson_editor-uncompressed-noconflict.js +0 -198
- data/vendor/assets/javascripts/theme-crimson_editor-uncompressed.js +0 -198
- data/vendor/assets/javascripts/theme-dawn-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-dawn-uncompressed-noconflict.js +0 -191
- data/vendor/assets/javascripts/theme-dawn-uncompressed.js +0 -191
- data/vendor/assets/javascripts/theme-dreamweaver-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-dreamweaver-uncompressed-noconflict.js +0 -227
- data/vendor/assets/javascripts/theme-dreamweaver-uncompressed.js +0 -227
- data/vendor/assets/javascripts/theme-eclipse-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-eclipse-uncompressed-noconflict.js +0 -147
- data/vendor/assets/javascripts/theme-eclipse-uncompressed.js +0 -147
- data/vendor/assets/javascripts/theme-idle_fingers-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-idle_fingers-uncompressed-noconflict.js +0 -179
- data/vendor/assets/javascripts/theme-idle_fingers-uncompressed.js +0 -179
- data/vendor/assets/javascripts/theme-kr_theme-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-kr_theme-uncompressed-noconflict.js +0 -182
- data/vendor/assets/javascripts/theme-kr_theme-uncompressed.js +0 -182
- data/vendor/assets/javascripts/theme-merbivore-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-merbivore-uncompressed-noconflict.js +0 -182
- data/vendor/assets/javascripts/theme-merbivore-uncompressed.js +0 -182
- data/vendor/assets/javascripts/theme-merbivore_soft-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed-noconflict.js +0 -188
- data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed.js +0 -188
- data/vendor/assets/javascripts/theme-mono_industrial-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-mono_industrial-uncompressed-noconflict.js +0 -190
- data/vendor/assets/javascripts/theme-mono_industrial-uncompressed.js +0 -190
- data/vendor/assets/javascripts/theme-monokai-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-monokai-uncompressed-noconflict.js +0 -191
- data/vendor/assets/javascripts/theme-monokai-uncompressed.js +0 -191
- data/vendor/assets/javascripts/theme-pastel_on_dark-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed-noconflict.js +0 -192
- data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed.js +0 -192
- data/vendor/assets/javascripts/theme-solarized_dark-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-solarized_dark-uncompressed-noconflict.js +0 -176
- data/vendor/assets/javascripts/theme-solarized_dark-uncompressed.js +0 -176
- data/vendor/assets/javascripts/theme-solarized_light-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-solarized_light-uncompressed-noconflict.js +0 -172
- data/vendor/assets/javascripts/theme-solarized_light-uncompressed.js +0 -172
- data/vendor/assets/javascripts/theme-textmate-noconflict.js +0 -0
- data/vendor/assets/javascripts/theme-textmate-uncompressed-noconflict.js +0 -0
- data/vendor/assets/javascripts/theme-textmate-uncompressed.js +0 -0
- data/vendor/assets/javascripts/theme-tomorrow-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow-uncompressed-noconflict.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow-uncompressed.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed-noconflict.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night_blue-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed-noconflict.js +0 -209
- data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed.js +0 -209
- data/vendor/assets/javascripts/theme-tomorrow_night_bright-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed-noconflict.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed.js +0 -206
- data/vendor/assets/javascripts/theme-tomorrow_night_eighties-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed-noconflict.js +0 -202
- data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed.js +0 -202
- data/vendor/assets/javascripts/theme-twilight-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-twilight-uncompressed-noconflict.js +0 -204
- data/vendor/assets/javascripts/theme-twilight-uncompressed.js +0 -204
- data/vendor/assets/javascripts/theme-vibrant_ink-noconflict.js +0 -1
- data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed-noconflict.js +0 -183
- data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed.js +0 -183
@@ -1,20 +1,20 @@
|
|
1
|
-
define('ace/mode/
|
2
|
-
|
1
|
+
define('ace/mode/jsx', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/jsx_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
|
2
|
+
|
3
3
|
|
4
4
|
var oop = require("../lib/oop");
|
5
5
|
var TextMode = require("./text").Mode;
|
6
6
|
var Tokenizer = require("../tokenizer").Tokenizer;
|
7
|
-
var
|
7
|
+
var JsxHighlightRules = require("./jsx_highlight_rules").JsxHighlightRules;
|
8
8
|
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
|
9
9
|
var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
|
10
10
|
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
11
11
|
|
12
|
-
|
13
|
-
this.$tokenizer = new Tokenizer(new
|
12
|
+
function Mode() {
|
13
|
+
this.$tokenizer = new Tokenizer(new JsxHighlightRules().getRules());
|
14
14
|
this.$outdent = new MatchingBraceOutdent();
|
15
15
|
this.$behaviour = new CstyleBehaviour();
|
16
16
|
this.foldingRules = new CStyleFoldMode();
|
17
|
-
}
|
17
|
+
}
|
18
18
|
oop.inherits(Mode, TextMode);
|
19
19
|
|
20
20
|
(function() {
|
@@ -47,158 +47,135 @@ oop.inherits(Mode, TextMode);
|
|
47
47
|
this.$outdent.autoOutdent(doc, row);
|
48
48
|
};
|
49
49
|
|
50
|
-
|
51
|
-
this.createWorker = function(session) {
|
52
|
-
return null;
|
53
|
-
};
|
54
|
-
|
55
50
|
}).call(Mode.prototype);
|
56
51
|
|
57
52
|
exports.Mode = Mode;
|
58
53
|
});
|
59
|
-
define('ace/mode/
|
60
|
-
|
61
|
-
|
62
|
-
var
|
63
|
-
var
|
64
|
-
|
65
|
-
var
|
66
|
-
|
67
|
-
var
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
}, {
|
94
|
-
token : "string.regexp",
|
95
|
-
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
96
|
-
}, {
|
97
|
-
token : "string", // single line
|
98
|
-
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
99
|
-
}, {
|
100
|
-
token : "string", // single line
|
101
|
-
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
102
|
-
}, {
|
103
|
-
token : "constant.numeric", // hex
|
104
|
-
regex : "0[xX][0-9a-fA-F]+\\b"
|
105
|
-
}, {
|
106
|
-
token : "constant.numeric", // float
|
107
|
-
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
108
|
-
}, {
|
109
|
-
token : "constant.language.boolean",
|
110
|
-
regex : "(?:true|false)\\b"
|
111
|
-
}, {
|
112
|
-
token : function(value) {
|
113
|
-
if (value == "this")
|
114
|
-
return "variable.language";
|
115
|
-
else if (keywords.hasOwnProperty(value))
|
116
|
-
return "keyword";
|
117
|
-
else if (buildinConstants.hasOwnProperty(value))
|
118
|
-
return "constant.language";
|
119
|
-
else
|
120
|
-
return "identifier";
|
54
|
+
define('ace/mode/jsx_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
55
|
+
var oop = require("../lib/oop");
|
56
|
+
var lang = require("../lib/lang");
|
57
|
+
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
|
58
|
+
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
59
|
+
|
60
|
+
var JsxHighlightRules = function() {
|
61
|
+
var keywords = lang.arrayToMap(
|
62
|
+
("break|do|instanceof|typeof|case|else|new|var|catch|finally|return|void|continue|for|switch|default|while|function|this|" +
|
63
|
+
"if|throw|" +
|
64
|
+
"delete|in|try|" +
|
65
|
+
"class|extends|super|import|from|into|implements|interface|static|mixin|override|abstract|final|" +
|
66
|
+
"number|int|string|boolean|variant|" +
|
67
|
+
"log|assert").split("|")
|
68
|
+
);
|
69
|
+
|
70
|
+
var buildinConstants = lang.arrayToMap(
|
71
|
+
("null|true|false|NaN|Infinity|__FILE__|__LINE__|undefined").split("|")
|
72
|
+
);
|
73
|
+
|
74
|
+
var reserved = lang.arrayToMap(
|
75
|
+
("debugger|with|" +
|
76
|
+
"const|export|" +
|
77
|
+
"let|private|public|yield|protected|" +
|
78
|
+
"extern|native|as|operator|__fake__|__readonly__").split("|")
|
79
|
+
);
|
80
|
+
|
81
|
+
var identifierRe = "[a-zA-Z_][a-zA-Z0-9_]*\\b";
|
82
|
+
|
83
|
+
this.$rules = {
|
84
|
+
"start" : [
|
85
|
+
{
|
86
|
+
token : "comment",
|
87
|
+
regex : "\\/\\/.*$"
|
121
88
|
},
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
89
|
+
DocCommentHighlightRules.getStartRule("doc-start"),
|
90
|
+
{
|
91
|
+
token : "comment", // multi line comment
|
92
|
+
regex : "\\/\\*",
|
93
|
+
merge : true,
|
94
|
+
next : "comment"
|
95
|
+
}, {
|
96
|
+
token : "string.regexp",
|
97
|
+
regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
|
98
|
+
}, {
|
99
|
+
token : "string", // single line
|
100
|
+
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
|
101
|
+
}, {
|
102
|
+
token : "string", // single line
|
103
|
+
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
|
104
|
+
}, {
|
105
|
+
token : "constant.numeric", // hex
|
106
|
+
regex : "0[xX][0-9a-fA-F]+\\b"
|
107
|
+
}, {
|
108
|
+
token : "constant.numeric", // float
|
109
|
+
regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
|
110
|
+
}, {
|
111
|
+
token : "constant.language.boolean",
|
112
|
+
regex : "(?:true|false)\\b"
|
113
|
+
}, {
|
114
|
+
token : [
|
115
|
+
"storage.type",
|
116
|
+
"text",
|
117
|
+
"entity.name.function"
|
118
|
+
],
|
119
|
+
regex : "(function)(\\s+)(" + identifierRe + ")"
|
120
|
+
}, {
|
121
|
+
token : function(value) {
|
122
|
+
if (value == "this")
|
123
|
+
return "variable.language";
|
124
|
+
else if (value == "function")
|
125
|
+
return "storage.type";
|
126
|
+
else if (keywords.hasOwnProperty(value) || reserved.hasOwnProperty(value))
|
127
|
+
return "keyword";
|
128
|
+
else if (buildinConstants.hasOwnProperty(value))
|
129
|
+
return "constant.language";
|
130
|
+
else if (/^_?[A-Z][a-zA-Z0-9_]*$/.test(value))
|
131
|
+
return "language.support.class";
|
132
|
+
else
|
133
|
+
return "identifier";
|
134
|
+
},
|
135
|
+
// TODO: Unicode escape sequences
|
136
|
+
// TODO: Unicode identifiers
|
137
|
+
regex : identifierRe
|
138
|
+
}, {
|
139
|
+
token : "keyword.operator",
|
140
|
+
regex : "!|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
|
141
|
+
}, {
|
142
|
+
token : "punctuation.operator",
|
143
|
+
regex : "\\?|\\:|\\,|\\;|\\."
|
144
|
+
}, {
|
145
|
+
token : "paren.lparen",
|
146
|
+
regex : "[[({<]"
|
147
|
+
}, {
|
148
|
+
token : "paren.rparen",
|
149
|
+
regex : "[\\])}>]"
|
150
|
+
}, {
|
151
|
+
token : "text",
|
152
|
+
regex : "\\s+"
|
153
|
+
}
|
154
|
+
],
|
155
|
+
"comment" : [
|
156
|
+
{
|
157
|
+
token : "comment", // closing comment
|
158
|
+
regex : ".*?\\*\\/",
|
159
|
+
next : "start"
|
160
|
+
}, {
|
161
|
+
token : "comment", // comment spanning whole line
|
162
|
+
merge : true,
|
163
|
+
regex : ".+"
|
164
|
+
}
|
165
|
+
]
|
166
|
+
};
|
167
|
+
|
168
|
+
this.embedRules(DocCommentHighlightRules, "doc-",
|
169
|
+
[ DocCommentHighlightRules.getEndRule("start") ]);
|
153
170
|
};
|
171
|
+
|
172
|
+
oop.inherits(JsxHighlightRules, TextHighlightRules);
|
154
173
|
|
155
|
-
|
156
|
-
[ DocCommentHighlightRules.getEndRule("start") ]);
|
157
|
-
};
|
158
|
-
|
159
|
-
oop.inherits(HaxeHighlightRules, TextHighlightRules);
|
160
|
-
|
161
|
-
exports.HaxeHighlightRules = HaxeHighlightRules;
|
174
|
+
exports.JsxHighlightRules = JsxHighlightRules;
|
162
175
|
});
|
163
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
164
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
165
|
-
*
|
166
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
167
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
168
|
-
* the License. You may obtain a copy of the License at
|
169
|
-
* http://www.mozilla.org/MPL/
|
170
|
-
*
|
171
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
172
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
173
|
-
* for the specific language governing rights and limitations under the
|
174
|
-
* License.
|
175
|
-
*
|
176
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
177
|
-
*
|
178
|
-
* The Initial Developer of the Original Code is
|
179
|
-
* Ajax.org B.V.
|
180
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
181
|
-
* the Initial Developer. All Rights Reserved.
|
182
|
-
*
|
183
|
-
* Contributor(s):
|
184
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
185
|
-
*
|
186
|
-
* Alternatively, the contents of this file may be used under the terms of
|
187
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
188
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
189
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
190
|
-
* of those above. If you wish to allow use of your version of this file only
|
191
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
192
|
-
* use your version of this file under the terms of the MPL, indicate your
|
193
|
-
* decision by deleting the provisions above and replace them with the notice
|
194
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
195
|
-
* the provisions above, a recipient may use your version of this file under
|
196
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
197
|
-
*
|
198
|
-
* ***** END LICENSE BLOCK ***** */
|
199
176
|
|
200
177
|
define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
|
201
|
-
|
178
|
+
|
202
179
|
|
203
180
|
var oop = require("../lib/oop");
|
204
181
|
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
@@ -253,45 +230,9 @@ DocCommentHighlightRules.getEndRule = function (start) {
|
|
253
230
|
exports.DocCommentHighlightRules = DocCommentHighlightRules;
|
254
231
|
|
255
232
|
});
|
256
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
257
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
258
|
-
*
|
259
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
260
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
261
|
-
* the License. You may obtain a copy of the License at
|
262
|
-
* http://www.mozilla.org/MPL/
|
263
|
-
*
|
264
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
265
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
266
|
-
* for the specific language governing rights and limitations under the
|
267
|
-
* License.
|
268
|
-
*
|
269
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
270
|
-
*
|
271
|
-
* The Initial Developer of the Original Code is
|
272
|
-
* Ajax.org B.V.
|
273
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
274
|
-
* the Initial Developer. All Rights Reserved.
|
275
|
-
*
|
276
|
-
* Contributor(s):
|
277
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
278
|
-
*
|
279
|
-
* Alternatively, the contents of this file may be used under the terms of
|
280
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
281
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
282
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
283
|
-
* of those above. If you wish to allow use of your version of this file only
|
284
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
285
|
-
* use your version of this file under the terms of the MPL, indicate your
|
286
|
-
* decision by deleting the provisions above and replace them with the notice
|
287
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
288
|
-
* the provisions above, a recipient may use your version of this file under
|
289
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
290
|
-
*
|
291
|
-
* ***** END LICENSE BLOCK ***** */
|
292
233
|
|
293
234
|
define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
294
|
-
|
235
|
+
|
295
236
|
|
296
237
|
var Range = require("../range").Range;
|
297
238
|
|
@@ -334,49 +275,12 @@ var MatchingBraceOutdent = function() {};
|
|
334
275
|
|
335
276
|
exports.MatchingBraceOutdent = MatchingBraceOutdent;
|
336
277
|
});
|
337
|
-
/* vim:ts=4:sts=4:sw=4:
|
338
|
-
* ***** BEGIN LICENSE BLOCK *****
|
339
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
340
|
-
*
|
341
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
342
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
343
|
-
* the License. You may obtain a copy of the License at
|
344
|
-
* http://www.mozilla.org/MPL/
|
345
|
-
*
|
346
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
347
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
348
|
-
* for the specific language governing rights and limitations under the
|
349
|
-
* License.
|
350
|
-
*
|
351
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
352
|
-
*
|
353
|
-
* The Initial Developer of the Original Code is
|
354
|
-
* Ajax.org B.V.
|
355
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
356
|
-
* the Initial Developer. All Rights Reserved.
|
357
|
-
*
|
358
|
-
* Contributor(s):
|
359
|
-
* Chris Spencer <chris.ag.spencer AT googlemail DOT com>
|
360
|
-
*
|
361
|
-
* Alternatively, the contents of this file may be used under the terms of
|
362
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
363
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
364
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
365
|
-
* of those above. If you wish to allow use of your version of this file only
|
366
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
367
|
-
* use your version of this file under the terms of the MPL, indicate your
|
368
|
-
* decision by deleting the provisions above and replace them with the notice
|
369
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
370
|
-
* the provisions above, a recipient may use your version of this file under
|
371
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
372
|
-
*
|
373
|
-
* ***** END LICENSE BLOCK ***** */
|
374
278
|
|
375
279
|
define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
|
376
|
-
|
280
|
+
|
377
281
|
|
378
282
|
var oop = require("../../lib/oop");
|
379
|
-
var Behaviour = require(
|
283
|
+
var Behaviour = require("../behaviour").Behaviour;
|
380
284
|
|
381
285
|
var CstyleBehaviour = function () {
|
382
286
|
|
@@ -483,6 +387,49 @@ var CstyleBehaviour = function () {
|
|
483
387
|
}
|
484
388
|
});
|
485
389
|
|
390
|
+
this.add("brackets", "insertion", function (state, action, editor, session, text) {
|
391
|
+
if (text == '[') {
|
392
|
+
var selection = editor.getSelectionRange();
|
393
|
+
var selected = session.doc.getTextRange(selection);
|
394
|
+
if (selected !== "") {
|
395
|
+
return {
|
396
|
+
text: '[' + selected + ']',
|
397
|
+
selection: false
|
398
|
+
};
|
399
|
+
} else {
|
400
|
+
return {
|
401
|
+
text: '[]',
|
402
|
+
selection: [1, 1]
|
403
|
+
};
|
404
|
+
}
|
405
|
+
} else if (text == ']') {
|
406
|
+
var cursor = editor.getCursorPosition();
|
407
|
+
var line = session.doc.getLine(cursor.row);
|
408
|
+
var rightChar = line.substring(cursor.column, cursor.column + 1);
|
409
|
+
if (rightChar == ']') {
|
410
|
+
var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
|
411
|
+
if (matching !== null) {
|
412
|
+
return {
|
413
|
+
text: '',
|
414
|
+
selection: [1, 1]
|
415
|
+
};
|
416
|
+
}
|
417
|
+
}
|
418
|
+
}
|
419
|
+
});
|
420
|
+
|
421
|
+
this.add("brackets", "deletion", function (state, action, editor, session, range) {
|
422
|
+
var selected = session.doc.getTextRange(range);
|
423
|
+
if (!range.isMultiLine() && selected == '[') {
|
424
|
+
var line = session.doc.getLine(range.start.row);
|
425
|
+
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
|
426
|
+
if (rightChar == ']') {
|
427
|
+
range.end.column++;
|
428
|
+
return range;
|
429
|
+
}
|
430
|
+
}
|
431
|
+
});
|
432
|
+
|
486
433
|
this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
|
487
434
|
if (text == '"' || text == "'") {
|
488
435
|
var quote = text;
|
@@ -504,7 +451,7 @@ var CstyleBehaviour = function () {
|
|
504
451
|
}
|
505
452
|
|
506
453
|
// Find what token we're inside.
|
507
|
-
var tokens = session.getTokens(selection.start.row
|
454
|
+
var tokens = session.getTokens(selection.start.row);
|
508
455
|
var col = 0, token;
|
509
456
|
var quotepos = -1; // Track whether we're inside an open quote.
|
510
457
|
|
@@ -559,45 +506,9 @@ oop.inherits(CstyleBehaviour, Behaviour);
|
|
559
506
|
|
560
507
|
exports.CstyleBehaviour = CstyleBehaviour;
|
561
508
|
});
|
562
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
563
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
564
|
-
*
|
565
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
566
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
567
|
-
* the License. You may obtain a copy of the License at
|
568
|
-
* http://www.mozilla.org/MPL/
|
569
|
-
*
|
570
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
571
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
572
|
-
* for the specific language governing rights and limitations under the
|
573
|
-
* License.
|
574
|
-
*
|
575
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
576
|
-
*
|
577
|
-
* The Initial Developer of the Original Code is
|
578
|
-
* Ajax.org B.V.
|
579
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
580
|
-
* the Initial Developer. All Rights Reserved.
|
581
|
-
*
|
582
|
-
* Contributor(s):
|
583
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
584
|
-
*
|
585
|
-
* Alternatively, the contents of this file may be used under the terms of
|
586
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
587
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
588
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
589
|
-
* of those above. If you wish to allow use of your version of this file only
|
590
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
591
|
-
* use your version of this file under the terms of the MPL, indicate your
|
592
|
-
* decision by deleting the provisions above and replace them with the notice
|
593
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
594
|
-
* the provisions above, a recipient may use your version of this file under
|
595
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
596
|
-
*
|
597
|
-
* ***** END LICENSE BLOCK ***** */
|
598
509
|
|
599
510
|
define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
|
600
|
-
|
511
|
+
|
601
512
|
|
602
513
|
var oop = require("../../lib/oop");
|
603
514
|
var Range = require("../../range").Range;
|
@@ -654,45 +565,9 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|
654
565
|
}).call(FoldMode.prototype);
|
655
566
|
|
656
567
|
});
|
657
|
-
/* ***** BEGIN LICENSE BLOCK *****
|
658
|
-
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
659
|
-
*
|
660
|
-
* The contents of this file are subject to the Mozilla Public License Version
|
661
|
-
* 1.1 (the "License"); you may not use this file except in compliance with
|
662
|
-
* the License. You may obtain a copy of the License at
|
663
|
-
* http://www.mozilla.org/MPL/
|
664
|
-
*
|
665
|
-
* Software distributed under the License is distributed on an "AS IS" basis,
|
666
|
-
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
667
|
-
* for the specific language governing rights and limitations under the
|
668
|
-
* License.
|
669
|
-
*
|
670
|
-
* The Original Code is Ajax.org Code Editor (ACE).
|
671
|
-
*
|
672
|
-
* The Initial Developer of the Original Code is
|
673
|
-
* Ajax.org B.V.
|
674
|
-
* Portions created by the Initial Developer are Copyright (C) 2010
|
675
|
-
* the Initial Developer. All Rights Reserved.
|
676
|
-
*
|
677
|
-
* Contributor(s):
|
678
|
-
* Fabian Jakobs <fabian AT ajax DOT org>
|
679
|
-
*
|
680
|
-
* Alternatively, the contents of this file may be used under the terms of
|
681
|
-
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
682
|
-
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
683
|
-
* in which case the provisions of the GPL or the LGPL are applicable instead
|
684
|
-
* of those above. If you wish to allow use of your version of this file only
|
685
|
-
* under the terms of either the GPL or the LGPL, and not to allow others to
|
686
|
-
* use your version of this file under the terms of the MPL, indicate your
|
687
|
-
* decision by deleting the provisions above and replace them with the notice
|
688
|
-
* and other provisions required by the GPL or the LGPL. If you do not delete
|
689
|
-
* the provisions above, a recipient may use your version of this file under
|
690
|
-
* the terms of any one of the MPL, the GPL or the LGPL.
|
691
|
-
*
|
692
|
-
* ***** END LICENSE BLOCK ***** */
|
693
568
|
|
694
569
|
define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
|
695
|
-
|
570
|
+
|
696
571
|
|
697
572
|
var Range = require("../../range").Range;
|
698
573
|
|
@@ -714,25 +589,27 @@ var FoldMode = exports.FoldMode = function() {};
|
|
714
589
|
return "end";
|
715
590
|
return "";
|
716
591
|
};
|
717
|
-
|
592
|
+
|
718
593
|
this.getFoldWidgetRange = function(session, foldStyle, row) {
|
719
594
|
return null;
|
720
595
|
};
|
721
596
|
|
722
597
|
this.indentationBlock = function(session, row, column) {
|
723
|
-
var re =
|
724
|
-
var startRow = row;
|
725
|
-
var endRow = row;
|
598
|
+
var re = /\S/;
|
726
599
|
var line = session.getLine(row);
|
600
|
+
var startLevel = line.search(re);
|
601
|
+
if (startLevel == -1)
|
602
|
+
return;
|
603
|
+
|
727
604
|
var startColumn = column || line.length;
|
728
|
-
var
|
729
|
-
var
|
730
|
-
|
605
|
+
var maxRow = session.getLength();
|
606
|
+
var startRow = row;
|
607
|
+
var endRow = row;
|
608
|
+
|
731
609
|
while (++row < maxRow) {
|
732
|
-
|
733
|
-
var level = line.match(re)[0].length;
|
610
|
+
var level = session.getLine(row).search(re);
|
734
611
|
|
735
|
-
if (level ==
|
612
|
+
if (level == -1)
|
736
613
|
continue;
|
737
614
|
|
738
615
|
if (level <= startLevel)
|
@@ -747,9 +624,9 @@ var FoldMode = exports.FoldMode = function() {};
|
|
747
624
|
}
|
748
625
|
};
|
749
626
|
|
750
|
-
this.openingBracketBlock = function(session, bracket, row, column) {
|
627
|
+
this.openingBracketBlock = function(session, bracket, row, column, typeRe) {
|
751
628
|
var start = {row: row, column: column + 1};
|
752
|
-
var end = session.$findClosingBracket(bracket, start);
|
629
|
+
var end = session.$findClosingBracket(bracket, start, typeRe);
|
753
630
|
if (!end)
|
754
631
|
return;
|
755
632
|
|
@@ -757,7 +634,7 @@ var FoldMode = exports.FoldMode = function() {};
|
|
757
634
|
if (fw == null)
|
758
635
|
fw = this.getFoldWidget(session, end.row);
|
759
636
|
|
760
|
-
if (fw == "start") {
|
637
|
+
if (fw == "start" && end.row > start.row) {
|
761
638
|
end.row --;
|
762
639
|
end.column = session.getLine(end.row).length;
|
763
640
|
}
|