lex 2 年之前
父节点
当前提交
11f395d220
共有 100 个文件被更改,包括 15463 次插入15177 次删除
  1. 312 0
      web/00280aae09f2a71c1ab46c7cfb9f491c.js
  2. 0 0
      web/02196ddafec9285fd1418759cec8eecb.js
  3. 0 582
      web/023f0a6de254bc2caa975f56d4b61243.js
  4. 500 0
      web/02703e133100c3be64cfec414d4db706.js
  5. 0 0
      web/027e36a1f41877209eca741a54467a40.js
  6. 351 271
      web/03276b6288c255cf1682f53ec11bb5a2.js
  7. 0 0
      web/039af9192b9bb277966ceb4e4ce29c41.js
  8. 0 0
      web/03c0f1c2c4d4c2b6fa956a3e05de8ce4.js
  9. 0 168
      web/0410ca02b96655ac3c08452105cdad32.js
  10. 44 20
      web/0536af8c74f6fdf2d45e5e8990ee60cc.js
  11. 0 387
      web/0645227e6c2479f7aefed1fdd23ac733.js
  12. 24 0
      web/06d453ace473034cd357edb758d539ab.js
  13. 83 0
      web/0768225f873adf5f103dcb714f17783d.js
  14. 376 290
      web/07c0a60b390501dfbb57219d5c8fbc1a.js
  15. 351 271
      web/07c26a67fe6aa27f701c6fb03a7bbafd.js
  16. 0 750
      web/07ffddcf45f1e6302c8af71d36e17b7b.js
  17. 0 524
      web/082d72cee51411d39d52d3f0e06eca3b.js
  18. 23 0
      web/0870bcf868f8d64dc9a6226a6c8b341d.js
  19. 0 16
      web/08f2ebda31cf24e86831115fde674fad.js
  20. 530 0
      web/09195a75bcf8a7ac579281ac2ed5954a.js
  21. 397 0
      web/0a4b12234fd7cba4d7c62207e4835f4c.js
  22. 182 110
      web/0a5adf8110dfa37b8a75edf8cafb1dd7.js
  23. 119 0
      web/0ab67a107deacf1d9b22eb0b706486db.js
  24. 6 0
      web/0b56e82ae05b7ec2022e1cb35b8b6e10.js
  25. 233 163
      web/0bd6d25a3183a767309cd45cd8b8f347.js
  26. 0 4
      web/0c0d52a441dccb36d64840526d7c262e.js
  27. 422 0
      web/0c125a87d8efb9ce303b6b91783eb165.js
  28. 95 0
      web/0cab51dee983721ec757e7e209a67c1d.js
  29. 137 88
      web/0cbaf3ecc6b20dbc83c2164e9a1eac02.js
  30. 0 310
      web/0db77d70de73132c7e5979bf8e82f047.js
  31. 33 0
      web/0dc486b4415f7cbd7ddde8f32b6f12f1.js
  32. 33 22
      web/0e7164b2216605b024f4dc8d910ac5e8.js
  33. 128 0
      web/0ebc6c9681e409f2bf3bb6d8ce64e28e.js
  34. 82 58
      web/100f9b1846c1e1ecae19e0ca2fc8224c.js
  35. 0 0
      web/103d2d5aeb83325c62e06eeb03ce110f.js
  36. 10 0
      web/1084edaced97872890c9d87a9944cdcd.js
  37. 125 0
      web/10bc79414b62df132421027bbf5e5c3e.js
  38. 5931 0
      web/117389396b5ae8131c2a299bfc802c7a.js
  39. 23 0
      web/1295d4470d348d3ff8ea442b1dcef3d3.js
  40. 257 0
      web/1365ff3d277ebdab408e6aeec886cf08.js
  41. 40 0
      web/144991c48dbba89bfe10e886aaaed32a.js
  42. 96 0
      web/1570e695c448e6a4f3a6bdf0372b58f0.js
  43. 168 136
      web/15abe309c5ecbc579dccc79beb041fd8.js
  44. 0 16
      web/15bd2f4de9aefea698aea59ecd36327f.js
  45. 449 0
      web/167a62ec377adafbeb4bbb1cef73250d.js
  46. 0 16
      web/173ea2d9126a53f1d6cb61ef26219598.js
  47. 0 0
      web/18b69bf761ab7d8645f68794096dcb46.js
  48. 0 502
      web/18b9a42de70da52144b223be58bb65c3.js
  49. 148 0
      web/19573d26f286762809b86f935516c1ac.js
  50. 16 8
      web/19a2b55271f405d0b97fad53c9d5ec2d.js
  51. 135 0
      web/1afbeca385b131cfc3ae515b89e552c7.js
  52. 0 9
      web/1c71dfe2ae40884baae78d14e2568eb1.js
  53. 0 16
      web/1cac3566cdfb6be0f51c3f2ade7c1603.js
  54. 90 64
      web/1d837e2c9de35cbb09a85208da4a0d8a.js
  55. 0 0
      web/1e0340d10d5cb579b144f73e631c7813.js
  56. 279 0
      web/1e33cb44dfab039b4a7e88a3ee1bbfe7.js
  57. 0 0
      web/1ea9cb4eff3a4f4c27ff63263151eba2.js
  58. 78 27
      web/1f03c9a69a8b9f79bcb7a338963f80c8.js
  59. 0 836
      web/1f33899bba9efc8a9dc527f39ce8fe9a.js
  60. 0 70
      web/1facfcf9af0b5a679a66dc7f26080afe.js
  61. 0 9
      web/1fd353d022bf5027ba193d0b0b9995ed.js
  62. 167 0
      web/20642f73792092d3c71a4f1f4290430b.js
  63. 1 1
      web/21fab653998af15bced8d4890e41bebc.js
  64. 113 0
      web/2208705283adad817bb4a5af647f77ab.js
  65. 0 428
      web/2218ddba12711e7e7f6aea96015bafa2.js
  66. 105 74
      web/223593fe8dd78b83f22808f9aad86ae9.js
  67. 110 56
      web/22812e27a1f54c0a4ff744a444a32d6c.js
  68. 310 0
      web/22b1c8bf4c2bdd7e438f832b888c75e4.js
  69. 0 6448
      web/22b3d72765b6ec7c787f375e68324531.js
  70. 123 85
      web/22d4f336d4fbe548273812e6e4cd345e.js
  71. 0 0
      web/23ad6224fd6059c31c199b6d6d420628.js
  72. 109 0
      web/243d8101969c933d25388b5287bb3425.js
  73. 111 0
      web/2487e54390024553d757b9bd73dd1647.js
  74. 0 16
      web/26916d87ee46ad72f432b9a59e6fd198.js
  75. 280 105
      web/280ba139ff95428f262adbf81b77aeb4.js
  76. 6 0
      web/2839e845bd0cf60f35f3a8ca90a5ee22.js
  77. 254 0
      web/294fbc5b00264d6215dd8ff838dc2999.js
  78. 131 92
      web/29a4e3548d286388c4d5e8f0670a4381.js
  79. 0 0
      web/2a4c96bd91c25806d68325751fb0c958.js
  80. 197 159
      web/2a7b2ac7dc47105609001b93c25190b8.js
  81. 0 133
      web/2b1eed411f531a271f0e47693c82216a.js
  82. 0 16
      web/2d53cfacb6a695f378ca997fcee7efb3.js
  83. 0 305
      web/2dcf359bda4d96fcd06e8b0b7bc039bf.js
  84. 168 0
      web/2dea096a03cd8f864db5f06e9f0113e5.js
  85. 0 4
      web/2f5ea84ffbac21b3f98fccc2352300e4.js
  86. 0 0
      web/2f689ca91158f918e23ce27c7abbcf25.js
  87. 0 0
      web/2f6dcc38e5ad378438bea99c47e20e28.js
  88. 137 0
      web/2f6f1f6753d430190cb38411a9112f08.js
  89. 0 0
      web/2f985fd2d1b0603c0cd825f7e9b4218d.js
  90. 375 294
      web/2fe13737434324ed67582ac97d484c54.js
  91. 172 0
      web/30314e1b4a51b1aed3766eadecde2a42.js
  92. 185 122
      web/3045404d52d03253c81822bdf760cfd1.js
  93. 103 0
      web/30f5b57295dfda4eafc7f8c098160582.js
  94. 0 0
      web/30fc7b3a9d721379c231908210e3530d.js
  95. 0 6
      web/321d98b6707ed20d34818a7533713433.js
  96. 0 11
      web/34eb9d98392182a042fa67206fd33187.js
  97. 0 254
      web/34f52a56877a14fbb7e9d37469ebbf15.js
  98. 0 4
      web/352953d27b4b7ce8dbc7b850a3f2232c.js
  99. 0 74
      web/35b23ae9af47c42f9442c3071d489fb0.js
  100. 0 747
      web/3799d08c351633c98f6ae5ff08397674.js

+ 312 - 0
web/00280aae09f2a71c1ab46c7cfb9f491c.js

@@ -0,0 +1,312 @@
+ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var lang = require("../lib/lang");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var TexHighlightRules = function(textClass) {
+
+    if (!textClass)
+        textClass = "text";
+
+    this.$rules = {
+        "start" : [
+            {
+                token : "comment",
+                regex : "%.*$"
+            }, {
+                token : textClass, // non-command
+                regex : "\\\\[$&%#\\{\\}]"
+            }, {
+                token : "keyword", // command
+                regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",
+               next : "nospell"
+            }, {
+                token : "keyword", // command
+                regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"
+            }, {
+               token : "paren.keyword.operator",
+                regex : "[[({]"
+            }, {
+               token : "paren.keyword.operator",
+                regex : "[\\])}]"
+            }, {
+                token : textClass,
+                regex : "\\s+"
+            }
+        ],
+        "nospell" : [
+           {
+               token : "comment",
+               regex : "%.*$",
+               next : "start"
+           }, {
+               token : "nospell." + textClass, // non-command
+               regex : "\\\\[$&%#\\{\\}]"
+           }, {
+               token : "keyword", // command
+               regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"
+           }, {
+               token : "keyword", // command
+               regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",
+               next : "start"
+           }, {
+               token : "paren.keyword.operator",
+               regex : "[[({]"
+           }, {
+               token : "paren.keyword.operator",
+               regex : "[\\])]"
+           }, {
+               token : "paren.keyword.operator",
+               regex : "}",
+               next : "start"
+           }, {
+               token : "nospell." + textClass,
+               regex : "\\s+"
+           }, {
+               token : "nospell." + textClass,
+               regex : "\\w+"
+           }
+        ]
+    };
+};
+
+oop.inherits(TexHighlightRules, TextHighlightRules);
+
+exports.TexHighlightRules = TexHighlightRules;
+});
+
+ace.define("ace/mode/r_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"], function(require, exports, module)
+{
+
+   var oop = require("../lib/oop");
+   var lang = require("../lib/lang");
+   var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+   var TexHighlightRules = require("./tex_highlight_rules").TexHighlightRules;
+
+   var RHighlightRules = function()
+   {
+
+      var keywords = lang.arrayToMap(
+            ("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass")
+                  .split("|")
+            );
+
+      var buildinConstants = lang.arrayToMap(
+            ("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|" +
+             "NA_complex_").split("|")
+            );
+
+      this.$rules = {
+         "start" : [
+            {
+               token : "comment.sectionhead",
+               regex : "#+(?!').*(?:----|====|####)\\s*$"
+            },
+            {
+               token : "comment",
+               regex : "#+'",
+               next : "rd-start"
+            },
+            {
+               token : "comment",
+               regex : "#.*$"
+            },
+            {
+               token : "string", // multi line string start
+               regex : '["]',
+               next : "qqstring"
+            },
+            {
+               token : "string", // multi line string start
+               regex : "[']",
+               next : "qstring"
+            },
+            {
+               token : "constant.numeric", // hex
+               regex : "0[xX][0-9a-fA-F]+[Li]?\\b"
+            },
+            {
+               token : "constant.numeric", // explicit integer
+               regex : "\\d+L\\b"
+            },
+            {
+               token : "constant.numeric", // number
+               regex : "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b"
+            },
+            {
+               token : "constant.numeric", // number with leading decimal
+               regex : "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b"
+            },
+            {
+               token : "constant.language.boolean",
+               regex : "(?:TRUE|FALSE|T|F)\\b"
+            },
+            {
+               token : "identifier",
+               regex : "`.*?`"
+            },
+            {
+               onMatch : function(value) {
+                  if (keywords[value])
+                     return "keyword";
+                  else if (buildinConstants[value])
+                     return "constant.language";
+                  else if (value == '...' || value.match(/^\.\.\d+$/))
+                     return "variable.language";
+                  else
+                     return "identifier";
+               },
+               regex : "[a-zA-Z.][a-zA-Z0-9._]*\\b"
+            },
+            {
+               token : "keyword.operator",
+               regex : "%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:"
+            },
+            {
+               token : "keyword.operator", // infix operators
+               regex : "%.*?%"
+            },
+            {
+               token : "paren.keyword.operator",
+               regex : "[[({]"
+            },
+            {
+               token : "paren.keyword.operator",
+               regex : "[\\])}]"
+            },
+            {
+               token : "text",
+               regex : "\\s+"
+            }
+         ],
+         "qqstring" : [
+            {
+               token : "string",
+               regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
+               next : "start"
+            },
+            {
+               token : "string",
+               regex : '.+'
+            }
+         ],
+         "qstring" : [
+            {
+               token : "string",
+               regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
+               next : "start"
+            },
+            {
+               token : "string",
+               regex : '.+'
+            }
+         ]
+      };
+
+      var rdRules = new TexHighlightRules("comment").getRules();
+      for (var i = 0; i < rdRules["start"].length; i++) {
+         rdRules["start"][i].token += ".virtual-comment";
+      }
+
+      this.addRules(rdRules, "rd-");
+      this.$rules["rd-start"].unshift({
+          token: "text",
+          regex: "^",
+          next: "start"
+      });
+      this.$rules["rd-start"].unshift({
+         token : "keyword",
+         regex : "@(?!@)[^ ]*"
+      });
+      this.$rules["rd-start"].unshift({
+         token : "comment",
+         regex : "@@"
+      });
+      this.$rules["rd-start"].push({
+         token : "comment",
+         regex : "[^%\\\\[({\\])}]+"
+      });
+   };
+
+   oop.inherits(RHighlightRules, TextHighlightRules);
+
+   exports.RHighlightRules = RHighlightRules;
+});
+
+ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
+"use strict";
+
+var Range = require("../range").Range;
+
+var MatchingBraceOutdent = function() {};
+
+(function() {
+
+    this.checkOutdent = function(line, input) {
+        if (! /^\s+$/.test(line))
+            return false;
+
+        return /^\s*\}/.test(input);
+    };
+
+    this.autoOutdent = function(doc, row) {
+        var line = doc.getLine(row);
+        var match = line.match(/^(\s*\})/);
+
+        if (!match) return 0;
+
+        var column = match[1].length;
+        var openBracePos = doc.findMatchingBracket({row: row, column: column});
+
+        if (!openBracePos || openBracePos.row == row) return 0;
+
+        var indent = this.$getIndent(doc.getLine(openBracePos.row));
+        doc.replace(new Range(row, 0, row, column-1), indent);
+    };
+
+    this.$getIndent = function(line) {
+        return line.match(/^\s*/)[0];
+    };
+
+}).call(MatchingBraceOutdent.prototype);
+
+exports.MatchingBraceOutdent = MatchingBraceOutdent;
+});
+
+ace.define("ace/mode/r",["require","exports","module","ace/unicode","ace/range","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/r_highlight_rules","ace/mode/matching_brace_outdent"], function(require, exports, module) {
+   "use strict";
+
+   var unicode = require("../unicode");
+   var Range = require("../range").Range;
+   var oop = require("../lib/oop");
+   var TextMode = require("./text").Mode;
+   var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+   var RHighlightRules = require("./r_highlight_rules").RHighlightRules;
+   var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
+
+   var Mode = function(){
+      this.HighlightRules = RHighlightRules;
+      this.$outdent = new MatchingBraceOutdent();
+      this.$behaviour = this.$defaultBehaviour;
+   };
+   oop.inherits(Mode, TextMode);
+
+   (function() {
+      this.lineCommentStart = "#";
+      this.tokenRe = new RegExp("^[" + unicode.wordChars + "._]+", "g");
+
+      this.nonTokenRe = new RegExp("^(?:[^" + unicode.wordChars + "._]|\s])+", "g");
+       this.$id = "ace/mode/r";
+       this.snippetFileId = "ace/snippets/r";
+   }).call(Mode.prototype);
+   exports.Mode = Mode;
+});                (function() {
+                    ace.require(["ace/mode/r"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

文件差异内容过多而无法显示
+ 0 - 0
web/02196ddafec9285fd1418759cec8eecb.js


+ 0 - 582
web/023f0a6de254bc2caa975f56d4b61243.js

@@ -1,582 +0,0 @@
-ace.define("ace/mode/crystal_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var CrystalHighlightRules = function () {
-    var builtinFunctions = ("puts|initialize|previous_def|typeof|as|pointerof|sizeof|instance_sizeof");
-    var keywords = ("if|end|else|elsif|unless|case|when|break|while|next|until|def|return|class|new|getter|setter|property|lib"
-        + "|fun|do|struct|private|protected|public|module|super|abstract|include|extend|begin|enum|raise|yield|with"
-        + "|alias|rescue|ensure|macro|uninitialized|union|type|require");
-    var buildinConstants = ("true|TRUE|false|FALSE|nil|NIL|__LINE__|__END_LINE__|__FILE__|__DIR__");
-    var builtinVariables = ("$DEBUG|$defout|$FILENAME|$LOAD_PATH|$SAFE|$stdin|$stdout|$stderr|$VERBOSE|" +
-        "root_url|flash|session|cookies|params|request|response|logger|self");
-    var keywordMapper = this.$keywords = this.createKeywordMapper({
-        "keyword": keywords,
-        "constant.language": buildinConstants,
-        "variable.language": builtinVariables,
-        "support.function": builtinFunctions
-    }, "identifier");
-    var hexNumber = "(?:0[xX][\\dA-Fa-f]+)";
-    var decNumber = "(?:[0-9][\\d_]*)";
-    var octNumber = "(?:0o[0-7][0-7]*)";
-    var binNumber = "(?:0[bB][01]+)";
-    var intNumber = "(?:[+-]?)(?:" + hexNumber + "|" + decNumber + "|" + octNumber + "|" + binNumber + ")(?:_?[iIuU](?:8|16|32|64))?\\b";
-    var escapeExpression = /\\(?:[nsrtvfbae'"\\]|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u{[\da-fA-F]{1,6}})/;
-    var extEscapeExspresssion = /\\(?:[nsrtvfbae'"\\]|[0-7]{3}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u{[\da-fA-F]{1,6}}|u{(:?[\da-fA-F]{2}\s)*[\da-fA-F]{2}})/;
-    this.$rules = {
-        "start": [
-            {
-                token: "comment",
-                regex: "#.*$"
-            }, {
-                token: "string.regexp",
-                regex: "[/]",
-                push: [{
-                        token: "constant.language.escape",
-                        regex: extEscapeExspresssion
-                    }, {
-                        token: "string.regexp",
-                        regex: "[/][imx]*(?=[).,;\\s]|$)",
-                        next: "pop"
-                    }, {
-                        defaultToken: "string.regexp"
-                    }]
-            },
-            [{
-                    regex: "[{}]", onMatch: function (val, state, stack) {
-                        this.next = val == "{" ? this.nextState : "";
-                        if (val == "{" && stack.length) {
-                            stack.unshift("start", state);
-                            return "paren.lparen";
-                        }
-                        if (val == "}" && stack.length) {
-                            stack.shift();
-                            this.next = stack.shift();
-                            if (this.next.indexOf("string") != -1)
-                                return "paren.end";
-                        }
-                        return val == "{" ? "paren.lparen" : "paren.rparen";
-                    },
-                    nextState: "start"
-                }, {
-                    token: "string.start",
-                    regex: /"/,
-                    push: [{
-                            token: "constant.language.escape",
-                            regex: extEscapeExspresssion
-                        }, {
-                            token: "string",
-                            regex: /\\#{/
-                        }, {
-                            token: "paren.start",
-                            regex: /#{/,
-                            push: "start"
-                        }, {
-                            token: "string.end",
-                            regex: /"/,
-                            next: "pop"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }, {
-                    token: "string.start",
-                    regex: /`/,
-                    push: [{
-                            token: "constant.language.escape",
-                            regex: extEscapeExspresssion
-                        }, {
-                            token: "string",
-                            regex: /\\#{/
-                        }, {
-                            token: "paren.start",
-                            regex: /#{/,
-                            push: "start"
-                        }, {
-                            token: "string.end",
-                            regex: /`/,
-                            next: "pop"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }, {
-                    stateName: "rpstring",
-                    token: "string.start",
-                    regex: /%[Qx]?\(/,
-                    push: [{
-                            token: "constant.language.escape",
-                            regex: extEscapeExspresssion
-                        }, {
-                            token: "string.start",
-                            regex: /\(/,
-                            push: "rpstring"
-                        }, {
-                            token: "string.end",
-                            regex: /\)/,
-                            next: "pop"
-                        }, {
-                            token: "paren.start",
-                            regex: /#{/,
-                            push: "start"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }, {
-                    stateName: "spstring",
-                    token: "string.start",
-                    regex: /%[Qx]?\[/,
-                    push: [{
-                            token: "constant.language.escape",
-                            regex: extEscapeExspresssion
-                        }, {
-                            token: "string.start",
-                            regex: /\[/,
-                            push: "spstring"
-                        }, {
-                            token: "string.end",
-                            regex: /]/,
-                            next: "pop"
-                        }, {
-                            token: "paren.start",
-                            regex: /#{/,
-                            push: "start"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }, {
-                    stateName: "fpstring",
-                    token: "string.start",
-                    regex: /%[Qx]?{/,
-                    push: [{
-                            token: "constant.language.escape",
-                            regex: extEscapeExspresssion
-                        }, {
-                            token: "string.start",
-                            regex: /{/,
-                            push: "fpstring"
-                        }, {
-                            token: "string.end",
-                            regex: /}/,
-                            next: "pop"
-                        }, {
-                            token: "paren.start",
-                            regex: /#{/,
-                            push: "start"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }, {
-                    stateName: "tpstring",
-                    token: "string.start",
-                    regex: /%[Qx]?</,
-                    push: [{
-                            token: "constant.language.escape",
-                            regex: extEscapeExspresssion
-                        }, {
-                            token: "string.start",
-                            regex: /</,
-                            push: "tpstring"
-                        }, {
-                            token: "string.end",
-                            regex: />/,
-                            next: "pop"
-                        }, {
-                            token: "paren.start",
-                            regex: /#{/,
-                            push: "start"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }, {
-                    stateName: "ppstring",
-                    token: "string.start",
-                    regex: /%[Qx]?\|/,
-                    push: [{
-                            token: "constant.language.escape",
-                            regex: extEscapeExspresssion
-                        }, {
-                            token: "string.end",
-                            regex: /\|/,
-                            next: "pop"
-                        }, {
-                            token: "paren.start",
-                            regex: /#{/,
-                            push: "start"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }, {
-                    stateName: "rpqstring",
-                    token: "string.start",
-                    regex: /%[qwir]\(/,
-                    push: [{
-                            token: "string.start",
-                            regex: /\(/,
-                            push: "rpqstring"
-                        }, {
-                            token: "string.end",
-                            regex: /\)/,
-                            next: "pop"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }, {
-                    stateName: "spqstring",
-                    token: "string.start",
-                    regex: /%[qwir]\[/,
-                    push: [{
-                            token: "string.start",
-                            regex: /\[/,
-                            push: "spqstring"
-                        }, {
-                            token: "string.end",
-                            regex: /]/,
-                            next: "pop"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }, {
-                    stateName: "fpqstring",
-                    token: "string.start",
-                    regex: /%[qwir]{/,
-                    push: [{
-                            token: "string.start",
-                            regex: /{/,
-                            push: "fpqstring"
-                        }, {
-                            token: "string.end",
-                            regex: /}/,
-                            next: "pop"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }, {
-                    stateName: "tpqstring",
-                    token: "string.start",
-                    regex: /%[qwir]</,
-                    push: [{
-                            token: "string.start",
-                            regex: /</,
-                            push: "tpqstring"
-                        }, {
-                            token: "string.end",
-                            regex: />/,
-                            next: "pop"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }, {
-                    stateName: "ppqstring",
-                    token: "string.start",
-                    regex: /%[qwir]\|/,
-                    push: [{
-                            token: "string.end",
-                            regex: /\|/,
-                            next: "pop"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }, {
-                    token: "string.start",
-                    regex: /'/,
-                    push: [{
-                            token: "constant.language.escape",
-                            regex: escapeExpression
-                        }, {
-                            token: "string.end",
-                            regex: /'|$/,
-                            next: "pop"
-                        }, {
-                            defaultToken: "string"
-                        }]
-                }], {
-                token: "text",
-                regex: "::"
-            }, {
-                token: "variable.instance",
-                regex: "@{1,2}[a-zA-Z_\\d]+"
-            }, {
-                token: "variable.fresh",
-                regex: "%[a-zA-Z_\\d]+"
-            }, {
-                token: "support.class",
-                regex: "[A-Z][a-zA-Z_\\d]+"
-            }, {
-                token: "constant.other.symbol",
-                regex: "[:](?:(?:===|<=>|\\[]\\?|\\[]=|\\[]|>>|\\*\\*|<<|==|!=|>=|<=|!~|=~|<|\\+|-|\\*|\\/|%|&|\\||\\^|>|!|~)|(?:(?:[A-Za-z_]|[@$](?=[a-zA-Z0-9_]))[a-zA-Z0-9_]*[!=?]?))"
-            }, {
-                token: "constant.numeric",
-                regex: "[+-]?\\d(?:\\d|_(?=\\d))*(?:(?:\\.\\d(?:\\d|_(?=\\d))*)?(?:[eE][+-]?\\d+)?)?(?:_?[fF](?:32|64))?\\b"
-            }, {
-                token: "constant.numeric",
-                regex: intNumber
-            }, {
-                token: "constant.other.symbol",
-                regex: ':"',
-                push: [{
-                        token: "constant.language.escape",
-                        regex: extEscapeExspresssion
-                    }, {
-                        token: "constant.other.symbol",
-                        regex: '"',
-                        next: "pop"
-                    }, {
-                        defaultToken: "constant.other.symbol"
-                    }]
-            }, {
-                token: "constant.language.boolean",
-                regex: "(?:true|false)\\b"
-            }, {
-                token: "support.function",
-                regex: "(?:is_a\\?|nil\\?|responds_to\\?|as\\?)"
-            }, {
-                token: keywordMapper,
-                regex: "[a-zA-Z_$][a-zA-Z0-9_$!?]*\\b"
-            }, {
-                token: "variable.system",
-                regex: "\\$\\!|\\$\\?"
-            }, {
-                token: "punctuation.separator.key-value",
-                regex: "=>"
-            }, {
-                stateName: "heredoc",
-                onMatch: function (value, currentState, stack) {
-                    var next = "heredoc";
-                    var tokens = value.split(this.splitRegex);
-                    stack.push(next, tokens[3]);
-                    return [
-                        { type: "constant", value: tokens[1] },
-                        { type: "string", value: tokens[2] },
-                        { type: "support.class", value: tokens[3] },
-                        { type: "string", value: tokens[4] }
-                    ];
-                },
-                regex: "(<<-)([']?)([\\w]+)([']?)",
-                rules: {
-                    heredoc: [{
-                            token: "string",
-                            regex: "^ +"
-                        }, {
-                            onMatch: function (value, currentState, stack) {
-                                if (value === stack[1]) {
-                                    stack.shift();
-                                    stack.shift();
-                                    this.next = stack[0] || "start";
-                                    return "support.class";
-                                }
-                                this.next = "";
-                                return "string";
-                            },
-                            regex: ".*$",
-                            next: "start"
-                        }]
-                }
-            }, {
-                regex: "$",
-                token: "empty",
-                next: function (currentState, stack) {
-                    if (stack[0] === "heredoc")
-                        return stack[0];
-                    return currentState;
-                }
-            }, {
-                token: "punctuation.operator",
-                regex: /[.]\s*(?![.])/,
-                push: [{
-                        token: "punctuation.operator",
-                        regex: /[.]\s*(?![.])/
-                    }, {
-                        token: "support.function",
-                        regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
-                    }, {
-                        regex: "",
-                        token: "empty",
-                        next: "pop"
-                    }]
-            }, {
-                token: "keyword.operator",
-                regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|\\?|\\:|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\^|\\|"
-            }, {
-                token: "punctuation.operator",
-                regex: /[?:,;.]/
-            }, {
-                token: "paren.lparen",
-                regex: "[[({]"
-            }, {
-                token: "paren.rparen",
-                regex: "[\\])}]"
-            }, {
-                token: "text",
-                regex: "\\s+"
-            }
-        ]
-    };
-    this.normalizeRules();
-};
-oop.inherits(CrystalHighlightRules, TextHighlightRules);
-exports.CrystalHighlightRules = CrystalHighlightRules;
-
-});
-
-ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
-var Range = require("../range").Range;
-var MatchingBraceOutdent = function () { };
-(function () {
-    this.checkOutdent = function (line, input) {
-        if (!/^\s+$/.test(line))
-            return false;
-        return /^\s*\}/.test(input);
-    };
-    this.autoOutdent = function (doc, row) {
-        var line = doc.getLine(row);
-        var match = line.match(/^(\s*\})/);
-        if (!match)
-            return 0;
-        var column = match[1].length;
-        var openBracePos = doc.findMatchingBracket({ row: row, column: column });
-        if (!openBracePos || openBracePos.row == row)
-            return 0;
-        var indent = this.$getIndent(doc.getLine(openBracePos.row));
-        doc.replace(new Range(row, 0, row, column - 1), indent);
-    };
-    this.$getIndent = function (line) {
-        return line.match(/^\s*/)[0];
-    };
-}).call(MatchingBraceOutdent.prototype);
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
-
-});
-
-ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var Range = require("../../range").Range;
-var FoldMode = exports.FoldMode = function () { };
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.getFoldWidgetRange = function (session, foldStyle, row) {
-        var range = this.indentationBlock(session, row);
-        if (range)
-            return range;
-        var re = /\S/;
-        var line = session.getLine(row);
-        var startLevel = line.search(re);
-        if (startLevel == -1 || line[startLevel] != "#")
-            return;
-        var startColumn = line.length;
-        var maxRow = session.getLength();
-        var startRow = row;
-        var endRow = row;
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var level = line.search(re);
-            if (level == -1)
-                continue;
-            if (line[level] != "#")
-                break;
-            endRow = row;
-        }
-        if (endRow > startRow) {
-            var endColumn = session.getLine(endRow).length;
-            return new Range(startRow, startColumn, endRow, endColumn);
-        }
-    };
-    this.getFoldWidget = function (session, foldStyle, row) {
-        var line = session.getLine(row);
-        var indent = line.search(/\S/);
-        var next = session.getLine(row + 1);
-        var prev = session.getLine(row - 1);
-        var prevIndent = prev.search(/\S/);
-        var nextIndent = next.search(/\S/);
-        if (indent == -1) {
-            session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
-            return "";
-        }
-        if (prevIndent == -1) {
-            if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
-                session.foldWidgets[row - 1] = "";
-                session.foldWidgets[row + 1] = "";
-                return "start";
-            }
-        }
-        else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
-            if (session.getLine(row - 2).search(/\S/) == -1) {
-                session.foldWidgets[row - 1] = "start";
-                session.foldWidgets[row + 1] = "";
-                return "";
-            }
-        }
-        if (prevIndent != -1 && prevIndent < indent)
-            session.foldWidgets[row - 1] = "start";
-        else
-            session.foldWidgets[row - 1] = "";
-        if (indent < nextIndent)
-            return "start";
-        else
-            return "";
-    };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/crystal",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/crystal_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/coffee"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var CrystalHighlightRules = require("./crystal_highlight_rules").CrystalHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var Range = require("../range").Range;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var FoldMode = require("./folding/coffee").FoldMode;
-var Mode = function () {
-    this.HighlightRules = CrystalHighlightRules;
-    this.$outdent = new MatchingBraceOutdent();
-    this.$behaviour = new CstyleBehaviour();
-    this.foldingRules = new FoldMode();
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.lineCommentStart = "#";
-    this.getNextLineIndent = function (state, line, tab) {
-        var indent = this.$getIndent(line);
-        var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
-        var tokens = tokenizedLine.tokens;
-        if (tokens.length && tokens[tokens.length - 1].type == "comment") {
-            return indent;
-        }
-        if (state == "start") {
-            var match = line.match(/^.*[\{\(\[]\s*$/);
-            var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/);
-            var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/);
-            var startingConditional = line.match(/^\s*(if|else|when)\s*/);
-            if (match || startingClassOrMethod || startingDoBlock || startingConditional) {
-                indent += tab;
-            }
-        }
-        return indent;
-    };
-    this.checkOutdent = function (state, line, input) {
-        return /^\s+(end|else)$/.test(line + input) || this.$outdent.checkOutdent(line, input);
-    };
-    this.autoOutdent = function (state, session, row) {
-        var line = session.getLine(row);
-        if (/}/.test(line))
-            return this.$outdent.autoOutdent(session, row);
-        var indent = this.$getIndent(line);
-        var prevLine = session.getLine(row - 1);
-        var prevIndent = this.$getIndent(prevLine);
-        var tab = session.getTabString();
-        if (prevIndent.length <= indent.length) {
-            if (indent.slice(-tab.length) == tab)
-                session.remove(new Range(row, indent.length - tab.length, row, indent.length));
-        }
-    };
-    this.$id = "ace/mode/crystal";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});                (function() {
-                    ace.require(["ace/mode/crystal"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 500 - 0
web/02703e133100c3be64cfec414d4db706.js

@@ -0,0 +1,500 @@
+ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var reservedKeywords = exports.reservedKeywords = (
+        '!|{|}|case|do|done|elif|else|'+
+        'esac|fi|for|if|in|then|until|while|'+
+        '&|;|export|local|read|typeset|unset|'+
+        'elif|select|set|function|declare|readonly'
+    );
+
+var languageConstructs = exports.languageConstructs = (
+    '[|]|alias|bg|bind|break|builtin|'+
+     'cd|command|compgen|complete|continue|'+
+     'dirs|disown|echo|enable|eval|exec|'+
+     'exit|fc|fg|getopts|hash|help|history|'+
+     'jobs|kill|let|logout|popd|printf|pushd|'+
+     'pwd|return|set|shift|shopt|source|'+
+     'suspend|test|times|trap|type|ulimit|'+
+     'umask|unalias|wait'
+);
+
+var ShHighlightRules = function() {
+    var keywordMapper = this.createKeywordMapper({
+        "keyword": reservedKeywords,
+        "support.function.builtin": languageConstructs,
+        "invalid.deprecated": "debugger"
+    }, "identifier");
+
+    var integer = "(?:(?:[1-9]\\d*)|(?:0))";
+
+    var fraction = "(?:\\.\\d+)";
+    var intPart = "(?:\\d+)";
+    var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
+    var exponentFloat = "(?:(?:" + pointFloat + "|" +  intPart + ")" + ")";
+    var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
+    var fileDescriptor = "(?:&" + intPart + ")";
+
+    var variableName = "[a-zA-Z_][a-zA-Z0-9_]*";
+    var variable = "(?:" + variableName + "(?==))";
+
+    var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
+
+    var func = "(?:" + variableName + "\\s*\\(\\))";
+
+    this.$rules = {
+        "start" : [{
+            token : "constant",
+            regex : /\\./
+        }, {
+            token : ["text", "comment"],
+            regex : /(^|\s)(#.*)$/
+        }, {
+            token : "string.start",
+            regex : '"',
+            push : [{
+                token : "constant.language.escape",
+                regex : /\\(?:[$`"\\]|$)/
+            }, {
+                include : "variables"
+            }, {
+                token : "keyword.operator",
+                regex : /`/ // TODO highlight `
+            }, {
+                token : "string.end",
+                regex : '"',
+                next: "pop"
+            }, {
+                defaultToken: "string"
+            }]
+        }, {
+            token : "string",
+            regex : "\\$'",
+            push : [{
+                token : "constant.language.escape",
+                regex : /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/
+            }, {
+                token : "string",
+                regex : "'",
+                next: "pop"
+            }, {
+                defaultToken: "string"
+            }]
+        }, {
+            regex : "<<<",
+            token : "keyword.operator"
+        }, {
+            stateName: "heredoc",
+            regex : "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",
+            onMatch : function(value, currentState, stack) {
+                var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
+                var tokens = value.split(this.splitRegex);
+                stack.push(next, tokens[4]);
+                return [
+                    {type:"constant", value: tokens[1]},
+                    {type:"text", value: tokens[2]},
+                    {type:"string", value: tokens[3]},
+                    {type:"support.class", value: tokens[4]},
+                    {type:"string", value: tokens[5]}
+                ];
+            },
+            rules: {
+                heredoc: [{
+                    onMatch:  function(value, currentState, stack) {
+                        if (value === stack[1]) {
+                            stack.shift();
+                            stack.shift();
+                            this.next = stack[0] || "start";
+                            return "support.class";
+                        }
+                        this.next = "";
+                        return "string";
+                    },
+                    regex: ".*$",
+                    next: "start"
+                }],
+                indentedHeredoc: [{
+                    token: "string",
+                    regex: "^\t+"
+                }, {
+                    onMatch:  function(value, currentState, stack) {
+                        if (value === stack[1]) {
+                            stack.shift();
+                            stack.shift();
+                            this.next = stack[0] || "start";
+                            return "support.class";
+                        }
+                        this.next = "";
+                        return "string";
+                    },
+                    regex: ".*$",
+                    next: "start"
+                }]
+            }
+        }, {
+            regex : "$",
+            token : "empty",
+            next : function(currentState, stack) {
+                if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
+                    return stack[0];
+                return currentState;
+            }
+        }, {
+            token : ["keyword", "text", "text", "text", "variable"],
+            regex : /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/
+        }, {
+            token : "variable.language",
+            regex : builtinVariable
+        }, {
+            token : "variable",
+            regex : variable
+        }, {
+            include : "variables"
+        }, {
+            token : "support.function",
+            regex : func
+        }, {
+            token : "support.function",
+            regex : fileDescriptor
+        }, {
+            token : "string",           // ' string
+            start : "'", end : "'"
+        }, {
+            token : "constant.numeric", // float
+            regex : floatNumber
+        }, {
+            token : "constant.numeric", // integer
+            regex : integer + "\\b"
+        }, {
+            token : keywordMapper,
+            regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b"
+        }, {
+            token : "keyword.operator",
+            regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"
+        }, {
+            token : "punctuation.operator",
+            regex : ";"
+        }, {
+            token : "paren.lparen",
+            regex : "[\\[\\(\\{]"
+        }, {
+            token : "paren.rparen",
+            regex : "[\\]]"
+        }, {
+            token : "paren.rparen",
+            regex : "[\\)\\}]",
+            next : "pop"
+        }],
+        variables: [{
+            token : "variable",
+            regex : /(\$)(\w+)/
+        }, {
+            token : ["variable", "paren.lparen"],
+            regex : /(\$)(\()/,
+            push : "start"
+        }, {
+            token : ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"],
+            regex : /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,
+            push : "start"
+        }, {
+            token : "variable",
+            regex : /\$[*@#?\-$!0_]/
+        }, {
+            token : ["variable", "paren.lparen"],
+            regex : /(\$)(\{)/,
+            push : "start"
+        }]
+    };
+    
+    this.normalizeRules();
+};
+
+oop.inherits(ShHighlightRules, TextHighlightRules);
+
+exports.ShHighlightRules = ShHighlightRules;
+});
+
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
+    if (commentRegex) {
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
+    }
+};
+oop.inherits(FoldMode, BaseFoldMode);
+
+(function() {
+    
+    this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
+    this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
+    this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
+    this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
+    this._getFoldWidgetBase = this.getFoldWidget;
+    this.getFoldWidget = function(session, foldStyle, row) {
+        var line = session.getLine(row);
+    
+        if (this.singleLineBlockCommentRe.test(line)) {
+            if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
+                return "";
+        }
+    
+        var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
+        if (!fw && this.startRegionRe.test(line))
+            return "start"; // lineCommentRegionStart
+    
+        return fw;
+    };
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
+        var line = session.getLine(row);
+        
+        if (this.startRegionRe.test(line))
+            return this.getCommentRegionBlock(session, line, row);
+        
+        var match = line.match(this.foldingStartMarker);
+        if (match) {
+            var i = match.index;
+
+            if (match[1])
+                return this.openingBracketBlock(session, match[1], row, i);
+                
+            var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
+            if (range && !range.isMultiLine()) {
+                if (forceMultiline) {
+                    range = this.getSectionRange(session, row);
+                } else if (foldStyle != "all")
+                    range = null;
+            }
+            
+            return range;
+        }
+
+        if (foldStyle === "markbegin")
+            return;
+
+        var match = line.match(this.foldingStopMarker);
+        if (match) {
+            var i = match.index + match[0].length;
+
+            if (match[1])
+                return this.closingBracketBlock(session, match[1], row, i);
+
+            return session.getCommentFoldRange(row, i, -1);
+        }
+    };
+    
+    this.getSectionRange = function(session, row) {
+        var line = session.getLine(row);
+        var startIndent = line.search(/\S/);
+        var startRow = row;
+        var startColumn = line.length;
+        row = row + 1;
+        var endRow = row;
+        var maxRow = session.getLength();
+        while (++row < maxRow) {
+            line = session.getLine(row);
+            var indent = line.search(/\S/);
+            if (indent === -1)
+                continue;
+            if  (startIndent > indent)
+                break;
+            var subRange = this.getFoldWidgetRange(session, "all", row);
+            
+            if (subRange) {
+                if (subRange.start.row <= startRow) {
+                    break;
+                } else if (subRange.isMultiLine()) {
+                    row = subRange.end.row;
+                } else if (startIndent == indent) {
+                    break;
+                }
+            }
+            endRow = row;
+        }
+        
+        return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
+    };
+    this.getCommentRegionBlock = function(session, line, row) {
+        var startColumn = line.search(/\s*$/);
+        var maxRow = session.getLength();
+        var startRow = row;
+        
+        var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
+        var depth = 1;
+        while (++row < maxRow) {
+            line = session.getLine(row);
+            var m = re.exec(line);
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
+        }
+
+        var endRow = row;
+        if (endRow > startRow) {
+            return new Range(startRow, startColumn, endRow, line.length);
+        }
+    };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
+var Range = require("../range").Range;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+
+var Mode = function() {
+    this.HighlightRules = ShHighlightRules;
+    this.foldingRules = new CStyleFoldMode();
+    this.$behaviour = new CstyleBehaviour();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+   
+    this.lineCommentStart = "#";
+
+    this.getNextLineIndent = function(state, line, tab) {
+        var indent = this.$getIndent(line);
+
+        var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
+        var tokens = tokenizedLine.tokens;
+
+        if (tokens.length && tokens[tokens.length-1].type == "comment") {
+            return indent;
+        }
+
+        if (state == "start") {
+            var match = line.match(/^.*[\{\(\[:]\s*$/);
+            if (match) {
+                indent += tab;
+            }
+        }
+
+        return indent;
+    };
+
+    var outdents = {
+        "pass": 1,
+        "return": 1,
+        "raise": 1,
+        "break": 1,
+        "continue": 1
+    };
+
+    this.checkOutdent = function(state, line, input) {
+        if (input !== "\r\n" && input !== "\r" && input !== "\n")
+            return false;
+
+        var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
+
+        if (!tokens)
+            return false;
+        do {
+            var last = tokens.pop();
+        } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
+
+        if (!last)
+            return false;
+
+        return (last.type == "keyword" && outdents[last.value]);
+    };
+
+    this.autoOutdent = function(state, doc, row) {
+
+        row += 1;
+        var indent = this.$getIndent(doc.getLine(row));
+        var tab = doc.getTabString();
+        if (indent.slice(-tab.length) == tab)
+            doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
+    };
+
+    this.$id = "ace/mode/sh";
+    this.snippetFileId = "ace/snippets/sh";
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});
+
+ace.define("ace/mode/dockerfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/sh_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
+
+var DockerfileHighlightRules = function() {
+    ShHighlightRules.call(this);
+
+    var startRules = this.$rules.start;
+    for (var i = 0; i < startRules.length; i++) {
+        if (startRules[i].token == "variable.language") {
+            startRules.splice(i, 0, {
+                token: "constant.language",
+                regex: "(?:^(?:FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD|COPY|LABEL)\\b)",
+                caseInsensitive: true
+            });
+            break;
+        }
+    }
+    
+};
+
+oop.inherits(DockerfileHighlightRules, ShHighlightRules);
+
+exports.DockerfileHighlightRules = DockerfileHighlightRules;
+});
+
+ace.define("ace/mode/dockerfile",["require","exports","module","ace/lib/oop","ace/mode/sh","ace/mode/dockerfile_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var ShMode = require("./sh").Mode;
+var DockerfileHighlightRules = require("./dockerfile_highlight_rules").DockerfileHighlightRules;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+    ShMode.call(this);
+    
+    this.HighlightRules = DockerfileHighlightRules;
+    this.foldingRules = new CStyleFoldMode();
+};
+oop.inherits(Mode, ShMode);
+
+(function() {
+    this.$id = "ace/mode/dockerfile";
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});                (function() {
+                    ace.require(["ace/mode/dockerfile"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

文件差异内容过多而无法显示
+ 0 - 0
web/027e36a1f41877209eca741a54467a40.js


文件差异内容过多而无法显示
+ 351 - 271
web/03276b6288c255cf1682f53ec11bb5a2.js


文件差异内容过多而无法显示
+ 0 - 0
web/039af9192b9bb277966ceb4e4ce29c41.js


文件差异内容过多而无法显示
+ 0 - 0
web/03c0f1c2c4d4c2b6fa956a3e05de8ce4.js


+ 0 - 168
web/0410ca02b96655ac3c08452105cdad32.js

@@ -1,168 +0,0 @@
-ace.define("ace/mode/robot_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){'use strict';
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var RobotHighlightRules = function () {
-    var builtinConstantsRegex = new RegExp(/\$\{CURDIR\}|\$\{TEMPDIR\}|\$\{EXECDIR\}|\$\{\/\}|\$\{\:\}|\$\{\\n\}|\$\{true\}|\$\{false\}|\$\{none\}|\$\{null\}|\$\{space(?:\s*\*\s+[0-9]+)?\}|\$\{empty\}|&\{empty\}|@\{empty\}|\$\{TEST NAME\}|@\{TEST[\s_]TAGS\}|\$\{TEST[\s_]DOCUMENTATION\}|\$\{TEST[\s_]STATUS\}|\$\{TEST[\s_]MESSAGE\}|\$\{PREV[\s_]TEST[\s_]NAME\}|\$\{PREV[\s_]TEST[\s_]STATUS\}|\$\{PREV[\s_]TEST[\s_]MESSAGE\}|\$\{SUITE[\s_]NAME\}|\$\{SUITE[\s_]SOURCE\}|\$\{SUITE[\s_]DOCUMENTATION\}|&\{SUITE[\s_]METADATA\}|\$\{SUITE[\s_]STATUS\}|\$\{SUITE[\s_]MESSAGE\}|\$\{KEYWORD[\s_]STATUS\}|\$\{KEYWORD[\s_]MESSAGE\}|\$\{LOG[\s_]LEVEL\}|\$\{OUTPUT[\s_]FILE\}|\$\{LOG[\s_]FILE\}|\$\{REPORT[\s_]FILE\}|\$\{DEBUG[\s_]FILE\}|\$\{OUTPUT[\s_]DIR\}/);
-    this.$rules = {
-        "start": [{
-                token: "string.robot.header",
-                regex: /^\*{3}\s+(?:settings?|metadata|(?:user )?keywords?|test ?cases?|tasks?|variables?)/,
-                caseInsensitive: true,
-                push: [{
-                        token: "string.robot.header",
-                        regex: /$/,
-                        next: "pop"
-                    }, {
-                        defaultToken: "string.robot.header"
-                    }],
-                comment: "start of a table"
-            }, {
-                token: "comment.robot",
-                regex: /(?:^|\s{2,}|\t|\|\s{1,})(?=[^\\])#/,
-                push: [{
-                        token: "comment.robot",
-                        regex: /$/,
-                        next: "pop"
-                    }, {
-                        defaultToken: "comment.robot"
-                    }]
-            }, {
-                token: "comment",
-                regex: /^\s*\[?Documentation\]?/,
-                caseInsensitive: true,
-                push: [{
-                        token: "comment",
-                        regex: /^(?!\s*\.\.\.)/,
-                        next: "pop"
-                    }, {
-                        defaultToken: "comment"
-                    }]
-            }, {
-                token: "storage.type.method.robot",
-                regex: /\[(?:Arguments|Setup|Teardown|Precondition|Postcondition|Template|Return|Timeout)\]/,
-                caseInsensitive: true,
-                comment: "testcase settings"
-            }, {
-                token: "storage.type.method.robot",
-                regex: /\[Tags\]/,
-                caseInsensitive: true,
-                push: [{
-                        token: "storage.type.method.robot",
-                        regex: /^(?!\s*\.\.\.)/,
-                        next: "pop"
-                    }, {
-                        token: "comment",
-                        regex: /^\s*\.\.\./
-                    }, {
-                        defaultToken: "storage.type.method.robot"
-                    }],
-                comment: "test tags"
-            }, {
-                token: "constant.language",
-                regex: builtinConstantsRegex,
-                caseInsensitive: true
-            }, {
-                token: "entity.name.variable.wrapper",
-                regex: /[$@&%]\{\{?/,
-                push: [{
-                        token: "entity.name.variable.wrapper",
-                        regex: /\}\}?(\s?=)?/,
-                        next: "pop"
-                    }, {
-                        include: "$self"
-                    }, {
-                        token: "entity.name.variable",
-                        regex: /./
-                    }, {
-                        defaultToken: "entity.name.variable"
-                    }]
-            }, {
-                token: "keyword.control.robot",
-                regex: /^[^\s\t*$|]+|(?=^\|)\s+[^\s\t*$|]+/,
-                push: [{
-                        token: "keyword.control.robot",
-                        regex: /(?=\s{2})|\t|$|\s+(?=\|)/,
-                        next: "pop"
-                    }, {
-                        defaultToken: "keyword.control.robot"
-                    }]
-            }, {
-                token: "constant.numeric.robot",
-                regex: /\b[0-9]+(?:\.[0-9]+)?\b/
-            }, {
-                token: "keyword",
-                regex: /\s{2,}(for|in range|in|end|else if|if|else|with name)(\s{2,}|$)/,
-                caseInsensitive: true
-            }, {
-                token: "storage.type.function",
-                regex: /^(?:\s{2,}\s+)[^ \t*$@&%[.|]+/,
-                push: [{
-                        token: "storage.type.function",
-                        regex: /(?=\s{2})|\t|$|\s+(?=\|)/,
-                        next: "pop"
-                    }, {
-                        defaultToken: "storage.type.function"
-                    }]
-            }]
-    };
-    this.normalizeRules();
-};
-RobotHighlightRules.metadata = {
-    fileTypes: ['robot'],
-    name: 'Robot',
-    scopeName: 'source.robot'
-};
-oop.inherits(RobotHighlightRules, TextHighlightRules);
-exports.RobotHighlightRules = RobotHighlightRules;
-
-});
-
-ace.define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (markers) {
-    this.foldingStartMarker = new RegExp("([\\[{])(?:\\s*)$|(" + markers + ")(?:\\s*)(?:#.*)?$");
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.getFoldWidgetRange = function (session, foldStyle, row) {
-        var line = session.getLine(row);
-        var match = line.match(this.foldingStartMarker);
-        if (match) {
-            if (match[1])
-                return this.openingBracketBlock(session, match[1], row, match.index);
-            if (match[2])
-                return this.indentationBlock(session, row, match.index + match[2].length);
-            return this.indentationBlock(session, row);
-        }
-    };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/robot",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/robot_highlight_rules","ace/mode/folding/pythonic"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var RobotHighlightRules = require("./robot_highlight_rules").RobotHighlightRules;
-var FoldMode = require("./folding/pythonic").FoldMode;
-var Mode = function () {
-    this.HighlightRules = RobotHighlightRules;
-    this.foldingRules = new FoldMode();
-    this.$behaviour = this.$defaultBehaviour;
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.lineCommentStart = "#";
-    this.$id = "ace/mode/robot";
-    this.snippetFileId = "ace/snippets/robot";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});                (function() {
-                    ace.require(["ace/mode/robot"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 44 - 20
web/031eff2932c3edf3ad690d1e3abe2dde.js → web/0536af8c74f6fdf2d45e5e8990ee60cc.js

@@ -1,7 +1,10 @@
-ace.define("ace/mode/pascal_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+ace.define("ace/mode/pascal_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var PascalHighlightRules = function () {
+
+var PascalHighlightRules = function() {
     var keywordMapper = this.createKeywordMapper({
         "keyword.control": "absolute|abstract|all|and|and_then|array|as|asm|attribute|begin|bindable|case|class" +
             "|const|constructor|destructor|div|do|do|else|end|except|export|exports|external|far|file|finalization" +
@@ -10,6 +13,7 @@ var PascalHighlightRules = function () {
             "|program|property|protected|public|published|qualified|record|repeat|resident|restricted|segment|set|shl|shr" +
             "|then|to|try|type|unit|until|uses|value|var|view|virtual|while|with|xor"
     }, "identifier", true);
+
     this.$rules = {
         start: [{
                 caseInsensitive: true,
@@ -86,56 +90,71 @@ var PascalHighlightRules = function () {
             }
         ]
     };
+
     this.normalizeRules();
 };
+
 oop.inherits(PascalHighlightRules, TextHighlightRules);
-exports.PascalHighlightRules = PascalHighlightRules;
 
+exports.PascalHighlightRules = PascalHighlightRules;
 });
 
-ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var BaseFoldMode = require("./fold_mode").FoldMode;
 var Range = require("../../range").Range;
-var FoldMode = exports.FoldMode = function () { };
+
+var FoldMode = exports.FoldMode = function() {};
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.getFoldWidgetRange = function (session, foldStyle, row) {
+
+(function() {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row) {
         var range = this.indentationBlock(session, row);
         if (range)
             return range;
+
         var re = /\S/;
         var line = session.getLine(row);
         var startLevel = line.search(re);
         if (startLevel == -1 || line[startLevel] != "#")
             return;
+
         var startColumn = line.length;
         var maxRow = session.getLength();
         var startRow = row;
         var endRow = row;
+
         while (++row < maxRow) {
             line = session.getLine(row);
             var level = line.search(re);
+
             if (level == -1)
                 continue;
+
             if (line[level] != "#")
                 break;
+
             endRow = row;
         }
+
         if (endRow > startRow) {
             var endColumn = session.getLine(endRow).length;
             return new Range(startRow, startColumn, endRow, endColumn);
         }
     };
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
         var indent = line.search(/\S/);
         var next = session.getLine(row + 1);
         var prev = session.getLine(row - 1);
         var prevIndent = prev.search(/\S/);
         var nextIndent = next.search(/\S/);
+
         if (indent == -1) {
-            session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
+            session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
             return "";
         }
         if (prevIndent == -1) {
@@ -144,51 +163,56 @@ oop.inherits(FoldMode, BaseFoldMode);
                 session.foldWidgets[row + 1] = "";
                 return "start";
             }
-        }
-        else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
+        } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
             if (session.getLine(row - 2).search(/\S/) == -1) {
                 session.foldWidgets[row - 1] = "start";
                 session.foldWidgets[row + 1] = "";
                 return "";
             }
         }
-        if (prevIndent != -1 && prevIndent < indent)
+
+        if (prevIndent!= -1 && prevIndent < indent)
             session.foldWidgets[row - 1] = "start";
         else
             session.foldWidgets[row - 1] = "";
+
         if (indent < nextIndent)
             return "start";
         else
             return "";
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/pascal",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/pascal_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
-*/
+ace.define("ace/mode/pascal",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/pascal_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var PascalHighlightRules = require("./pascal_highlight_rules").PascalHighlightRules;
 var FoldMode = require("./folding/coffee").FoldMode;
-var Mode = function () {
+
+var Mode = function() {
     this.HighlightRules = PascalHighlightRules;
     this.foldingRules = new FoldMode();
     this.$behaviour = this.$defaultBehaviour;
 };
 oop.inherits(Mode, TextMode);
-(function () {
+
+(function() {
+       
     this.lineCommentStart = ["--", "//"];
     this.blockComment = [
-        { start: "(*", end: "*)" },
-        { start: "{", end: "}" }
+        {start: "(*", end: "*)"},
+        {start: "{", end: "}"}
     ];
+    
     this.$id = "ace/mode/pascal";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });                (function() {
                     ace.require(["ace/mode/pascal"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 0 - 387
web/0645227e6c2479f7aefed1fdd23ac733.js

@@ -1,387 +0,0 @@
-ace.define("ace/mode/tex_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module){/*
- * tex_highlight_rules.js
- *
- * Copyright (C) 2009-11 by RStudio, Inc.
- *
- * The Initial Developer of the Original Code is
- * Ajax.org B.V.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of Ajax.org B.V. nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *
- */
-"use strict";
-var oop = require("../lib/oop");
-var lang = require("../lib/lang");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var TexHighlightRules = function (textClass) {
-    if (!textClass)
-        textClass = "text";
-    this.$rules = {
-        "start": [
-            {
-                token: "comment",
-                regex: "%.*$"
-            }, {
-                token: textClass,
-                regex: "\\\\[$&%#\\{\\}]"
-            }, {
-                token: "keyword",
-                regex: "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b",
-                next: "nospell"
-            }, {
-                token: "keyword",
-                regex: "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"
-            }, {
-                token: "paren.keyword.operator",
-                regex: "[[({]"
-            }, {
-                token: "paren.keyword.operator",
-                regex: "[\\])}]"
-            }, {
-                token: textClass,
-                regex: "\\s+"
-            }
-        ],
-        "nospell": [
-            {
-                token: "comment",
-                regex: "%.*$",
-                next: "start"
-            }, {
-                token: "nospell." + textClass,
-                regex: "\\\\[$&%#\\{\\}]"
-            }, {
-                token: "keyword",
-                regex: "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"
-            }, {
-                token: "keyword",
-                regex: "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",
-                next: "start"
-            }, {
-                token: "paren.keyword.operator",
-                regex: "[[({]"
-            }, {
-                token: "paren.keyword.operator",
-                regex: "[\\])]"
-            }, {
-                token: "paren.keyword.operator",
-                regex: "}",
-                next: "start"
-            }, {
-                token: "nospell." + textClass,
-                regex: "\\s+"
-            }, {
-                token: "nospell." + textClass,
-                regex: "\\w+"
-            }
-        ]
-    };
-};
-oop.inherits(TexHighlightRules, TextHighlightRules);
-exports.TexHighlightRules = TexHighlightRules;
-
-});
-
-ace.define("ace/mode/r_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/tex_highlight_rules"], function(require, exports, module){/*
- * r_highlight_rules.js
- *
- * Copyright (C) 2009-11 by RStudio, Inc.
- *
- * The Initial Developer of the Original Code is
- * Ajax.org B.V.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of Ajax.org B.V. nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *
- */
-var oop = require("../lib/oop");
-var lang = require("../lib/lang");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var TexHighlightRules = require("./tex_highlight_rules").TexHighlightRules;
-var RHighlightRules = function () {
-    var keywords = lang.arrayToMap(("function|if|in|break|next|repeat|else|for|return|switch|while|try|tryCatch|stop|warning|require|library|attach|detach|source|setMethod|setGeneric|setGroupGeneric|setClass")
-        .split("|"));
-    var buildinConstants = lang.arrayToMap(("NULL|NA|TRUE|FALSE|T|F|Inf|NaN|NA_integer_|NA_real_|NA_character_|" +
-        "NA_complex_").split("|"));
-    this.$rules = {
-        "start": [
-            {
-                token: "comment.sectionhead",
-                regex: "#+(?!').*(?:----|====|####)\\s*$"
-            },
-            {
-                token: "comment",
-                regex: "#+'",
-                next: "rd-start"
-            },
-            {
-                token: "comment",
-                regex: "#.*$"
-            },
-            {
-                token: "string",
-                regex: '["]',
-                next: "qqstring"
-            },
-            {
-                token: "string",
-                regex: "[']",
-                next: "qstring"
-            },
-            {
-                token: "constant.numeric",
-                regex: "0[xX][0-9a-fA-F]+[Li]?\\b"
-            },
-            {
-                token: "constant.numeric",
-                regex: "\\d+L\\b"
-            },
-            {
-                token: "constant.numeric",
-                regex: "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b"
-            },
-            {
-                token: "constant.numeric",
-                regex: "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b"
-            },
-            {
-                token: "constant.language.boolean",
-                regex: "(?:TRUE|FALSE|T|F)\\b"
-            },
-            {
-                token: "identifier",
-                regex: "`.*?`"
-            },
-            {
-                onMatch: function (value) {
-                    if (keywords[value])
-                        return "keyword";
-                    else if (buildinConstants[value])
-                        return "constant.language";
-                    else if (value == '...' || value.match(/^\.\.\d+$/))
-                        return "variable.language";
-                    else
-                        return "identifier";
-                },
-                regex: "[a-zA-Z.][a-zA-Z0-9._]*\\b"
-            },
-            {
-                token: "keyword.operator",
-                regex: "%%|>=|<=|==|!=|\\->|<\\-|\\|\\||&&|=|\\+|\\-|\\*|/|\\^|>|<|!|&|\\||~|\\$|:"
-            },
-            {
-                token: "keyword.operator",
-                regex: "%.*?%"
-            },
-            {
-                token: "paren.keyword.operator",
-                regex: "[[({]"
-            },
-            {
-                token: "paren.keyword.operator",
-                regex: "[\\])}]"
-            },
-            {
-                token: "text",
-                regex: "\\s+"
-            }
-        ],
-        "qqstring": [
-            {
-                token: "string",
-                regex: '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
-                next: "start"
-            },
-            {
-                token: "string",
-                regex: '.+'
-            }
-        ],
-        "qstring": [
-            {
-                token: "string",
-                regex: "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
-                next: "start"
-            },
-            {
-                token: "string",
-                regex: '.+'
-            }
-        ]
-    };
-    var rdRules = new TexHighlightRules("comment").getRules();
-    for (var i = 0; i < rdRules["start"].length; i++) {
-        rdRules["start"][i].token += ".virtual-comment";
-    }
-    this.addRules(rdRules, "rd-");
-    this.$rules["rd-start"].unshift({
-        token: "text",
-        regex: "^",
-        next: "start"
-    });
-    this.$rules["rd-start"].unshift({
-        token: "keyword",
-        regex: "@(?!@)[^ ]*"
-    });
-    this.$rules["rd-start"].unshift({
-        token: "comment",
-        regex: "@@"
-    });
-    this.$rules["rd-start"].push({
-        token: "comment",
-        regex: "[^%\\\\[({\\])}]+"
-    });
-};
-oop.inherits(RHighlightRules, TextHighlightRules);
-exports.RHighlightRules = RHighlightRules;
-
-});
-
-ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
-var Range = require("../range").Range;
-var MatchingBraceOutdent = function () { };
-(function () {
-    this.checkOutdent = function (line, input) {
-        if (!/^\s+$/.test(line))
-            return false;
-        return /^\s*\}/.test(input);
-    };
-    this.autoOutdent = function (doc, row) {
-        var line = doc.getLine(row);
-        var match = line.match(/^(\s*\})/);
-        if (!match)
-            return 0;
-        var column = match[1].length;
-        var openBracePos = doc.findMatchingBracket({ row: row, column: column });
-        if (!openBracePos || openBracePos.row == row)
-            return 0;
-        var indent = this.$getIndent(doc.getLine(openBracePos.row));
-        doc.replace(new Range(row, 0, row, column - 1), indent);
-    };
-    this.$getIndent = function (line) {
-        return line.match(/^\s*/)[0];
-    };
-}).call(MatchingBraceOutdent.prototype);
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
-
-});
-
-ace.define("ace/mode/r",["require","exports","module","ace/unicode","ace/range","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/r_highlight_rules","ace/mode/matching_brace_outdent"], function(require, exports, module){/*
- * r.js
- *
- * Copyright (C) 2009-11 by RStudio, Inc.
- *
- * The Initial Developer of the Original Code is
- * Ajax.org B.V.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of Ajax.org B.V. nor the
- *       names of its contributors may be used to endorse or promote products
- *       derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- *
- */
-"use strict";
-var unicode = require("../unicode");
-var Range = require("../range").Range;
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var RHighlightRules = require("./r_highlight_rules").RHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var Mode = function () {
-    this.HighlightRules = RHighlightRules;
-    this.$outdent = new MatchingBraceOutdent();
-    this.$behaviour = this.$defaultBehaviour;
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.lineCommentStart = "#";
-    this.tokenRe = new RegExp("^[" + unicode.wordChars + "._]+", "g");
-    this.nonTokenRe = new RegExp("^(?:[^" + unicode.wordChars + "._]|\s])+", "g");
-    this.$id = "ace/mode/r";
-    this.snippetFileId = "ace/snippets/r";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});                (function() {
-                    ace.require(["ace/mode/r"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 24 - 0
web/06d453ace473034cd357edb758d539ab.js

@@ -0,0 +1,24 @@
+ace.define("ace/snippets/csound_document",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+exports.snippetText = "# <CsoundSynthesizer>\n\
+snippet synth\n\
+	<CsoundSynthesizer>\n\
+	<CsInstruments>\n\
+	${1}\n\
+	</CsInstruments>\n\
+	<CsScore>\n\
+	e\n\
+	</CsScore>\n\
+	</CsoundSynthesizer>\n\
+";
+exports.scope = "csound_document";
+
+});                (function() {
+                    ace.require(["ace/snippets/csound_document"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 83 - 0
web/0768225f873adf5f103dcb714f17783d.js

@@ -0,0 +1,83 @@
+ace.define("ace/snippets/sqlserver",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+exports.snippetText = "# ISNULL\n\
+snippet isnull\n\
+	ISNULL(${1:check_expression}, ${2:replacement_value})\n\
+# FORMAT\n\
+snippet format\n\
+	FORMAT(${1:value}, ${2:format})\n\
+# CAST\n\
+snippet cast\n\
+	CAST(${1:expression} AS ${2:data_type})\n\
+# CONVERT\n\
+snippet convert\n\
+	CONVERT(${1:data_type}, ${2:expression})\n\
+# DATEPART\n\
+snippet datepart\n\
+	DATEPART(${1:datepart}, ${2:date})\n\
+# DATEDIFF\n\
+snippet datediff\n\
+	DATEDIFF(${1:datepart}, ${2:startdate}, ${3:enddate})\n\
+# DATEADD\n\
+snippet dateadd\n\
+	DATEADD(${1:datepart}, ${2:number}, ${3:date})\n\
+# DATEFROMPARTS \n\
+snippet datefromparts\n\
+	DATEFROMPARTS(${1:year}, ${2:month}, ${3:day})\n\
+# OBJECT_DEFINITION\n\
+snippet objectdef\n\
+	SELECT OBJECT_DEFINITION(OBJECT_ID('${1:sys.server_permissions /*object name*/}'))\n\
+# STUFF XML\n\
+snippet stuffxml\n\
+	STUFF((SELECT ', ' + ${1:ColumnName}\n\
+		FROM ${2:TableName}\n\
+		WHERE ${3:WhereClause}\n\
+		FOR XML PATH('')), 1, 1, '') AS ${4:Alias}\n\
+	${5:/*https://msdn.microsoft.com/en-us/library/ms188043.aspx*/}\n\
+# Create Procedure\n\
+snippet createproc\n\
+	-- =============================================\n\
+	-- Author:		${1:Author}\n\
+	-- Create date: ${2:Date}\n\
+	-- Description:	${3:Description}\n\
+	-- =============================================\n\
+	CREATE PROCEDURE ${4:Procedure_Name}\n\
+		${5:/*Add the parameters for the stored procedure here*/}\n\
+	AS\n\
+	BEGIN\n\
+		-- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements.\n\
+		SET NOCOUNT ON;\n\
+		\n\
+		${6:/*Add the T-SQL statements to compute the return value here*/}\n\
+		\n\
+	END\n\
+	GO\n\
+# Create Scalar Function\n\
+snippet createfn\n\
+	-- =============================================\n\
+	-- Author:		${1:Author}\n\
+	-- Create date: ${2:Date}\n\
+	-- Description:	${3:Description}\n\
+	-- =============================================\n\
+	CREATE FUNCTION ${4:Scalar_Function_Name}\n\
+		-- Add the parameters for the function here\n\
+	RETURNS ${5:Function_Data_Type}\n\
+	AS\n\
+	BEGIN\n\
+		DECLARE @Result ${5:Function_Data_Type}\n\
+		\n\
+		${6:/*Add the T-SQL statements to compute the return value here*/}\n\
+		\n\
+	END\n\
+	GO";
+exports.scope = "sqlserver";
+
+});                (function() {
+                    ace.require(["ace/snippets/sqlserver"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 376 - 290
web/49f3ce47b6286f3522174d118089eb5d.js → web/07c0a60b390501dfbb57219d5c8fbc1a.js

@@ -1,72 +1,90 @@
-ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var DocCommentHighlightRules = function () {
+
+var DocCommentHighlightRules = function() {
     this.$rules = {
-        "start": [{
-                token: "comment.doc.tag",
-                regex: "@[\\w\\d_]+" // TODO: fix email addresses
-            },
-            DocCommentHighlightRules.getTagRule(),
-            {
-                defaultToken: "comment.doc",
-                caseInsensitive: true
-            }]
+        "start" : [ {
+            token : "comment.doc.tag",
+            regex : "@[\\w\\d_]+" // TODO: fix email addresses
+        }, 
+        DocCommentHighlightRules.getTagRule(),
+        {
+            defaultToken : "comment.doc",
+            caseInsensitive: true
+        }]
     };
 };
+
 oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-DocCommentHighlightRules.getTagRule = function (start) {
+
+DocCommentHighlightRules.getTagRule = function(start) {
     return {
-        token: "comment.doc.tag.storage.type",
-        regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
+        token : "comment.doc.tag.storage.type",
+        regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
     };
 };
-DocCommentHighlightRules.getStartRule = function (start) {
+
+DocCommentHighlightRules.getStartRule = function(start) {
     return {
-        token: "comment.doc",
-        regex: "\\/\\*(?=\\*)",
-        next: start
+        token : "comment.doc", // doc comment
+        regex : "\\/\\*(?=\\*)",
+        next  : start
     };
 };
+
 DocCommentHighlightRules.getEndRule = function (start) {
     return {
-        token: "comment.doc",
-        regex: "\\*\\/",
-        next: start
+        token : "comment.doc", // closing comment
+        regex : "\\*\\/",
+        next  : start
     };
 };
+
+
 exports.DocCommentHighlightRules = DocCommentHighlightRules;
 
 });
 
-ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
 var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
-var JavaScriptHighlightRules = function (options) {
+
+var JavaScriptHighlightRules = function(options) {
     var keywordMapper = this.createKeywordMapper({
-        "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
-            "Namespace|QName|XML|XMLList|" + // E4X
-            "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
-            "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
-            "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
-            "SyntaxError|TypeError|URIError|" +
+        "variable.language":
+            "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|"  + // Constructors
+            "Namespace|QName|XML|XMLList|"                                             + // E4X
+            "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|"   +
+            "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|"                    +
+            "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|"   + // Errors
+            "SyntaxError|TypeError|URIError|"                                          +
             "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
-            "isNaN|parseFloat|parseInt|" +
-            "JSON|Math|" + // Other
-            "this|arguments|prototype|window|document",
-        "keyword": "const|yield|import|get|set|async|await|" +
+            "isNaN|parseFloat|parseInt|"                                               +
+            "JSON|Math|"                                                               + // Other
+            "this|arguments|prototype|window|document"                                 , // Pseudo
+        "keyword":
+            "const|yield|import|get|set|async|await|" +
             "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
             "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
             "__parent__|__count__|escape|unescape|with|__proto__|" +
             "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
-        "storage.type": "const|let|var|function",
-        "constant.language": "null|Infinity|NaN|undefined",
-        "support.function": "alert",
+        "storage.type":
+            "const|let|var|function",
+        "constant.language":
+            "null|Infinity|NaN|undefined",
+        "support.function":
+            "alert",
         "constant.language.boolean": "true|false"
     }, "identifier");
     var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
+
     var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
         "u[0-9a-fA-F]{4}|" + // unicode
         "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
@@ -74,142 +92,143 @@ var JavaScriptHighlightRules = function (options) {
         "3[0-7][0-7]?|" + // oct
         "[4-7][0-7]?|" + //oct
         ".)";
+
     this.$rules = {
-        "no_regex": [
+        "no_regex" : [
             DocCommentHighlightRules.getStartRule("doc-start"),
             comments("no_regex"),
             {
-                token: "string",
-                regex: "'(?=.)",
-                next: "qstring"
+                token : "string",
+                regex : "'(?=.)",
+                next  : "qstring"
             }, {
-                token: "string",
-                regex: '"(?=.)',
-                next: "qqstring"
+                token : "string",
+                regex : '"(?=.)',
+                next  : "qqstring"
             }, {
-                token: "constant.numeric",
-                regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
+                token : "constant.numeric", // hexadecimal, octal and binary
+                regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
             }, {
-                token: "constant.numeric",
-                regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
+                token : "constant.numeric", // decimal integers and floats
+                regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
             }, {
-                token: [
+                token : [
                     "storage.type", "punctuation.operator", "support.function",
-                    "punctuation.operator", "entity.name.function", "text", "keyword.operator"
+                    "punctuation.operator", "entity.name.function", "text","keyword.operator"
                 ],
-                regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
+                regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
                 next: "function_arguments"
             }, {
-                token: [
+                token : [
                     "storage.type", "punctuation.operator", "entity.name.function", "text",
                     "keyword.operator", "text", "storage.type", "text", "paren.lparen"
                 ],
-                regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+                regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
                 next: "function_arguments"
             }, {
-                token: [
+                token : [
                     "entity.name.function", "text", "keyword.operator", "text", "storage.type",
                     "text", "paren.lparen"
                 ],
-                regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
+                regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
                 next: "function_arguments"
             }, {
-                token: [
+                token : [
                     "storage.type", "punctuation.operator", "entity.name.function", "text",
                     "keyword.operator", "text",
                     "storage.type", "text", "entity.name.function", "text", "paren.lparen"
                 ],
-                regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
+                regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
                 next: "function_arguments"
             }, {
-                token: [
+                token : [
                     "storage.type", "text", "entity.name.function", "text", "paren.lparen"
                 ],
-                regex: "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
+                regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
                 next: "function_arguments"
             }, {
-                token: [
+                token : [
                     "entity.name.function", "text", "punctuation.operator",
                     "text", "storage.type", "text", "paren.lparen"
                 ],
-                regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
+                regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
                 next: "function_arguments"
             }, {
-                token: [
+                token : [
                     "text", "text", "storage.type", "text", "paren.lparen"
                 ],
-                regex: "(:)(\\s*)(function)(\\s*)(\\()",
+                regex : "(:)(\\s*)(function)(\\s*)(\\()",
                 next: "function_arguments"
             }, {
-                token: "keyword",
-                regex: "from(?=\\s*('|\"))"
+                token : "keyword",
+                regex : "from(?=\\s*('|\"))"
             }, {
-                token: "keyword",
-                regex: "(?:" + kwBeforeRe + ")\\b",
-                next: "start"
+                token : "keyword",
+                regex : "(?:" + kwBeforeRe + ")\\b",
+                next : "start"
             }, {
-                token: ["support.constant"],
-                regex: /that\b/
+                token : ["support.constant"],
+                regex : /that\b/
             }, {
-                token: ["storage.type", "punctuation.operator", "support.function.firebug"],
-                regex: /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
+                token : ["storage.type", "punctuation.operator", "support.function.firebug"],
+                regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
             }, {
-                token: keywordMapper,
-                regex: identifierRe
+                token : keywordMapper,
+                regex : identifierRe
             }, {
-                token: "punctuation.operator",
-                regex: /[.](?![.])/,
-                next: "property"
+                token : "punctuation.operator",
+                regex : /[.](?![.])/,
+                next  : "property"
             }, {
-                token: "storage.type",
-                regex: /=>/,
-                next: "start"
+                token : "storage.type",
+                regex : /=>/,
+                next  : "start"
             }, {
-                token: "keyword.operator",
-                regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
-                next: "start"
+                token : "keyword.operator",
+                regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
+                next  : "start"
             }, {
-                token: "punctuation.operator",
-                regex: /[?:,;.]/,
-                next: "start"
+                token : "punctuation.operator",
+                regex : /[?:,;.]/,
+                next  : "start"
             }, {
-                token: "paren.lparen",
-                regex: /[\[({]/,
-                next: "start"
+                token : "paren.lparen",
+                regex : /[\[({]/,
+                next  : "start"
             }, {
-                token: "paren.rparen",
-                regex: /[\])}]/
+                token : "paren.rparen",
+                regex : /[\])}]/
             }, {
                 token: "comment",
                 regex: /^#!.*$/
             }
         ],
         property: [{
-                token: "text",
-                regex: "\\s+"
+                token : "text",
+                regex : "\\s+"
             }, {
-                token: [
+                token : [
                     "storage.type", "punctuation.operator", "entity.name.function", "text",
                     "keyword.operator", "text",
                     "storage.type", "text", "entity.name.function", "text", "paren.lparen"
                 ],
-                regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
+                regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
                 next: "function_arguments"
             }, {
-                token: "punctuation.operator",
-                regex: /[.](?![.])/
+                token : "punctuation.operator",
+                regex : /[.](?![.])/
             }, {
-                token: "support.function",
-                regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
+                token : "support.function",
+                regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
             }, {
-                token: "support.function.dom",
-                regex: /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
+                token : "support.function.dom",
+                regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
             }, {
-                token: "support.constant",
-                regex: /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
+                token :  "support.constant",
+                regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
             }, {
-                token: "identifier",
-                regex: identifierRe
+                token : "identifier",
+                regex : identifierRe
             }, {
                 regex: "",
                 token: "empty",
@@ -224,9 +243,9 @@ var JavaScriptHighlightRules = function (options) {
                 regex: "\\/",
                 next: "regex"
             }, {
-                token: "text",
-                regex: "\\s+|^$",
-                next: "start"
+                token : "text",
+                regex : "\\s+|^$",
+                next : "start"
             }, {
                 token: "empty",
                 regex: "",
@@ -242,13 +261,13 @@ var JavaScriptHighlightRules = function (options) {
                 regex: "/[sxngimy]*",
                 next: "no_regex"
             }, {
-                token: "invalid",
+                token : "invalid",
                 regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
             }, {
-                token: "constant.language.escape",
+                token : "constant.language.escape",
                 regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
             }, {
-                token: "constant.language.delimiter",
+                token : "constant.language.delimiter",
                 regex: /\|/
             }, {
                 token: "constant.language.escape",
@@ -297,42 +316,44 @@ var JavaScriptHighlightRules = function (options) {
                 next: "no_regex"
             }
         ],
-        "qqstring": [
+        "qqstring" : [
             {
-                token: "constant.language.escape",
-                regex: escapedRe
+                token : "constant.language.escape",
+                regex : escapedRe
             }, {
-                token: "string",
-                regex: "\\\\$",
-                consumeLineEnd: true
+                token : "string",
+                regex : "\\\\$",
+                consumeLineEnd  : true
             }, {
-                token: "string",
-                regex: '"|$',
-                next: "no_regex"
+                token : "string",
+                regex : '"|$',
+                next  : "no_regex"
             }, {
                 defaultToken: "string"
             }
         ],
-        "qstring": [
+        "qstring" : [
             {
-                token: "constant.language.escape",
-                regex: escapedRe
+                token : "constant.language.escape",
+                regex : escapedRe
             }, {
-                token: "string",
-                regex: "\\\\$",
-                consumeLineEnd: true
+                token : "string",
+                regex : "\\\\$",
+                consumeLineEnd  : true
             }, {
-                token: "string",
-                regex: "'|$",
-                next: "no_regex"
+                token : "string",
+                regex : "'|$",
+                next  : "no_regex"
             }, {
                 defaultToken: "string"
             }
         ]
     };
+
+
     if (!options || !options.noES6) {
         this.$rules.no_regex.unshift({
-            regex: "[{}]", onMatch: function (val, state, stack) {
+            regex: "[{}]", onMatch: function(val, state, stack) {
                 this.next = val == "{" ? this.nextState : "";
                 if (val == "{" && stack.length) {
                     stack.unshift("start", state);
@@ -347,34 +368,40 @@ var JavaScriptHighlightRules = function (options) {
             },
             nextState: "start"
         }, {
-            token: "string.quasi.start",
-            regex: /`/,
-            push: [{
-                    token: "constant.language.escape",
-                    regex: escapedRe
-                }, {
-                    token: "paren.quasi.start",
-                    regex: /\${/,
-                    push: "start"
-                }, {
-                    token: "string.quasi.end",
-                    regex: /`/,
-                    next: "pop"
-                }, {
-                    defaultToken: "string.quasi"
-                }]
+            token : "string.quasi.start",
+            regex : /`/,
+            push  : [{
+                token : "constant.language.escape",
+                regex : escapedRe
+            }, {
+                token : "paren.quasi.start",
+                regex : /\${/,
+                push  : "start"
+            }, {
+                token : "string.quasi.end",
+                regex : /`/,
+                next  : "pop"
+            }, {
+                defaultToken: "string.quasi"
+            }]
         });
+
         if (!options || options.jsx != false)
             JSX.call(this);
     }
-    this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("no_regex")]);
+
+    this.embedRules(DocCommentHighlightRules, "doc-",
+        [ DocCommentHighlightRules.getEndRule("no_regex") ]);
+
     this.normalizeRules();
 };
+
 oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
+
 function JSX() {
     var tagRegex = identifierRe.replace("\\d", "\\d\\-");
     var jsxTag = {
-        onMatch: function (val, state, stack) {
+        onMatch : function(val, state, stack) {
             var offset = val.charAt(1) == "/" ? 2 : 1;
             if (offset == 1) {
                 if (state != this.nextState)
@@ -382,8 +409,7 @@ function JSX() {
                 else
                     stack.unshift(this.next);
                 stack[2]++;
-            }
-            else if (offset == 2) {
+            } else if (offset == 2) {
                 if (state == this.nextState) {
                     stack[1]--;
                     if (!stack[1] || stack[1] < 0) {
@@ -393,14 +419,14 @@ function JSX() {
                 }
             }
             return [{
-                    type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
-                    value: val.slice(0, offset)
-                }, {
-                    type: "meta.tag.tag-name.xml",
-                    value: val.substr(offset)
-                }];
+                type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
+                value: val.slice(0, offset)
+            }, {
+                type: "meta.tag.tag-name.xml",
+                value: val.substr(offset)
+            }];
         },
-        regex: "</?" + tagRegex + "",
+        regex : "</?" + tagRegex + "",
         next: "jsxAttributes",
         nextState: "jsx"
     };
@@ -413,177 +439,212 @@ function JSX() {
     this.$rules.jsx = [
         jsxJsRule,
         jsxTag,
-        { include: "reference" },
-        { defaultToken: "string" }
+        {include : "reference"},
+        {defaultToken: "string"}
     ];
     this.$rules.jsxAttributes = [{
-            token: "meta.tag.punctuation.tag-close.xml",
-            regex: "/?>",
-            onMatch: function (value, currentState, stack) {
-                if (currentState == stack[0])
-                    stack.shift();
-                if (value.length == 2) {
-                    if (stack[0] == this.nextState)
-                        stack[1]--;
-                    if (!stack[1] || stack[1] < 0) {
-                        stack.splice(0, 2);
-                    }
+        token : "meta.tag.punctuation.tag-close.xml",
+        regex : "/?>",
+        onMatch : function(value, currentState, stack) {
+            if (currentState == stack[0])
+                stack.shift();
+            if (value.length == 2) {
+                if (stack[0] == this.nextState)
+                    stack[1]--;
+                if (!stack[1] || stack[1] < 0) {
+                    stack.splice(0, 2);
                 }
-                this.next = stack[0] || "start";
-                return [{ type: this.token, value: value }];
-            },
-            nextState: "jsx"
-        },
-        jsxJsRule,
-        comments("jsxAttributes"),
-        {
-            token: "entity.other.attribute-name.xml",
-            regex: tagRegex
-        }, {
-            token: "keyword.operator.attribute-equals.xml",
-            regex: "="
-        }, {
-            token: "text.tag-whitespace.xml",
-            regex: "\\s+"
-        }, {
-            token: "string.attribute-value.xml",
-            regex: "'",
-            stateName: "jsx_attr_q",
-            push: [
-                { token: "string.attribute-value.xml", regex: "'", next: "pop" },
-                { include: "reference" },
-                { defaultToken: "string.attribute-value.xml" }
-            ]
-        }, {
-            token: "string.attribute-value.xml",
-            regex: '"',
-            stateName: "jsx_attr_qq",
-            push: [
-                { token: "string.attribute-value.xml", regex: '"', next: "pop" },
-                { include: "reference" },
-                { defaultToken: "string.attribute-value.xml" }
-            ]
+            }
+            this.next = stack[0] || "start";
+            return [{type: this.token, value: value}];
         },
-        jsxTag
+        nextState: "jsx"
+    },
+    jsxJsRule,
+    comments("jsxAttributes"),
+    {
+        token : "entity.other.attribute-name.xml",
+        regex : tagRegex
+    }, {
+        token : "keyword.operator.attribute-equals.xml",
+        regex : "="
+    }, {
+        token : "text.tag-whitespace.xml",
+        regex : "\\s+"
+    }, {
+        token : "string.attribute-value.xml",
+        regex : "'",
+        stateName : "jsx_attr_q",
+        push : [
+            {token : "string.attribute-value.xml", regex: "'", next: "pop"},
+            {include : "reference"},
+            {defaultToken : "string.attribute-value.xml"}
+        ]
+    }, {
+        token : "string.attribute-value.xml",
+        regex : '"',
+        stateName : "jsx_attr_qq",
+        push : [
+            {token : "string.attribute-value.xml", regex: '"', next: "pop"},
+            {include : "reference"},
+            {defaultToken : "string.attribute-value.xml"}
+        ]
+    },
+    jsxTag
     ];
     this.$rules.reference = [{
-            token: "constant.language.escape.reference.xml",
-            regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
-        }];
+        token : "constant.language.escape.reference.xml",
+        regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
+    }];
 }
+
 function comments(next) {
     return [
         {
-            token: "comment",
-            regex: /\/\*/,
+            token : "comment", // multi line comment
+            regex : /\/\*/,
             next: [
                 DocCommentHighlightRules.getTagRule(),
-                { token: "comment", regex: "\\*\\/", next: next || "pop" },
-                { defaultToken: "comment", caseInsensitive: true }
+                {token : "comment", regex : "\\*\\/", next : next || "pop"},
+                {defaultToken : "comment", caseInsensitive: true}
             ]
         }, {
-            token: "comment",
-            regex: "\\/\\/",
+            token : "comment",
+            regex : "\\/\\/",
             next: [
                 DocCommentHighlightRules.getTagRule(),
-                { token: "comment", regex: "$|^", next: next || "pop" },
-                { defaultToken: "comment", caseInsensitive: true }
+                {token : "comment", regex : "$|^", next : next || "pop"},
+                {defaultToken : "comment", caseInsensitive: true}
             ]
         }
     ];
 }
 exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
-
 });
 
-ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
+ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
+"use strict";
+
 var Range = require("../range").Range;
-var MatchingBraceOutdent = function () { };
-(function () {
-    this.checkOutdent = function (line, input) {
-        if (!/^\s+$/.test(line))
+
+var MatchingBraceOutdent = function() {};
+
+(function() {
+
+    this.checkOutdent = function(line, input) {
+        if (! /^\s+$/.test(line))
             return false;
+
         return /^\s*\}/.test(input);
     };
-    this.autoOutdent = function (doc, row) {
+
+    this.autoOutdent = function(doc, row) {
         var line = doc.getLine(row);
         var match = line.match(/^(\s*\})/);
-        if (!match)
-            return 0;
+
+        if (!match) return 0;
+
         var column = match[1].length;
-        var openBracePos = doc.findMatchingBracket({ row: row, column: column });
-        if (!openBracePos || openBracePos.row == row)
-            return 0;
+        var openBracePos = doc.findMatchingBracket({row: row, column: column});
+
+        if (!openBracePos || openBracePos.row == row) return 0;
+
         var indent = this.$getIndent(doc.getLine(openBracePos.row));
-        doc.replace(new Range(row, 0, row, column - 1), indent);
+        doc.replace(new Range(row, 0, row, column-1), indent);
     };
-    this.$getIndent = function (line) {
+
+    this.$getIndent = function(line) {
         return line.match(/^\s*/)[0];
     };
+
 }).call(MatchingBraceOutdent.prototype);
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
 
+exports.MatchingBraceOutdent = MatchingBraceOutdent;
 });
 
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var Range = require("../../range").Range;
 var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
     if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
     }
 };
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
+
+(function() {
+    
     this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
     this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
     this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
     this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
     this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
+    
         if (this.singleLineBlockCommentRe.test(line)) {
             if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
                 return "";
         }
+    
         var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
         if (!fw && this.startRegionRe.test(line))
             return "start"; // lineCommentRegionStart
+    
         return fw;
     };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
         var line = session.getLine(row);
+        
         if (this.startRegionRe.test(line))
             return this.getCommentRegionBlock(session, line, row);
+        
         var match = line.match(this.foldingStartMarker);
         if (match) {
             var i = match.index;
+
             if (match[1])
                 return this.openingBracketBlock(session, match[1], row, i);
+                
             var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
             if (range && !range.isMultiLine()) {
                 if (forceMultiline) {
                     range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
+                } else if (foldStyle != "all")
                     range = null;
             }
+            
             return range;
         }
+
         if (foldStyle === "markbegin")
             return;
+
         var match = line.match(this.foldingStopMarker);
         if (match) {
             var i = match.index + match[0].length;
+
             if (match[1])
                 return this.closingBracketBlock(session, match[1], row, i);
+
             return session.getCommentFoldRange(row, i, -1);
         }
     };
-    this.getSectionRange = function (session, row) {
+    
+    this.getSectionRange = function(session, row) {
         var line = session.getLine(row);
         var startIndent = line.search(/\S/);
         var startRow = row;
@@ -596,52 +657,54 @@ oop.inherits(FoldMode, BaseFoldMode);
             var indent = line.search(/\S/);
             if (indent === -1)
                 continue;
-            if (startIndent > indent)
+            if  (startIndent > indent)
                 break;
             var subRange = this.getFoldWidgetRange(session, "all", row);
+            
             if (subRange) {
                 if (subRange.start.row <= startRow) {
                     break;
-                }
-                else if (subRange.isMultiLine()) {
+                } else if (subRange.isMultiLine()) {
                     row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
+                } else if (startIndent == indent) {
                     break;
                 }
             }
             endRow = row;
         }
+        
         return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
     };
-    this.getCommentRegionBlock = function (session, line, row) {
+    this.getCommentRegionBlock = function(session, line, row) {
         var startColumn = line.search(/\s*$/);
         var maxRow = session.getLength();
         var startRow = row;
+        
         var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
         var depth = 1;
         while (++row < maxRow) {
             line = session.getLine(row);
             var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
         }
+
         var endRow = row;
         if (endRow > startRow) {
             return new Range(startRow, startColumn, endRow, line.length);
         }
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
@@ -649,32 +712,39 @@ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutd
 var WorkerClient = require("../worker/worker_client").WorkerClient;
 var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
+
+var Mode = function() {
     this.HighlightRules = JavaScriptHighlightRules;
+    
     this.$outdent = new MatchingBraceOutdent();
     this.$behaviour = new CstyleBehaviour();
     this.foldingRules = new CStyleFoldMode();
 };
 oop.inherits(Mode, TextMode);
-(function () {
+
+(function() {
+
     this.lineCommentStart = "//";
-    this.blockComment = { start: "/*", end: "*/" };
-    this.$quotes = { '"': '"', "'": "'", "`": "`" };
-    this.getNextLineIndent = function (state, line, tab) {
+    this.blockComment = {start: "/*", end: "*/"};
+    this.$quotes = {'"': '"', "'": "'", "`": "`"};
+
+    this.getNextLineIndent = function(state, line, tab) {
         var indent = this.$getIndent(line);
+
         var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
         var tokens = tokenizedLine.tokens;
         var endState = tokenizedLine.state;
-        if (tokens.length && tokens[tokens.length - 1].type == "comment") {
+
+        if (tokens.length && tokens[tokens.length-1].type == "comment") {
             return indent;
         }
+
         if (state == "start" || state == "no_regex") {
             var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
             if (match) {
                 indent += tab;
             }
-        }
-        else if (state == "doc-start") {
+        } else if (state == "doc-start") {
             if (endState == "start" || endState == "no_regex") {
                 return "";
             }
@@ -686,38 +756,48 @@ oop.inherits(Mode, TextMode);
                 indent += "* ";
             }
         }
+
         return indent;
     };
-    this.checkOutdent = function (state, line, input) {
+
+    this.checkOutdent = function(state, line, input) {
         return this.$outdent.checkOutdent(line, input);
     };
-    this.autoOutdent = function (state, doc, row) {
+
+    this.autoOutdent = function(state, doc, row) {
         this.$outdent.autoOutdent(doc, row);
     };
-    this.createWorker = function (session) {
+
+    this.createWorker = function(session) {
         var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
         worker.attachToDocument(session.getDocument());
-        worker.on("annotate", function (results) {
+
+        worker.on("annotate", function(results) {
             session.setAnnotations(results.data);
         });
-        worker.on("terminate", function () {
+
+        worker.on("terminate", function() {
             session.clearAnnotations();
         });
+
         return worker;
     };
+
     this.$id = "ace/mode/javascript";
     this.snippetFileId = "ace/snippets/javascript";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });
 
-ace.define("ace/mode/typescript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/javascript_highlight_rules"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode_highlight_rules.tmpl.js (UUID: 21e323af-f665-4161-96e7-5087d262557e) */
+ace.define("ace/mode/typescript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/javascript_highlight_rules"], function (require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
+
 var TypeScriptHighlightRules = function (options) {
+
     var tsRules = [
         {
             token: ["storage.type", "text", "entity.name.function.ts"],
@@ -730,68 +810,74 @@ var TypeScriptHighlightRules = function (options) {
         {
             token: ["keyword", "storage.type.variable.ts"],
             regex: "(class|type)(\\s+[a-zA-Z0-9_?.$][\\w?.$]*)"
-        },
+         },
         {
             token: "keyword",
             regex: "\\b(?:super|export|import|keyof|infer)\\b"
-        },
+        }, 
         {
             token: ["storage.type.variable.ts"],
             regex: "(?:\\b(this\\.|string\\b|bool\\b|boolean\\b|number\\b|true\\b|false\\b|undefined\\b|any\\b|null\\b|(?:unique )?symbol\\b|object\\b|never\\b|enum\\b))"
         }
     ];
-    var JSRules = new JavaScriptHighlightRules({ jsx: (options && options.jsx) == true }).getRules();
+
+    var JSRules = new JavaScriptHighlightRules({jsx: (options && options.jsx) == true}).getRules();
+    
     JSRules.no_regex = tsRules.concat(JSRules.no_regex);
     this.$rules = JSRules;
 };
+
 oop.inherits(TypeScriptHighlightRules, JavaScriptHighlightRules);
-exports.TypeScriptHighlightRules = TypeScriptHighlightRules;
 
+exports.TypeScriptHighlightRules = TypeScriptHighlightRules;
 });
 
-ace.define("ace/mode/typescript",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/typescript_highlight_rules","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/mode/matching_brace_outdent"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
-*/
+ace.define("ace/mode/typescript",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/typescript_highlight_rules","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle","ace/mode/matching_brace_outdent"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var jsMode = require("./javascript").Mode;
 var TypeScriptHighlightRules = require("./typescript_highlight_rules").TypeScriptHighlightRules;
 var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var Mode = function () {
+
+var Mode = function() {
     this.HighlightRules = TypeScriptHighlightRules;
+    
     this.$outdent = new MatchingBraceOutdent();
     this.$behaviour = new CstyleBehaviour();
     this.foldingRules = new CStyleFoldMode();
 };
 oop.inherits(Mode, jsMode);
-(function () {
-    this.createWorker = function (session) {
+
+(function() {
+    this.createWorker = function(session) {
         return null;
     };
     this.$id = "ace/mode/typescript";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });
 
-ace.define("ace/mode/tsx",["require","exports","module","ace/lib/oop","ace/mode/typescript"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
-*/
+ace.define("ace/mode/tsx",["require","exports","module","ace/lib/oop","ace/mode/typescript"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var tsMode = require("./typescript").Mode;
-var Mode = function () {
+
+var Mode = function() {
     tsMode.call(this);
-    this.$highlightRuleConfig = { jsx: true };
+    this.$highlightRuleConfig = {jsx: true};
 };
 oop.inherits(Mode, tsMode);
-(function () {
+
+(function() {
     this.$id = "ace/mode/tsx";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });                (function() {
                     ace.require(["ace/mode/tsx"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

文件差异内容过多而无法显示
+ 351 - 271
web/07c26a67fe6aa27f701c6fb03a7bbafd.js


+ 0 - 750
web/07ffddcf45f1e6302c8af71d36e17b7b.js

@@ -1,750 +0,0 @@
-ace.define("ace/ext/menu_tools/settings_menu.css",["require","exports","module"], function(require, exports, module){module.exports = "#ace_settingsmenu, #kbshortcutmenu {\n    background-color: #F7F7F7;\n    color: black;\n    box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\n    padding: 1em 0.5em 2em 1em;\n    overflow: auto;\n    position: absolute;\n    margin: 0;\n    bottom: 0;\n    right: 0;\n    top: 0;\n    z-index: 9991;\n    cursor: default;\n}\n\n.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\n    box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\n    background-color: rgba(255, 255, 255, 0.6);\n    color: black;\n}\n\n.ace_optionsMenuEntry:hover {\n    background-color: rgba(100, 100, 100, 0.1);\n    transition: all 0.3s\n}\n\n.ace_closeButton {\n    background: rgba(245, 146, 146, 0.5);\n    border: 1px solid #F48A8A;\n    border-radius: 50%;\n    padding: 7px;\n    position: absolute;\n    right: -8px;\n    top: -8px;\n    z-index: 100000;\n}\n.ace_closeButton{\n    background: rgba(245, 146, 146, 0.9);\n}\n.ace_optionsMenuKey {\n    color: darkslateblue;\n    font-weight: bold;\n}\n.ace_optionsMenuCommand {\n    color: darkcyan;\n    font-weight: normal;\n}\n.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {\n    vertical-align: middle;\n}\n\n.ace_optionsMenuEntry button[ace_selected_button=true] {\n    background: #e7e7e7;\n    box-shadow: 1px 0px 2px 0px #adadad inset;\n    border-color: #adadad;\n}\n.ace_optionsMenuEntry button {\n    background: white;\n    border: 1px solid lightgray;\n    margin: 0px;\n}\n.ace_optionsMenuEntry button:hover{\n    background: #f0f0f0;\n}";
-
-});
-
-ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom","ace/ext/menu_tools/settings_menu.css"], function(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
-'use strict';
-var dom = require("../../lib/dom");
-var cssText = require("./settings_menu.css");
-dom.importCssString(cssText, "settings_menu.css", false);
-module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
-    var closer = document.createElement('div');
-    var ignoreFocusOut = false;
-    function documentEscListener(e) {
-        if (e.keyCode === 27) {
-            close();
-        }
-    }
-    function close() {
-        if (!closer)
-            return;
-        document.removeEventListener('keydown', documentEscListener);
-        closer.parentNode.removeChild(closer);
-        if (editor) {
-            editor.focus();
-        }
-        closer = null;
-        callback && callback();
-    }
-    function setIgnoreFocusOut(ignore) {
-        ignoreFocusOut = ignore;
-        if (ignore) {
-            closer.style.pointerEvents = "none";
-            contentElement.style.pointerEvents = "auto";
-        }
-    }
-    closer.style.cssText = 'margin: 0; padding: 0; ' +
-        'position: fixed; top:0; bottom:0; left:0; right:0;' +
-        'z-index: 9990; ' +
-        (editor ? 'background-color: rgba(0, 0, 0, 0.3);' : '');
-    closer.addEventListener('click', function (e) {
-        if (!ignoreFocusOut) {
-            close();
-        }
-    });
-    document.addEventListener('keydown', documentEscListener);
-    contentElement.addEventListener('click', function (e) {
-        e.stopPropagation();
-    });
-    closer.appendChild(contentElement);
-    document.body.appendChild(closer);
-    if (editor) {
-        editor.blur();
-    }
-    return {
-        close: close,
-        setIgnoreFocusOut: setIgnoreFocusOut
-    };
-};
-
-});
-
-ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module){"use strict";
-var modes = [];
-function getModeForPath(path) {
-    var mode = modesByName.text;
-    var fileName = path.split(/[\/\\]/).pop();
-    for (var i = 0; i < modes.length; i++) {
-        if (modes[i].supportsFile(fileName)) {
-            mode = modes[i];
-            break;
-        }
-    }
-    return mode;
-}
-var Mode = function (name, caption, extensions) {
-    this.name = name;
-    this.caption = caption;
-    this.mode = "ace/mode/" + name;
-    this.extensions = extensions;
-    var re;
-    if (/\^/.test(extensions)) {
-        re = extensions.replace(/\|(\^)?/g, function (a, b) {
-            return "$|" + (b ? "^" : "^.*\\.");
-        }) + "$";
-    }
-    else {
-        re = "^.*\\.(" + extensions + ")$";
-    }
-    this.extRe = new RegExp(re, "gi");
-};
-Mode.prototype.supportsFile = function (filename) {
-    return filename.match(this.extRe);
-};
-var supportedModes = {
-    ABAP: ["abap"],
-    ABC: ["abc"],
-    ActionScript: ["as"],
-    ADA: ["ada|adb"],
-    Alda: ["alda"],
-    Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],
-    Apex: ["apex|cls|trigger|tgr"],
-    AQL: ["aql"],
-    AsciiDoc: ["asciidoc|adoc"],
-    ASL: ["dsl|asl|asl.json"],
-    Assembly_x86: ["asm|a"],
-    AutoHotKey: ["ahk"],
-    BatchFile: ["bat|cmd"],
-    C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
-    C9Search: ["c9search_results"],
-    Cirru: ["cirru|cr"],
-    Clojure: ["clj|cljs"],
-    Cobol: ["CBL|COB"],
-    coffee: ["coffee|cf|cson|^Cakefile"],
-    ColdFusion: ["cfm"],
-    Crystal: ["cr"],
-    CSharp: ["cs"],
-    Csound_Document: ["csd"],
-    Csound_Orchestra: ["orc"],
-    Csound_Score: ["sco"],
-    CSS: ["css"],
-    Curly: ["curly"],
-    D: ["d|di"],
-    Dart: ["dart"],
-    Diff: ["diff|patch"],
-    Dockerfile: ["^Dockerfile"],
-    Dot: ["dot"],
-    Drools: ["drl"],
-    Edifact: ["edi"],
-    Eiffel: ["e|ge"],
-    EJS: ["ejs"],
-    Elixir: ["ex|exs"],
-    Elm: ["elm"],
-    Erlang: ["erl|hrl"],
-    Forth: ["frt|fs|ldr|fth|4th"],
-    Fortran: ["f|f90"],
-    FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
-    FSL: ["fsl"],
-    FTL: ["ftl"],
-    Gcode: ["gcode"],
-    Gherkin: ["feature"],
-    Gitignore: ["^.gitignore"],
-    Glsl: ["glsl|frag|vert"],
-    Gobstones: ["gbs"],
-    golang: ["go"],
-    GraphQLSchema: ["gql"],
-    Groovy: ["groovy"],
-    HAML: ["haml"],
-    Handlebars: ["hbs|handlebars|tpl|mustache"],
-    Haskell: ["hs"],
-    Haskell_Cabal: ["cabal"],
-    haXe: ["hx"],
-    Hjson: ["hjson"],
-    HTML: ["html|htm|xhtml|vue|we|wpy"],
-    HTML_Elixir: ["eex|html.eex"],
-    HTML_Ruby: ["erb|rhtml|html.erb"],
-    INI: ["ini|conf|cfg|prefs"],
-    Io: ["io"],
-    Ion: ["ion"],
-    Jack: ["jack"],
-    Jade: ["jade|pug"],
-    Java: ["java"],
-    JavaScript: ["js|jsm|jsx|cjs|mjs"],
-    JSON: ["json"],
-    JSON5: ["json5"],
-    JSONiq: ["jq"],
-    JSP: ["jsp"],
-    JSSM: ["jssm|jssm_state"],
-    JSX: ["jsx"],
-    Julia: ["jl"],
-    Kotlin: ["kt|kts"],
-    LaTeX: ["tex|latex|ltx|bib"],
-    Latte: ["latte"],
-    LESS: ["less"],
-    Liquid: ["liquid"],
-    Lisp: ["lisp"],
-    LiveScript: ["ls"],
-    Log: ["log"],
-    LogiQL: ["logic|lql"],
-    LSL: ["lsl"],
-    Lua: ["lua"],
-    LuaPage: ["lp"],
-    Lucene: ["lucene"],
-    Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
-    Markdown: ["md|markdown"],
-    Mask: ["mask"],
-    MATLAB: ["matlab"],
-    Maze: ["mz"],
-    MediaWiki: ["wiki|mediawiki"],
-    MEL: ["mel"],
-    MIPS: ["s|asm"],
-    MIXAL: ["mixal"],
-    MUSHCode: ["mc|mush"],
-    MySQL: ["mysql"],
-    Nginx: ["nginx|conf"],
-    Nim: ["nim"],
-    Nix: ["nix"],
-    NSIS: ["nsi|nsh"],
-    Nunjucks: ["nunjucks|nunjs|nj|njk"],
-    ObjectiveC: ["m|mm"],
-    OCaml: ["ml|mli"],
-    PartiQL: ["partiql|pql"],
-    Pascal: ["pas|p"],
-    Perl: ["pl|pm"],
-    pgSQL: ["pgsql"],
-    PHP_Laravel_blade: ["blade.php"],
-    PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
-    Pig: ["pig"],
-    Powershell: ["ps1"],
-    Praat: ["praat|praatscript|psc|proc"],
-    Prisma: ["prisma"],
-    Prolog: ["plg|prolog"],
-    Properties: ["properties"],
-    Protobuf: ["proto"],
-    Puppet: ["epp|pp"],
-    Python: ["py"],
-    QML: ["qml"],
-    R: ["r"],
-    Raku: ["raku|rakumod|rakutest|p6|pl6|pm6"],
-    Razor: ["cshtml|asp"],
-    RDoc: ["Rd"],
-    Red: ["red|reds"],
-    RHTML: ["Rhtml"],
-    Robot: ["robot|resource"],
-    RST: ["rst"],
-    Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
-    Rust: ["rs"],
-    SaC: ["sac"],
-    SASS: ["sass"],
-    SCAD: ["scad"],
-    Scala: ["scala|sbt"],
-    Scheme: ["scm|sm|rkt|oak|scheme"],
-    Scrypt: ["scrypt"],
-    SCSS: ["scss"],
-    SH: ["sh|bash|^.bashrc"],
-    SJS: ["sjs"],
-    Slim: ["slim|skim"],
-    Smarty: ["smarty|tpl"],
-    Smithy: ["smithy"],
-    snippets: ["snippets"],
-    Soy_Template: ["soy"],
-    Space: ["space"],
-    SQL: ["sql"],
-    SQLServer: ["sqlserver"],
-    Stylus: ["styl|stylus"],
-    SVG: ["svg"],
-    Swift: ["swift"],
-    Tcl: ["tcl"],
-    Terraform: ["tf", "tfvars", "terragrunt"],
-    Tex: ["tex"],
-    Text: ["txt"],
-    Textile: ["textile"],
-    Toml: ["toml"],
-    TSX: ["tsx"],
-    Twig: ["twig|swig"],
-    Typescript: ["ts|typescript|str"],
-    Vala: ["vala"],
-    VBScript: ["vbs|vb"],
-    Velocity: ["vm"],
-    Verilog: ["v|vh|sv|svh"],
-    VHDL: ["vhd|vhdl"],
-    Visualforce: ["vfp|component|page"],
-    Wollok: ["wlk|wpgm|wtest"],
-    XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
-    XQuery: ["xq"],
-    YAML: ["yaml|yml"],
-    Zeek: ["zeek|bro"],
-    Django: ["html"]
-};
-var nameOverrides = {
-    ObjectiveC: "Objective-C",
-    CSharp: "C#",
-    golang: "Go",
-    C_Cpp: "C and C++",
-    Csound_Document: "Csound Document",
-    Csound_Orchestra: "Csound",
-    Csound_Score: "Csound Score",
-    coffee: "CoffeeScript",
-    HTML_Ruby: "HTML (Ruby)",
-    HTML_Elixir: "HTML (Elixir)",
-    FTL: "FreeMarker",
-    PHP_Laravel_blade: "PHP (Blade Template)",
-    Perl6: "Perl 6",
-    AutoHotKey: "AutoHotkey / AutoIt"
-};
-var modesByName = {};
-for (var name in supportedModes) {
-    var data = supportedModes[name];
-    var displayName = (nameOverrides[name] || name).replace(/_/g, " ");
-    var filename = name.toLowerCase();
-    var mode = new Mode(filename, displayName, data[0]);
-    modesByName[filename] = mode;
-    modes.push(mode);
-}
-module.exports = {
-    getModeForPath: getModeForPath,
-    modes: modes,
-    modesByName: modesByName
-};
-
-});
-
-ace.define("ace/ext/themelist",["require","exports","module"], function(require, exports, module){/**
- * Generates a list of themes available when ace was built.
- * @fileOverview Generates a list of themes available when ace was built.
- * @author <a href="mailto:matthewkastor@gmail.com">
- *  Matthew Christopher Kastor-Inare III </a><br />
- *  ☭ Hial Atropa!! ☭
- */
-"use strict";
-var themeData = [
-    ["Chrome"],
-    ["Clouds"],
-    ["Crimson Editor"],
-    ["Dawn"],
-    ["Dreamweaver"],
-    ["Eclipse"],
-    ["GitHub"],
-    ["IPlastic"],
-    ["Solarized Light"],
-    ["TextMate"],
-    ["Tomorrow"],
-    ["XCode"],
-    ["Kuroir"],
-    ["KatzenMilch"],
-    ["SQL Server", "sqlserver", "light"],
-    ["Ambiance", "ambiance", "dark"],
-    ["Chaos", "chaos", "dark"],
-    ["Clouds Midnight", "clouds_midnight", "dark"],
-    ["Dracula", "", "dark"],
-    ["Cobalt", "cobalt", "dark"],
-    ["Gruvbox", "gruvbox", "dark"],
-    ["Green on Black", "gob", "dark"],
-    ["idle Fingers", "idle_fingers", "dark"],
-    ["krTheme", "kr_theme", "dark"],
-    ["Merbivore", "merbivore", "dark"],
-    ["Merbivore Soft", "merbivore_soft", "dark"],
-    ["Mono Industrial", "mono_industrial", "dark"],
-    ["Monokai", "monokai", "dark"],
-    ["Nord Dark", "nord_dark", "dark"],
-    ["One Dark", "one_dark", "dark"],
-    ["Pastel on dark", "pastel_on_dark", "dark"],
-    ["Solarized Dark", "solarized_dark", "dark"],
-    ["Terminal", "terminal", "dark"],
-    ["Tomorrow Night", "tomorrow_night", "dark"],
-    ["Tomorrow Night Blue", "tomorrow_night_blue", "dark"],
-    ["Tomorrow Night Bright", "tomorrow_night_bright", "dark"],
-    ["Tomorrow Night 80s", "tomorrow_night_eighties", "dark"],
-    ["Twilight", "twilight", "dark"],
-    ["Vibrant Ink", "vibrant_ink", "dark"]
-];
-exports.themesByName = {};
-exports.themes = themeData.map(function (data) {
-    var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
-    var theme = {
-        caption: data[0],
-        theme: "ace/theme/" + name,
-        isDark: data[2] == "dark",
-        name: name
-    };
-    exports.themesByName[name] = theme;
-    return theme;
-});
-
-});
-
-ace.define("ace/ext/options",["require","exports","module","ace/ext/menu_tools/overlay_page","ace/lib/dom","ace/lib/oop","ace/config","ace/lib/event_emitter","ace/ext/modelist","ace/ext/themelist"], function(require, exports, module){"use strict";
-require("./menu_tools/overlay_page");
-var dom = require("../lib/dom");
-var oop = require("../lib/oop");
-var config = require("../config");
-var EventEmitter = require("../lib/event_emitter").EventEmitter;
-var buildDom = dom.buildDom;
-var modelist = require("./modelist");
-var themelist = require("./themelist");
-var themes = { Bright: [], Dark: [] };
-themelist.themes.forEach(function (x) {
-    themes[x.isDark ? "Dark" : "Bright"].push({ caption: x.caption, value: x.theme });
-});
-var modes = modelist.modes.map(function (x) {
-    return { caption: x.caption, value: x.mode };
-});
-var optionGroups = {
-    Main: {
-        Mode: {
-            path: "mode",
-            type: "select",
-            items: modes
-        },
-        Theme: {
-            path: "theme",
-            type: "select",
-            items: themes
-        },
-        "Keybinding": {
-            type: "buttonBar",
-            path: "keyboardHandler",
-            items: [
-                { caption: "Ace", value: null },
-                { caption: "Vim", value: "ace/keyboard/vim" },
-                { caption: "Emacs", value: "ace/keyboard/emacs" },
-                { caption: "Sublime", value: "ace/keyboard/sublime" },
-                { caption: "VSCode", value: "ace/keyboard/vscode" }
-            ]
-        },
-        "Font Size": {
-            path: "fontSize",
-            type: "number",
-            defaultValue: 12,
-            defaults: [
-                { caption: "12px", value: 12 },
-                { caption: "24px", value: 24 }
-            ]
-        },
-        "Soft Wrap": {
-            type: "buttonBar",
-            path: "wrap",
-            items: [
-                { caption: "Off", value: "off" },
-                { caption: "View", value: "free" },
-                { caption: "margin", value: "printMargin" },
-                { caption: "40", value: "40" }
-            ]
-        },
-        "Cursor Style": {
-            path: "cursorStyle",
-            items: [
-                { caption: "Ace", value: "ace" },
-                { caption: "Slim", value: "slim" },
-                { caption: "Smooth", value: "smooth" },
-                { caption: "Smooth And Slim", value: "smooth slim" },
-                { caption: "Wide", value: "wide" }
-            ]
-        },
-        "Folding": {
-            path: "foldStyle",
-            items: [
-                { caption: "Manual", value: "manual" },
-                { caption: "Mark begin", value: "markbegin" },
-                { caption: "Mark begin and end", value: "markbeginend" }
-            ]
-        },
-        "Soft Tabs": [{
-                path: "useSoftTabs"
-            }, {
-                ariaLabel: "Tab Size",
-                path: "tabSize",
-                type: "number",
-                values: [2, 3, 4, 8, 16]
-            }],
-        "Overscroll": {
-            type: "buttonBar",
-            path: "scrollPastEnd",
-            items: [
-                { caption: "None", value: 0 },
-                { caption: "Half", value: 0.5 },
-                { caption: "Full", value: 1 }
-            ]
-        }
-    },
-    More: {
-        "Atomic soft tabs": {
-            path: "navigateWithinSoftTabs"
-        },
-        "Enable Behaviours": {
-            path: "behavioursEnabled"
-        },
-        "Wrap with quotes": {
-            path: "wrapBehavioursEnabled"
-        },
-        "Enable Auto Indent": {
-            path: "enableAutoIndent"
-        },
-        "Full Line Selection": {
-            type: "checkbox",
-            values: "text|line",
-            path: "selectionStyle"
-        },
-        "Highlight Active Line": {
-            path: "highlightActiveLine"
-        },
-        "Show Invisibles": {
-            path: "showInvisibles"
-        },
-        "Show Indent Guides": {
-            path: "displayIndentGuides"
-        },
-        "Highlight Indent Guides": {
-            path: "highlightIndentGuides"
-        },
-        "Persistent HScrollbar": {
-            path: "hScrollBarAlwaysVisible"
-        },
-        "Persistent VScrollbar": {
-            path: "vScrollBarAlwaysVisible"
-        },
-        "Animate scrolling": {
-            path: "animatedScroll"
-        },
-        "Show Gutter": {
-            path: "showGutter"
-        },
-        "Show Line Numbers": {
-            path: "showLineNumbers"
-        },
-        "Relative Line Numbers": {
-            path: "relativeLineNumbers"
-        },
-        "Fixed Gutter Width": {
-            path: "fixedWidthGutter"
-        },
-        "Show Print Margin": [{
-                path: "showPrintMargin"
-            }, {
-                ariaLabel: "Print Margin",
-                type: "number",
-                path: "printMarginColumn"
-            }],
-        "Indented Soft Wrap": {
-            path: "indentedSoftWrap"
-        },
-        "Highlight selected word": {
-            path: "highlightSelectedWord"
-        },
-        "Fade Fold Widgets": {
-            path: "fadeFoldWidgets"
-        },
-        "Use textarea for IME": {
-            path: "useTextareaForIME"
-        },
-        "Merge Undo Deltas": {
-            path: "mergeUndoDeltas",
-            items: [
-                { caption: "Always", value: "always" },
-                { caption: "Never", value: "false" },
-                { caption: "Timed", value: "true" }
-            ]
-        },
-        "Elastic Tabstops": {
-            path: "useElasticTabstops"
-        },
-        "Incremental Search": {
-            path: "useIncrementalSearch"
-        },
-        "Read-only": {
-            path: "readOnly"
-        },
-        "Copy without selection": {
-            path: "copyWithEmptySelection"
-        },
-        "Live Autocompletion": {
-            path: "enableLiveAutocompletion"
-        }
-    }
-};
-var OptionPanel = function (editor, element) {
-    this.editor = editor;
-    this.container = element || document.createElement("div");
-    this.groups = [];
-    this.options = {};
-};
-(function () {
-    oop.implement(this, EventEmitter);
-    this.add = function (config) {
-        if (config.Main)
-            oop.mixin(optionGroups.Main, config.Main);
-        if (config.More)
-            oop.mixin(optionGroups.More, config.More);
-    };
-    this.render = function () {
-        this.container.innerHTML = "";
-        buildDom(["table", { role: "presentation", id: "controls" },
-            this.renderOptionGroup(optionGroups.Main),
-            ["tr", null, ["td", { colspan: 2 },
-                    ["table", { role: "presentation", id: "more-controls" },
-                        this.renderOptionGroup(optionGroups.More)
-                    ]
-                ]],
-            ["tr", null, ["td", { colspan: 2 }, "version " + config.version]]
-        ], this.container);
-    };
-    this.renderOptionGroup = function (group) {
-        return Object.keys(group).map(function (key, i) {
-            var item = group[key];
-            if (!item.position)
-                item.position = i / 10000;
-            if (!item.label)
-                item.label = key;
-            return item;
-        }).sort(function (a, b) {
-            return a.position - b.position;
-        }).map(function (item) {
-            return this.renderOption(item.label, item);
-        }, this);
-    };
-    this.renderOptionControl = function (key, option) {
-        var self = this;
-        if (Array.isArray(option)) {
-            return option.map(function (x) {
-                return self.renderOptionControl(key, x);
-            });
-        }
-        var control;
-        var value = self.getOption(option);
-        if (option.values && option.type != "checkbox") {
-            if (typeof option.values == "string")
-                option.values = option.values.split("|");
-            option.items = option.values.map(function (v) {
-                return { value: v, name: v };
-            });
-        }
-        if (option.type == "buttonBar") {
-            control = ["div", { role: "group", "aria-labelledby": option.path + "-label" }, option.items.map(function (item) {
-                    return ["button", {
-                            value: item.value,
-                            ace_selected_button: value == item.value,
-                            'aria-pressed': value == item.value,
-                            onclick: function () {
-                                self.setOption(option, item.value);
-                                var nodes = this.parentNode.querySelectorAll("[ace_selected_button]");
-                                for (var i = 0; i < nodes.length; i++) {
-                                    nodes[i].removeAttribute("ace_selected_button");
-                                    nodes[i].setAttribute("aria-pressed", false);
-                                }
-                                this.setAttribute("ace_selected_button", true);
-                                this.setAttribute("aria-pressed", true);
-                            }
-                        }, item.desc || item.caption || item.name];
-                })];
-        }
-        else if (option.type == "number") {
-            control = ["input", { type: "number", value: value || option.defaultValue, style: "width:3em", oninput: function () {
-                        self.setOption(option, parseInt(this.value));
-                    } }];
-            if (option.ariaLabel) {
-                control[1]["aria-label"] = option.ariaLabel;
-            }
-            else {
-                control[1].id = key;
-            }
-            if (option.defaults) {
-                control = [control, option.defaults.map(function (item) {
-                        return ["button", { onclick: function () {
-                                    var input = this.parentNode.firstChild;
-                                    input.value = item.value;
-                                    input.oninput();
-                                } }, item.caption];
-                    })];
-            }
-        }
-        else if (option.items) {
-            var buildItems = function (items) {
-                return items.map(function (item) {
-                    return ["option", { value: item.value || item.name }, item.desc || item.caption || item.name];
-                });
-            };
-            var items = Array.isArray(option.items)
-                ? buildItems(option.items)
-                : Object.keys(option.items).map(function (key) {
-                    return ["optgroup", { "label": key }, buildItems(option.items[key])];
-                });
-            control = ["select", { id: key, value: value, onchange: function () {
-                        self.setOption(option, this.value);
-                    } }, items];
-        }
-        else {
-            if (typeof option.values == "string")
-                option.values = option.values.split("|");
-            if (option.values)
-                value = value == option.values[1];
-            control = ["input", { type: "checkbox", id: key, checked: value || null, onchange: function () {
-                        var value = this.checked;
-                        if (option.values)
-                            value = option.values[value ? 1 : 0];
-                        self.setOption(option, value);
-                    } }];
-            if (option.type == "checkedNumber") {
-                control = [control, []];
-            }
-        }
-        return control;
-    };
-    this.renderOption = function (key, option) {
-        if (option.path && !option.onchange && !this.editor.$options[option.path])
-            return;
-        var path = Array.isArray(option) ? option[0].path : option.path;
-        this.options[path] = option;
-        var safeKey = "-" + path;
-        var safeId = path + "-label";
-        var control = this.renderOptionControl(safeKey, option);
-        return ["tr", { class: "ace_optionsMenuEntry" }, ["td",
-                ["label", { for: safeKey, id: safeId }, key]
-            ], ["td", control]];
-    };
-    this.setOption = function (option, value) {
-        if (typeof option == "string")
-            option = this.options[option];
-        if (value == "false")
-            value = false;
-        if (value == "true")
-            value = true;
-        if (value == "null")
-            value = null;
-        if (value == "undefined")
-            value = undefined;
-        if (typeof value == "string" && parseFloat(value).toString() == value)
-            value = parseFloat(value);
-        if (option.onchange)
-            option.onchange(value);
-        else if (option.path)
-            this.editor.setOption(option.path, value);
-        this._signal("setOption", { name: option.path, value: value });
-    };
-    this.getOption = function (option) {
-        if (option.getValue)
-            return option.getValue();
-        return this.editor.getOption(option.path);
-    };
-}).call(OptionPanel.prototype);
-exports.OptionPanel = OptionPanel;
-
-});
-
-ace.define("ace/ext/settings_menu",["require","exports","module","ace/ext/options","ace/ext/menu_tools/overlay_page","ace/editor"], function(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
-"use strict";
-var OptionPanel = require("./options").OptionPanel;
-var overlayPage = require('./menu_tools/overlay_page').overlayPage;
-function showSettingsMenu(editor) {
-    if (!document.getElementById('ace_settingsmenu')) {
-        var options = new OptionPanel(editor);
-        options.render();
-        options.container.id = "ace_settingsmenu";
-        overlayPage(editor, options.container);
-        options.container.querySelector("select,input,button,checkbox").focus();
-    }
-}
-module.exports.init = function () {
-    var Editor = require("../editor").Editor;
-    Editor.prototype.showSettingsMenu = function () {
-        showSettingsMenu(this);
-    };
-};
-
-});                (function() {
-                    ace.require(["ace/ext/settings_menu"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 0 - 524
web/082d72cee51411d39d52d3f0e06eca3b.js

@@ -1,524 +0,0 @@
-ace.define("ace/mode/raku_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var RakuHighlightRules = function () {
-    var keywords = ("my|our|class|role|grammar|is|does|sub|method|submethod|try|" +
-        "default|when|if|elsif|else|unless|with|orwith|without|for|given|proceed|" +
-        "succeed|loop|while|until|repeat|module|use|need|import|require|unit|" +
-        "constant|enum|multi|return|has|token|rule|make|made|proto|state|augment|" +
-        "but|anon|supersede|let|subset|gather|returns|return-rw|temp|" +
-        "BEGIN|CHECK|INIT|END|CLOSE|ENTER|LEAVE|KEEP|UNDO|PRE|POST|FIRST|NEXT|LAST|CATCH|CONTROL|QUIT|DOC");
-    var types = ("Any|Array|Associative|AST|atomicint|Attribute|Backtrace|Backtrace::Frame|" +
-        "Bag|Baggy|BagHash|Blob|Block|Bool|Buf|Callable|CallFrame|Cancellation|" +
-        "Capture|Channel|Code|compiler|Complex|ComplexStr|Cool|CurrentThreadScheduler|" +
-        "Cursor|Date|Dateish|DateTime|Distro|Duration|Encoding|Exception|Failure|" +
-        "FatRat|Grammar|Hash|HyperWhatever|Instant|Int|IntStr|IO|IO::ArgFiles|" +
-        "IO::CatHandle|IO::Handle|IO::Notification|IO::Path|IO::Path::Cygwin|" +
-        "IO::Path::QNX|IO::Path::Unix|IO::Path::Win32|IO::Pipe|IO::Socket|" +
-        "IO::Socket::Async|IO::Socket::INET|IO::Spec|IO::Spec::Cygwin|IO::Spec::QNX|" +
-        "IO::Spec::Unix|IO::Spec::Win32|IO::Special|Iterable|Iterator|Junction|Kernel|" +
-        "Label|List|Lock|Lock::Async|Macro|Map|Match|Metamodel::AttributeContainer|" +
-        "Metamodel::C3MRO|Metamodel::ClassHOW|Metamodel::EnumHOW|Metamodel::Finalization|" +
-        "Metamodel::MethodContainer|Metamodel::MROBasedMethodDispatch|Metamodel::MultipleInheritance|" +
-        "Metamodel::Naming|Metamodel::Primitives|Metamodel::PrivateMethodContainer|" +
-        "Metamodel::RoleContainer|Metamodel::Trusting|Method|Mix|MixHash|Mixy|Mu|" +
-        "NFC|NFD|NFKC|NFKD|Nil|Num|Numeric|NumStr|ObjAt|Order|Pair|Parameter|Perl|" +
-        "Pod::Block|Pod::Block::Code|Pod::Block::Comment|Pod::Block::Declarator|" +
-        "Pod::Block::Named|Pod::Block::Para|Pod::Block::Table|Pod::Heading|Pod::Item|" +
-        "Positional|PositionalBindFailover|Proc|Proc::Async|Promise|Proxy|PseudoStash|" +
-        "Raku|QuantHash|Range|Rat|Rational|RatStr|Real|Regex|Routine|Scalar|Scheduler|" +
-        "Semaphore|Seq|Set|SetHash|Setty|Signature|Slip|Stash|Str|StrDistance|Stringy|" +
-        "Sub|Submethod|Supplier|Supplier::Preserving|Supply|Systemic|Tap|Telemetry|" +
-        "Telemetry::Instrument::Thread|Telemetry::Instrument::Usage|Telemetry::Period|" +
-        "Telemetry::Sampler|Thread|ThreadPoolScheduler|UInt|Uni|utf8|Variable|Version|" +
-        "VM|Whatever|WhateverCode|WrapHandle|int|uint|num|str|" +
-        "int8|int16|int32|int64|uint8|uint16|uint32|uint64|long|longlong|num32|num64|size_t|bool|CArray|Pointer|" +
-        "Backtrace|Backtrace::Frame|Exception|Failure|X::AdHoc|X::Anon::Augment|X::Anon::Multi|" +
-        "X::Assignment::RO|X::Attribute::NoPackage|X::Attribute::Package|X::Attribute::Undeclared|" +
-        "X::Augment::NoSuchType|X::Bind|X::Bind::NativeType|X::Bind::Slice|X::Caller::NotDynamic|" +
-        "X::Channel::ReceiveOnClosed|X::Channel::SendOnClosed|X::Comp|X::Composition::NotComposable|" +
-        "X::Constructor::Positional|X::ControlFlow|X::ControlFlow::Return|X::DateTime::TimezoneClash|" +
-        "X::Declaration::Scope|X::Declaration::Scope::Multi|X::Does::TypeObject|X::Eval::NoSuchLang|" +
-        "X::Export::NameClash|X::IO|X::IO::Chdir|X::IO::Chmod|X::IO::Copy|X::IO::Cwd|X::IO::Dir|" +
-        "X::IO::DoesNotExist|X::IO::Link|X::IO::Mkdir|X::IO::Move|X::IO::Rename|X::IO::Rmdir|X::IO::Symlink|" +
-        "X::IO::Unlink|X::Inheritance::NotComposed|X::Inheritance::Unsupported|X::Method::InvalidQualifier|" +
-        "X::Method::NotFound|X::Method::Private::Permission|X::Method::Private::Unqualified|" +
-        "X::Mixin::NotComposable|X::NYI|X::NoDispatcher|X::Numeric::Real|X::OS|X::Obsolete|X::OutOfRange|" +
-        "X::Package::Stubbed|X::Parameter::Default|X::Parameter::MultipleTypeConstraints|" +
-        "X::Parameter::Placeholder|X::Parameter::Twigil|X::Parameter::WrongOrder|X::Phaser::Multiple|" +
-        "X::Phaser::PrePost|X::Placeholder::Block|X::Placeholder::Mainline|X::Pod|X::Proc::Async|" +
-        "X::Proc::Async::AlreadyStarted|X::Proc::Async::CharsOrBytes|X::Proc::Async::MustBeStarted|" +
-        "X::Proc::Async::OpenForWriting|X::Proc::Async::TapBeforeSpawn|X::Proc::Unsuccessful|" +
-        "X::Promise::CauseOnlyValidOnBroken|X::Promise::Vowed|X::Redeclaration|X::Role::Initialization|" +
-        "X::Seq::Consumed|X::Sequence::Deduction|X::Signature::NameClash|X::Signature::Placeholder|" +
-        "X::Str::Numeric|X::StubCode|X::Syntax|X::Syntax::Augment::WithoutMonkeyTyping|" +
-        "X::Syntax::Comment::Embedded|X::Syntax::Confused|X::Syntax::InfixInTermPosition|" +
-        "X::Syntax::Malformed|X::Syntax::Missing|X::Syntax::NegatedPair|X::Syntax::NoSelf|" +
-        "X::Syntax::Number::RadixOutOfRange|X::Syntax::P5|X::Syntax::Regex::Adverb|" +
-        "X::Syntax::Regex::SolitaryQuantifier|X::Syntax::Reserved|X::Syntax::Self::WithoutObject|" +
-        "X::Syntax::Signature::InvocantMarker|X::Syntax::Term::MissingInitializer|X::Syntax::UnlessElse|" +
-        "X::Syntax::Variable::Match|X::Syntax::Variable::Numeric|X::Syntax::Variable::Twigil|X::Temporal|" +
-        "X::Temporal::InvalidFormat|X::TypeCheck|X::TypeCheck::Assignment|X::TypeCheck::Binding|" +
-        "X::TypeCheck::Return|X::TypeCheck::Splice|X::Undeclared");
-    var builtinFunctions = ("abs|abs2rel|absolute|accept|ACCEPTS|accessed|acos|acosec|acosech|acosh|" +
-        "acotan|acotanh|acquire|act|action|actions|add|add_attribute|add_enum_value|" +
-        "add_fallback|add_method|add_parent|add_private_method|add_role|add_trustee|" +
-        "adverb|after|all|allocate|allof|allowed|alternative-names|annotations|antipair|" +
-        "antipairs|any|anyof|app_lifetime|append|arch|archname|args|arity|asec|asech|" +
-        "asin|asinh|ASSIGN-KEY|ASSIGN-POS|assuming|ast|at|atan|atan2|atanh|AT-KEY|" +
-        "atomic-assign|atomic-dec-fetch|atomic-fetch|atomic-fetch-add|atomic-fetch-dec|" +
-        "atomic-fetch-inc|atomic-fetch-sub|atomic-inc-fetch|AT-POS|attributes|auth|await|" +
-        "backtrace|Bag|BagHash|base|basename|base-repeating|batch|BIND-KEY|BIND-POS|" +
-        "bind-stderr|bind-stdin|bind-stdout|bind-udp|bits|bless|block|bool-only|" +
-        "bounds|break|Bridge|broken|BUILD|build-date|bytes|cache|callframe|calling-package|" +
-        "CALL-ME|callsame|callwith|can|cancel|candidates|cando|canonpath|caps|caption|" +
-        "Capture|cas|catdir|categorize|categorize-list|catfile|catpath|cause|ceiling|" +
-        "cglobal|changed|Channel|chars|chdir|child|child-name|child-typename|chmod|chomp|" +
-        "chop|chr|chrs|chunks|cis|classify|classify-list|cleanup|clone|close|closed|" +
-        "close-stdin|code|codes|collate|column|comb|combinations|command|comment|" +
-        "compiler|Complex|compose|compose_type|composer|condition|config|configure_destroy|" +
-        "configure_type_checking|conj|connect|constraints|construct|contains|contents|copy|" +
-        "cos|cosec|cosech|cosh|cotan|cotanh|count|count-only|cpu-cores|cpu-usage|CREATE|" +
-        "create_type|cross|cue|curdir|curupdir|d|Date|DateTime|day|daycount|day-of-month|" +
-        "day-of-week|day-of-year|days-in-month|declaration|decode|decoder|deepmap|" +
-        "defined|DEFINITE|delayed|DELETE-KEY|DELETE-POS|denominator|desc|DESTROY|destroyers|" +
-        "devnull|did-you-mean|die|dir|dirname|dir-sep|DISTROnames|do|done|duckmap|dynamic|" +
-        "e|eager|earlier|elems|emit|enclosing|encode|encoder|encoding|end|ends-with|enum_from_value|" +
-        "enum_value_list|enum_values|enums|eof|EVAL|EVALFILE|exception|excludes-max|excludes-min|" +
-        "EXISTS-KEY|EXISTS-POS|exit|exitcode|exp|expected|explicitly-manage|expmod|extension|f|" +
-        "fail|fc|feature|file|filename|find_method|find_method_qualified|finish|first|flat|flatmap|" +
-        "flip|floor|flush|fmt|format|formatter|freeze|from|from-list|from-loop|from-posix|full|" +
-        "full-barrier|get|get_value|getc|gist|got|grab|grabpairs|grep|handle|handled|handles|" +
-        "hardware|has_accessor|head|headers|hh-mm-ss|hidden|hides|hour|how|hyper|id|illegal|" +
-        "im|in|indent|index|indices|indir|infinite|infix|install_method_cache|" +
-        "Instant|instead|int-bounds|interval|in-timezone|invalid-str|invert|invocant|IO|" +
-        "IO::Notification.watch-path|is_trusted|is_type|isa|is-absolute|is-hidden|is-initial-thread|" +
-        "is-int|is-lazy|is-leap-year|isNaN|is-prime|is-relative|is-routine|is-setting|is-win|item|" +
-        "iterator|join|keep|kept|KERNELnames|key|keyof|keys|kill|kv|kxxv|l|lang|last|lastcall|later|" +
-        "lazy|lc|leading|level|line|lines|link|listen|live|local|lock|log|log10|lookup|lsb|" +
-        "MAIN|match|max|maxpairs|merge|message|method_table|methods|migrate|min|minmax|" +
-        "minpairs|minute|misplaced|Mix|MixHash|mkdir|mode|modified|month|move|mro|msb|multiness|" +
-        "name|named|named_names|narrow|nativecast|native-descriptor|nativesizeof|new|new_type|" +
-        "new-from-daycount|new-from-pairs|next|nextcallee|next-handle|nextsame|nextwith|NFC|NFD|" +
-        "NFKC|NFKD|nl-in|nl-out|nodemap|none|norm|not|note|now|nude|numerator|Numeric|of|" +
-        "offset|offset-in-hours|offset-in-minutes|old|on-close|one|on-switch|open|opened|" +
-        "operation|optional|ord|ords|orig|os-error|osname|out-buffer|pack|package|package-kind|" +
-        "package-name|packages|pair|pairs|pairup|parameter|params|parent|parent-name|parents|parse|" +
-        "parse-base|parsefile|parse-names|parts|path|path-sep|payload|peer-host|peer-port|periods|" +
-        "perl|permutations|phaser|pick|pickpairs|pid|placeholder|plus|polar|poll|polymod|pop|pos|" +
-        "positional|posix|postfix|postmatch|precomp-ext|precomp-target|pred|prefix|prematch|prepend|" +
-        "print|printf|print-nl|print-to|private|private_method_table|proc|produce|Promise|prompt|" +
-        "protect|pull-one|push|push-all|push-at-least|push-exactly|push-until-lazy|put|" +
-        "qualifier-type|quit|r|race|radix|raku|rand|range|raw|re|read|readchars|readonly|" +
-        "ready|Real|reallocate|reals|reason|rebless|receive|recv|redispatcher|redo|reduce|" +
-        "rel2abs|relative|release|rename|repeated|replacement|report|reserved|resolve|" +
-        "restore|result|resume|rethrow|reverse|right|rindex|rmdir|roles_to_compose|" +
-        "rolish|roll|rootdir|roots|rotate|rotor|round|roundrobin|routine-type|run|rwx|s|" +
-        "samecase|samemark|samewith|say|schedule-on|scheduler|scope|sec|sech|second|seek|" +
-        "self|send|Set|set_hidden|set_name|set_package|set_rw|set_value|SetHash|" +
-        "set-instruments|setup_finalization|shape|share|shell|shift|sibling|sigil|" +
-        "sign|signal|signals|signature|sin|sinh|sink|sink-all|skip|skip-at-least|" +
-        "skip-at-least-pull-one|skip-one|sleep|sleep-timer|sleep-until|Slip|slurp|" +
-        "slurp-rest|slurpy|snap|snapper|so|socket-host|socket-port|sort|source|" +
-        "source-package|spawn|SPEC|splice|split|splitdir|splitpath|sprintf|spurt|" +
-        "sqrt|squish|srand|stable|start|started|starts-with|status|stderr|stdout|" +
-        "sub_signature|subbuf|subbuf-rw|subname|subparse|subst|subst-mutate|" +
-        "substr|substr-eq|substr-rw|succ|sum|Supply|symlink|t|tail|take|take-rw|" +
-        "tan|tanh|tap|target|target-name|tc|tclc|tell|then|throttle|throw|timezone|" +
-        "tmpdir|to|today|toggle|to-posix|total|trailing|trans|tree|trim|trim-leading|" +
-        "trim-trailing|truncate|truncated-to|trusts|try_acquire|trying|twigil|type|" +
-        "type_captures|typename|uc|udp|uncaught_handler|unimatch|uniname|uninames|" +
-        "uniparse|uniprop|uniprops|unique|unival|univals|unlink|unlock|unpack|unpolar|" +
-        "unshift|unwrap|updir|USAGE|utc|val|value|values|VAR|variable|verbose-config|" +
-        "version|VMnames|volume|vow|w|wait|warn|watch|watch-path|week|weekday-of-month|" +
-        "week-number|week-year|WHAT|WHERE|WHEREFORE|WHICH|WHO|whole-second|WHY|" +
-        "wordcase|words|workaround|wrap|write|write-to|yada|year|yield|yyyy-mm-dd|" +
-        "z|zip|zip-latest|" +
-        "plan|done-testing|bail-out|todo|skip|skip-rest|diag|subtest|pass|flunk|ok|" +
-        "nok|cmp-ok|is-deeply|isnt|is-approx|like|unlike|use-ok|isa-ok|does-ok|" +
-        "can-ok|dies-ok|lives-ok|eval-dies-ok|eval-lives-ok|throws-like|fails-like|" +
-        "rw|required|native|repr|export|symbol");
-    var constants_ascii = ("pi|Inf|tau|time");
-    var ops_txt = ("eq|ne|gt|lt|le|ge|div|gcd|lcm|leg|cmp|ff|fff|" +
-        "x|before|after|Z|X|and|or|andthen|notandthen|orelse|xor");
-    var keywordMapper = this.createKeywordMapper({
-        "keyword": keywords,
-        "storage.type": types,
-        "constant.language": constants_ascii,
-        "support.function": builtinFunctions,
-        "keyword.operator": ops_txt
-    }, "identifier");
-    var moduleName = "[a-zA-Z_][a-zA-Z_0-9:-]*\\b";
-    var hex = { token: "constant.numeric", regex: "0x[0-9a-fA-F]+\\b" };
-    var num_rat = { token: "constant.numeric", regex: "[+-.]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" };
-    var num_with_ = { token: "constant.numeric", regex: "(?:\\d+_?\\d+)+\\b" };
-    var complex_numbers = { token: "constant.numeric", regex: "\\+?\\d+i\\b" };
-    var booleans = { token: "constant.language.boolean", regex: "(?:True|False)\\b" };
-    var versions = { token: "constant.other", regex: "v[0-9](?:\\.[a-zA-Z0-9*])*\\b" };
-    var lang_keywords = { token: keywordMapper, regex: "[a-zA-Z][\\:a-zA-Z0-9_-]*\\b" };
-    var variables = { token: "variable.language", regex: "[$@%&][?*!.]?[a-zA-Z0-9_-]+\\b" };
-    var vars_special = { token: "variable.language", regex: "\\$[/|!]?|@\\$/" };
-    var ops_char = { token: "keyword.operator", regex: "=|<|>|\\+|\\*|-|/|~|%|\\?|!|\\^|\\.|\\:|\\,|" +
-            "»|«|\\||\\&|⚛|∘" };
-    var constants_unicode = { token: "constant.language", regex: "𝑒|π|τ|∞" };
-    var qstrings = { token: "string.quoted.single", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" };
-    var word_quoting = { token: "string.quoted.single", regex: "[<](?:[a-zA-Z0-9 ])*[>]" };
-    var regexp = {
-        token: "string.regexp",
-        regex: "[m|rx]?[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
-    };
-    this.$rules = {
-        "start": [
-            {
-                token: "comment.block",
-                regex: "#[`|=]\\(.*\\)"
-            }, {
-                token: "comment.block",
-                regex: "#[`|=]\\[.*\\]"
-            }, {
-                token: "comment.doc",
-                regex: "^=(?:begin)\\b",
-                next: "block_comment"
-            }, {
-                token: "string.unquoted",
-                regex: "q[x|w]?\\:to/END/;",
-                next: "qheredoc"
-            }, {
-                token: "string.unquoted",
-                regex: "qq[x|w]?\\:to/END/;",
-                next: "qqheredoc"
-            },
-            regexp,
-            qstrings,
-            {
-                token: "string.quoted.double",
-                regex: '"',
-                next: "qqstring"
-            },
-            word_quoting,
-            {
-                token: ["keyword", "text", "variable.module"],
-                regex: "(use)(\\s+)((?:" + moduleName + "\\.?)*)"
-            },
-            hex,
-            num_rat,
-            num_with_,
-            complex_numbers,
-            booleans,
-            versions,
-            lang_keywords,
-            variables,
-            vars_special,
-            ops_char,
-            constants_unicode,
-            {
-                token: "comment",
-                regex: "#.*$"
-            }, {
-                token: "lparen",
-                regex: "[[({]"
-            }, {
-                token: "rparen",
-                regex: "[\\])}]"
-            }, {
-                token: "text",
-                regex: "\\s+"
-            }
-        ],
-        "qqstring": [
-            {
-                token: "constant.language.escape",
-                regex: '\\\\(?:[nrtef\\\\"$]|[0-7]{1,3}|x[0-9A-Fa-f]{1,2})'
-            },
-            variables,
-            vars_special,
-            {
-                token: "lparen",
-                regex: "{",
-                next: "qqinterpolation"
-            }, {
-                token: "string.quoted.double",
-                regex: '"',
-                next: "start"
-            }, {
-                defaultToken: "string.quoted.double"
-            }
-        ],
-        "qqinterpolation": [
-            hex,
-            num_rat,
-            num_with_,
-            complex_numbers,
-            booleans,
-            versions,
-            lang_keywords,
-            variables,
-            vars_special,
-            ops_char,
-            constants_unicode,
-            qstrings,
-            regexp,
-            {
-                token: "rparen",
-                regex: "}",
-                next: "qqstring"
-            }
-        ],
-        "block_comment": [
-            {
-                token: "comment.doc",
-                regex: "^=end +[a-zA-Z_0-9]*",
-                next: "start"
-            },
-            {
-                defaultToken: "comment.doc"
-            }
-        ],
-        "qheredoc": [
-            {
-                token: "string.unquoted",
-                regex: "END$",
-                next: "start"
-            }, {
-                defaultToken: "string.unquoted"
-            }
-        ],
-        "qqheredoc": [
-            variables,
-            vars_special,
-            {
-                token: "lparen",
-                regex: "{",
-                next: "qqheredocinterpolation"
-            }, {
-                token: "string.unquoted",
-                regex: "END$",
-                next: "start"
-            }, {
-                defaultToken: "string.unquoted"
-            }
-        ],
-        "qqheredocinterpolation": [
-            hex,
-            num_rat,
-            num_with_,
-            complex_numbers,
-            booleans,
-            versions,
-            lang_keywords,
-            variables,
-            vars_special,
-            ops_char,
-            constants_unicode,
-            qstrings,
-            regexp,
-            {
-                token: "rparen",
-                regex: "}",
-                next: "qqheredoc"
-            }
-        ]
-    };
-};
-oop.inherits(RakuHighlightRules, TextHighlightRules);
-exports.RakuHighlightRules = RakuHighlightRules;
-
-});
-
-ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
-var Range = require("../range").Range;
-var MatchingBraceOutdent = function () { };
-(function () {
-    this.checkOutdent = function (line, input) {
-        if (!/^\s+$/.test(line))
-            return false;
-        return /^\s*\}/.test(input);
-    };
-    this.autoOutdent = function (doc, row) {
-        var line = doc.getLine(row);
-        var match = line.match(/^(\s*\})/);
-        if (!match)
-            return 0;
-        var column = match[1].length;
-        var openBracePos = doc.findMatchingBracket({ row: row, column: column });
-        if (!openBracePos || openBracePos.row == row)
-            return 0;
-        var indent = this.$getIndent(doc.getLine(openBracePos.row));
-        doc.replace(new Range(row, 0, row, column - 1), indent);
-    };
-    this.$getIndent = function (line) {
-        return line.match(/^\s*/)[0];
-    };
-}).call(MatchingBraceOutdent.prototype);
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
-
-});
-
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
-    if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
-    }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
-    this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
-    this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
-    this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
-    this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
-        var line = session.getLine(row);
-        if (this.singleLineBlockCommentRe.test(line)) {
-            if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
-                return "";
-        }
-        var fw = this._getFoldWidgetBase(session, foldStyle, row);
-        if (!fw && this.startRegionRe.test(line))
-            return "start"; // lineCommentRegionStart
-        return fw;
-    };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
-        var line = session.getLine(row);
-        if (this.startRegionRe.test(line))
-            return this.getCommentRegionBlock(session, line, row);
-        var match = line.match(this.foldingStartMarker);
-        if (match) {
-            var i = match.index;
-            if (match[1])
-                return this.openingBracketBlock(session, match[1], row, i);
-            var range = session.getCommentFoldRange(row, i + match[0].length, 1);
-            if (range && !range.isMultiLine()) {
-                if (forceMultiline) {
-                    range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
-                    range = null;
-            }
-            return range;
-        }
-        if (foldStyle === "markbegin")
-            return;
-        var match = line.match(this.foldingStopMarker);
-        if (match) {
-            var i = match.index + match[0].length;
-            if (match[1])
-                return this.closingBracketBlock(session, match[1], row, i);
-            return session.getCommentFoldRange(row, i, -1);
-        }
-    };
-    this.getSectionRange = function (session, row) {
-        var line = session.getLine(row);
-        var startIndent = line.search(/\S/);
-        var startRow = row;
-        var startColumn = line.length;
-        row = row + 1;
-        var endRow = row;
-        var maxRow = session.getLength();
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var indent = line.search(/\S/);
-            if (indent === -1)
-                continue;
-            if (startIndent > indent)
-                break;
-            var subRange = this.getFoldWidgetRange(session, "all", row);
-            if (subRange) {
-                if (subRange.start.row <= startRow) {
-                    break;
-                }
-                else if (subRange.isMultiLine()) {
-                    row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
-                    break;
-                }
-            }
-            endRow = row;
-        }
-        return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
-    };
-    this.getCommentRegionBlock = function (session, line, row) {
-        var startColumn = line.search(/\s*$/);
-        var maxRow = session.getLength();
-        var startRow = row;
-        var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
-        var depth = 1;
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
-        }
-        var endRow = row;
-        if (endRow > startRow) {
-            return new Range(startRow, startColumn, endRow, line.length);
-        }
-    };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/raku",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/raku_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var RakuHighlightRules = require("./raku_highlight_rules").RakuHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
-    this.HighlightRules = RakuHighlightRules;
-    this.$outdent = new MatchingBraceOutdent();
-    this.foldingRules = new CStyleFoldMode({ start: "^=(begin)\\b", end: "^=(end)\\b" });
-    this.$behaviour = this.$defaultBehaviour;
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.lineCommentStart = "#";
-    this.blockComment = [
-        { start: "=begin", end: "=end", lineStartOnly: true },
-        { start: "=item", end: "=end", lineStartOnly: true }
-    ];
-    this.getNextLineIndent = function (state, line, tab) {
-        var indent = this.$getIndent(line);
-        var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
-        var tokens = tokenizedLine.tokens;
-        if (tokens.length && tokens[tokens.length - 1].type == "comment") {
-            return indent;
-        }
-        if (state == "start") {
-            var match = line.match(/^.*[\{\(\[:]\s*$/);
-            if (match) {
-                indent += tab;
-            }
-        }
-        return indent;
-    };
-    this.checkOutdent = function (state, line, input) {
-        return this.$outdent.checkOutdent(line, input);
-    };
-    this.autoOutdent = function (state, doc, row) {
-        this.$outdent.autoOutdent(doc, row);
-    };
-    this.$id = "ace/mode/raku";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});                (function() {
-                    ace.require(["ace/mode/raku"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 23 - 0
web/0870bcf868f8d64dc9a6226a6c8b341d.js

@@ -0,0 +1,23 @@
+ace.define("ace/snippets/snippets",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+exports.snippetText = "# snippets for making snippets :)\n\
+snippet snip\n\
+	snippet ${1:trigger}\n\
+		${2}\n\
+snippet msnip\n\
+	snippet ${1:trigger} ${2:description}\n\
+		${3}\n\
+snippet v\n\
+	{VISUAL}\n\
+";
+exports.scope = "snippets";
+
+});                (function() {
+                    ace.require(["ace/snippets/snippets"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 0 - 16
web/08f2ebda31cf24e86831115fde674fad.js

@@ -1,16 +0,0 @@
-ace.define("ace/snippets/csound_document.snippets",["require","exports","module"], function(require, exports, module){module.exports = "# <CsoundSynthesizer>\nsnippet synth\n\t<CsoundSynthesizer>\n\t<CsInstruments>\n\t${1}\n\t</CsInstruments>\n\t<CsScore>\n\te\n\t</CsScore>\n\t</CsoundSynthesizer>\n";
-
-});
-
-ace.define("ace/snippets/csound_document",["require","exports","module","ace/snippets/csound_document.snippets"], function(require, exports, module){"use strict";
-exports.snippetText = require("./csound_document.snippets");
-exports.scope = "csound_document";
-
-});                (function() {
-                    ace.require(["ace/snippets/csound_document"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

文件差异内容过多而无法显示
+ 530 - 0
web/09195a75bcf8a7ac579281ac2ed5954a.js


+ 397 - 0
web/0a4b12234fd7cba4d7c62207e4835f4c.js

@@ -0,0 +1,397 @@
+ace.define("ace/snippets/php",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+exports.snippetText = "snippet ec\n\
+	echo ${1};\n\
+snippet ns\n\
+	namespace ${1:Foo\\Bar\\Baz};\n\
+	${2}\n\
+snippet use\n\
+	use ${1:Foo\\Bar\\Baz};\n\
+	${2}\n\
+snippet c\n\
+	${1:abstract }class ${2:$FILENAME}\n\
+	{\n\
+		${3}\n\
+	}\n\
+snippet i\n\
+	interface ${1:$FILENAME}\n\
+	{\n\
+		${2}\n\
+	}\n\
+snippet t.\n\
+	$this->${1}\n\
+snippet f\n\
+	function ${1:foo}(${2:array }${3:$bar})\n\
+	{\n\
+		${4}\n\
+	}\n\
+# method\n\
+snippet m\n\
+	${1:abstract }${2:protected}${3: static} function ${4:foo}(${5:array }${6:$bar})\n\
+	{\n\
+		${7}\n\
+	}\n\
+# setter method\n\
+snippet sm\n\
+	/**\n\
+	 * Sets the value of ${1:foo}\n\
+	 *\n\
+	 * @param ${2:$1} $$1 ${3:description}\n\
+	 *\n\
+	 * @return ${4:$FILENAME}\n\
+	 */\n\
+	${5:public} function set${6:$2}(${7:$2 }$$1)\n\
+	{\n\
+		$this->${8:$1} = $$1;\n\
+		return $this;\n\
+	}${9}\n\
+# getter method\n\
+snippet gm\n\
+	/**\n\
+	 * Gets the value of ${1:foo}\n\
+	 *\n\
+	 * @return ${2:$1}\n\
+	 */\n\
+	${3:public} function get${4:$2}()\n\
+	{\n\
+		return $this->${5:$1};\n\
+	}${6}\n\
+#setter\n\
+snippet $s\n\
+	${1:$foo}->set${2:Bar}(${3});\n\
+#getter\n\
+snippet $g\n\
+	${1:$foo}->get${2:Bar}();\n\
+\n\
+# Tertiary conditional\n\
+snippet =?:\n\
+	$${1:foo} = ${2:true} ? ${3:a} : ${4};\n\
+snippet ?:\n\
+	${1:true} ? ${2:a} : ${3}\n\
+\n\
+snippet C\n\
+	$_COOKIE['${1:variable}']${2}\n\
+snippet E\n\
+	$_ENV['${1:variable}']${2}\n\
+snippet F\n\
+	$_FILES['${1:variable}']${2}\n\
+snippet G\n\
+	$_GET['${1:variable}']${2}\n\
+snippet P\n\
+	$_POST['${1:variable}']${2}\n\
+snippet R\n\
+	$_REQUEST['${1:variable}']${2}\n\
+snippet S\n\
+	$_SERVER['${1:variable}']${2}\n\
+snippet SS\n\
+	$_SESSION['${1:variable}']${2}\n\
+\n\
+# the following are old ones\n\
+snippet inc\n\
+	include '${1:file}';${2}\n\
+snippet inc1\n\
+	include_once '${1:file}';${2}\n\
+snippet req\n\
+	require '${1:file}';${2}\n\
+snippet req1\n\
+	require_once '${1:file}';${2}\n\
+# Start Docblock\n\
+snippet /*\n\
+	/**\n\
+	 * ${1}\n\
+	 */\n\
+# Class - post doc\n\
+snippet doc_cp\n\
+	/**\n\
+	 * ${1:undocumented class}\n\
+	 *\n\
+	 * @package ${2:default}\n\
+	 * @subpackage ${3:default}\n\
+	 * @author ${4:`g:snips_author`}\n\
+	 */${5}\n\
+# Class Variable - post doc\n\
+snippet doc_vp\n\
+	/**\n\
+	 * ${1:undocumented class variable}\n\
+	 *\n\
+	 * @var ${2:string}\n\
+	 */${3}\n\
+# Class Variable\n\
+snippet doc_v\n\
+	/**\n\
+	 * ${3:undocumented class variable}\n\
+	 *\n\
+	 * @var ${4:string}\n\
+	 */\n\
+	${1:var} $${2};${5}\n\
+# Class\n\
+snippet doc_c\n\
+	/**\n\
+	 * ${3:undocumented class}\n\
+	 *\n\
+	 * @package ${4:default}\n\
+	 * @subpackage ${5:default}\n\
+	 * @author ${6:`g:snips_author`}\n\
+	 */\n\
+	${1:}class ${2:}\n\
+	{\n\
+		${7}\n\
+	} // END $1class $2\n\
+# Constant Definition - post doc\n\
+snippet doc_dp\n\
+	/**\n\
+	 * ${1:undocumented constant}\n\
+	 */${2}\n\
+# Constant Definition\n\
+snippet doc_d\n\
+	/**\n\
+	 * ${3:undocumented constant}\n\
+	 */\n\
+	define(${1}, ${2});${4}\n\
+# Function - post doc\n\
+snippet doc_fp\n\
+	/**\n\
+	 * ${1:undocumented function}\n\
+	 *\n\
+	 * @return ${2:void}\n\
+	 * @author ${3:`g:snips_author`}\n\
+	 */${4}\n\
+# Function signature\n\
+snippet doc_s\n\
+	/**\n\
+	 * ${4:undocumented function}\n\
+	 *\n\
+	 * @return ${5:void}\n\
+	 * @author ${6:`g:snips_author`}\n\
+	 */\n\
+	${1}function ${2}(${3});${7}\n\
+# Function\n\
+snippet doc_f\n\
+	/**\n\
+	 * ${4:undocumented function}\n\
+	 *\n\
+	 * @return ${5:void}\n\
+	 * @author ${6:`g:snips_author`}\n\
+	 */\n\
+	${1}function ${2}(${3})\n\
+	{${7}\n\
+	}\n\
+# Header\n\
+snippet doc_h\n\
+	/**\n\
+	 * ${1}\n\
+	 *\n\
+	 * @author ${2:`g:snips_author`}\n\
+	 * @version ${3:$Id$}\n\
+	 * @copyright ${4:$2}, `strftime('%d %B, %Y')`\n\
+	 * @package ${5:default}\n\
+	 */\n\
+\n\
+# Interface\n\
+snippet interface\n\
+	/**\n\
+	 * ${2:undocumented class}\n\
+	 *\n\
+	 * @package ${3:default}\n\
+	 * @author ${4:`g:snips_author`}\n\
+	 */\n\
+	interface ${1:$FILENAME}\n\
+	{\n\
+		${5}\n\
+	}\n\
+# class ...\n\
+snippet class\n\
+	/**\n\
+	 * ${1}\n\
+	 */\n\
+	class ${2:$FILENAME}\n\
+	{\n\
+		${3}\n\
+		/**\n\
+		 * ${4}\n\
+		 */\n\
+		${5:public} function ${6:__construct}(${7:argument})\n\
+		{\n\
+			${8:// code...}\n\
+		}\n\
+	}\n\
+# define(...)\n\
+snippet def\n\
+	define('${1}'${2});${3}\n\
+# defined(...)\n\
+snippet def?\n\
+	${1}defined('${2}')${3}\n\
+snippet wh\n\
+	while (${1:/* condition */}) {\n\
+		${2:// code...}\n\
+	}\n\
+# do ... while\n\
+snippet do\n\
+	do {\n\
+		${2:// code... }\n\
+	} while (${1:/* condition */});\n\
+snippet if\n\
+	if (${1:/* condition */}) {\n\
+		${2:// code...}\n\
+	}\n\
+snippet ife\n\
+	if (${1:/* condition */}) {\n\
+		${2:// code...}\n\
+	} else {\n\
+		${3:// code...}\n\
+	}\n\
+	${4}\n\
+snippet else\n\
+	else {\n\
+		${1:// code...}\n\
+	}\n\
+snippet elseif\n\
+	elseif (${1:/* condition */}) {\n\
+		${2:// code...}\n\
+	}\n\
+snippet switch\n\
+	switch ($${1:variable}) {\n\
+		case '${2:value}':\n\
+			${3:// code...}\n\
+			break;\n\
+		${5}\n\
+		default:\n\
+			${4:// code...}\n\
+			break;\n\
+	}\n\
+snippet case\n\
+	case '${1:value}':\n\
+		${2:// code...}\n\
+		break;${3}\n\
+snippet for\n\
+	for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) {\n\
+		${4: // code...}\n\
+	}\n\
+snippet foreach\n\
+	foreach ($${1:variable} as $${2:value}) {\n\
+		${3:// code...}\n\
+	}\n\
+snippet foreachk\n\
+	foreach ($${1:variable} as $${2:key} => $${3:value}) {\n\
+		${4:// code...}\n\
+	}\n\
+# $... = array (...)\n\
+snippet array\n\
+	$${1:arrayName} = array('${2}' => ${3});${4}\n\
+snippet try\n\
+	try {\n\
+		${2}\n\
+	} catch (${1:Exception} $e) {\n\
+	}\n\
+# lambda with closure\n\
+snippet lambda\n\
+	${1:static }function (${2:args}) use (${3:&$x, $y /*put vars in scope (closure) */}) {\n\
+		${4}\n\
+	};\n\
+# pre_dump();\n\
+snippet pd\n\
+	echo '<pre>'; var_dump(${1}); echo '</pre>';\n\
+# pre_dump(); die();\n\
+snippet pdd\n\
+	echo '<pre>'; var_dump(${1}); echo '</pre>'; die(${2:});\n\
+snippet vd\n\
+	var_dump(${1});\n\
+snippet vdd\n\
+	var_dump(${1}); die(${2:});\n\
+snippet http_redirect\n\
+	header (\"HTTP/1.1 301 Moved Permanently\");\n\
+	header (\"Location: \".URL);\n\
+	exit();\n\
+# Getters & Setters\n\
+snippet gs\n\
+	/**\n\
+	 * Gets the value of ${1:foo}\n\
+	 *\n\
+	 * @return ${2:$1}\n\
+	 */\n\
+	public function get${3:$2}()\n\
+	{\n\
+		return $this->${4:$1};\n\
+	}\n\
+\n\
+	/**\n\
+	 * Sets the value of $1\n\
+	 *\n\
+	 * @param $2 $$1 ${5:description}\n\
+	 *\n\
+	 * @return ${6:$FILENAME}\n\
+	 */\n\
+	public function set$3(${7:$2 }$$1)\n\
+	{\n\
+		$this->$4 = $$1;\n\
+		return $this;\n\
+	}${8}\n\
+# anotation, get, and set, useful for doctrine\n\
+snippet ags\n\
+	/**\n\
+	 * ${1:description}\n\
+	 *\n\
+	 * @${7}\n\
+	 */\n\
+	${2:protected} $${3:foo};\n\
+\n\
+	public function get${4:$3}()\n\
+	{\n\
+		return $this->$3;\n\
+	}\n\
+\n\
+	public function set$4(${5:$4 }$${6:$3})\n\
+	{\n\
+		$this->$3 = $$6;\n\
+		return $this;\n\
+	}\n\
+snippet rett\n\
+	return true;\n\
+snippet retf\n\
+	return false;\n\
+scope html\n\
+snippet <?\n\
+	<?php\n\
+\n\
+	${1}\n\
+snippet <?e\n\
+	<?php echo ${1} ?>\n\
+# this one is for php5.4\n\
+snippet <?=\n\
+	<?=${1}?>\n\
+snippet ifil\n\
+	<?php if (${1:/* condition */}): ?>\n\
+		${2:<!-- code... -->}\n\
+	<?php endif; ?>\n\
+snippet ifeil\n\
+	<?php if (${1:/* condition */}): ?>\n\
+		${2:<!-- html... -->}\n\
+	<?php else: ?>\n\
+		${3:<!-- html... -->}\n\
+	<?php endif; ?>\n\
+	${4}\n\
+snippet foreachil\n\
+	<?php foreach ($${1:variable} as $${2:value}): ?>\n\
+		${3:<!-- html... -->}\n\
+	<?php endforeach; ?>\n\
+snippet foreachkil\n\
+	<?php foreach ($${1:variable} as $${2:key} => $${3:value}): ?>\n\
+		${4:<!-- html... -->}\n\
+	<?php endforeach; ?>\n\
+scope html-tag\n\
+snippet ifil\\n\\\n\
+	<?php if (${1:true}): ?>${2:code}<?php endif; ?>\n\
+snippet ifeil\\n\\\n\
+	<?php if (${1:true}): ?>${2:code}<?php else: ?>${3:code}<?php endif; ?>${4}\n\
+";
+exports.scope = "php";
+
+});                (function() {
+                    ace.require(["ace/snippets/php"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 182 - 110
web/2e4c8b961fd80b700a23d21f3d9bb4c5.js → web/0a5adf8110dfa37b8a75edf8cafb1dd7.js

@@ -1,210 +1,269 @@
-ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var DocCommentHighlightRules = function () {
+
+var DocCommentHighlightRules = function() {
     this.$rules = {
-        "start": [{
-                token: "comment.doc.tag",
-                regex: "@[\\w\\d_]+" // TODO: fix email addresses
-            },
-            DocCommentHighlightRules.getTagRule(),
-            {
-                defaultToken: "comment.doc",
-                caseInsensitive: true
-            }]
+        "start" : [ {
+            token : "comment.doc.tag",
+            regex : "@[\\w\\d_]+" // TODO: fix email addresses
+        }, 
+        DocCommentHighlightRules.getTagRule(),
+        {
+            defaultToken : "comment.doc",
+            caseInsensitive: true
+        }]
     };
 };
+
 oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-DocCommentHighlightRules.getTagRule = function (start) {
+
+DocCommentHighlightRules.getTagRule = function(start) {
     return {
-        token: "comment.doc.tag.storage.type",
-        regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
+        token : "comment.doc.tag.storage.type",
+        regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
     };
 };
-DocCommentHighlightRules.getStartRule = function (start) {
+
+DocCommentHighlightRules.getStartRule = function(start) {
     return {
-        token: "comment.doc",
-        regex: "\\/\\*(?=\\*)",
-        next: start
+        token : "comment.doc", // doc comment
+        regex : "\\/\\*(?=\\*)",
+        next  : start
     };
 };
+
 DocCommentHighlightRules.getEndRule = function (start) {
     return {
-        token: "comment.doc",
-        regex: "\\*\\/",
-        next: start
+        token : "comment.doc", // closing comment
+        regex : "\\*\\/",
+        next  : start
     };
 };
+
+
 exports.DocCommentHighlightRules = DocCommentHighlightRules;
 
 });
 
-ace.define("ace/mode/haxe_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+ace.define("ace/mode/haxe_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
+
 var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var HaxeHighlightRules = function () {
-    var keywords = ("break|case|cast|catch|class|continue|default|else|enum|extends|for|function|if|implements|import|in|inline|interface|new|override|package|private|public|return|static|super|switch|this|throw|trace|try|typedef|untyped|var|while|Array|Void|Bool|Int|UInt|Float|Dynamic|String|List|Hash|IntHash|Error|Unknown|Type|Std");
-    var buildinConstants = ("null|true|false");
+
+var HaxeHighlightRules = function() {
+
+    var keywords = (
+        "break|case|cast|catch|class|continue|default|else|enum|extends|for|function|if|implements|import|in|inline|interface|new|override|package|private|public|return|static|super|switch|this|throw|trace|try|typedef|untyped|var|while|Array|Void|Bool|Int|UInt|Float|Dynamic|String|List|Hash|IntHash|Error|Unknown|Type|Std"
+    );
+
+    var buildinConstants = (
+        "null|true|false"
+    );
+
     var keywordMapper = this.createKeywordMapper({
         "variable.language": "this",
         "keyword": keywords,
         "constant.language": buildinConstants
     }, "identifier");
+
     this.$rules = {
-        "start": [
+        "start" : [
             {
-                token: "comment",
-                regex: "\\/\\/.*$"
+                token : "comment",
+                regex : "\\/\\/.*$"
             },
             DocCommentHighlightRules.getStartRule("doc-start"),
             {
-                token: "comment",
-                regex: "\\/\\*",
-                next: "comment"
+                token : "comment", // multi line comment
+                regex : "\\/\\*",
+                next : "comment"
             }, {
-                token: "string.regexp",
-                regex: "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
+                token : "string.regexp",
+                regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
             }, {
-                token: "string",
-                regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+                token : "string", // single line
+                regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
             }, {
-                token: "string",
-                regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+                token : "string", // single line
+                regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
             }, {
-                token: "constant.numeric",
-                regex: "0[xX][0-9a-fA-F]+\\b"
+                token : "constant.numeric", // hex
+                regex : "0[xX][0-9a-fA-F]+\\b"
             }, {
-                token: "constant.numeric",
-                regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+                token : "constant.numeric", // float
+                regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
             }, {
-                token: "constant.language.boolean",
-                regex: "(?:true|false)\\b"
+                token : "constant.language.boolean",
+                regex : "(?:true|false)\\b"
             }, {
-                token: keywordMapper,
-                regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+                token : keywordMapper,
+                regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
             }, {
-                token: "keyword.operator",
-                regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
+                token : "keyword.operator",
+                regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
             }, {
-                token: "punctuation.operator",
-                regex: "\\?|\\:|\\,|\\;|\\."
+                token : "punctuation.operator",
+                regex : "\\?|\\:|\\,|\\;|\\."
             }, {
-                token: "paren.lparen",
-                regex: "[[({<]"
+                token : "paren.lparen",
+                regex : "[[({<]"
             }, {
-                token: "paren.rparen",
-                regex: "[\\])}>]"
+                token : "paren.rparen",
+                regex : "[\\])}>]"
             }, {
-                token: "text",
-                regex: "\\s+"
+                token : "text",
+                regex : "\\s+"
             }
         ],
-        "comment": [
+        "comment" : [
             {
-                token: "comment",
-                regex: "\\*\\/",
-                next: "start"
+                token : "comment", // closing comment
+                regex : "\\*\\/",
+                next : "start"
             }, {
-                defaultToken: "comment"
+                defaultToken : "comment"
             }
         ]
     };
-    this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
+
+    this.embedRules(DocCommentHighlightRules, "doc-",
+        [ DocCommentHighlightRules.getEndRule("start") ]);
 };
+
 oop.inherits(HaxeHighlightRules, TextHighlightRules);
-exports.HaxeHighlightRules = HaxeHighlightRules;
 
+exports.HaxeHighlightRules = HaxeHighlightRules;
 });
 
-ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
+ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
+"use strict";
+
 var Range = require("../range").Range;
-var MatchingBraceOutdent = function () { };
-(function () {
-    this.checkOutdent = function (line, input) {
-        if (!/^\s+$/.test(line))
+
+var MatchingBraceOutdent = function() {};
+
+(function() {
+
+    this.checkOutdent = function(line, input) {
+        if (! /^\s+$/.test(line))
             return false;
+
         return /^\s*\}/.test(input);
     };
-    this.autoOutdent = function (doc, row) {
+
+    this.autoOutdent = function(doc, row) {
         var line = doc.getLine(row);
         var match = line.match(/^(\s*\})/);
-        if (!match)
-            return 0;
+
+        if (!match) return 0;
+
         var column = match[1].length;
-        var openBracePos = doc.findMatchingBracket({ row: row, column: column });
-        if (!openBracePos || openBracePos.row == row)
-            return 0;
+        var openBracePos = doc.findMatchingBracket({row: row, column: column});
+
+        if (!openBracePos || openBracePos.row == row) return 0;
+
         var indent = this.$getIndent(doc.getLine(openBracePos.row));
-        doc.replace(new Range(row, 0, row, column - 1), indent);
+        doc.replace(new Range(row, 0, row, column-1), indent);
     };
-    this.$getIndent = function (line) {
+
+    this.$getIndent = function(line) {
         return line.match(/^\s*/)[0];
     };
+
 }).call(MatchingBraceOutdent.prototype);
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
 
+exports.MatchingBraceOutdent = MatchingBraceOutdent;
 });
 
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var Range = require("../../range").Range;
 var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
     if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
     }
 };
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
+
+(function() {
+    
     this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
     this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
     this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
     this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
     this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
+    
         if (this.singleLineBlockCommentRe.test(line)) {
             if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
                 return "";
         }
+    
         var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
         if (!fw && this.startRegionRe.test(line))
             return "start"; // lineCommentRegionStart
+    
         return fw;
     };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
         var line = session.getLine(row);
+        
         if (this.startRegionRe.test(line))
             return this.getCommentRegionBlock(session, line, row);
+        
         var match = line.match(this.foldingStartMarker);
         if (match) {
             var i = match.index;
+
             if (match[1])
                 return this.openingBracketBlock(session, match[1], row, i);
+                
             var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
             if (range && !range.isMultiLine()) {
                 if (forceMultiline) {
                     range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
+                } else if (foldStyle != "all")
                     range = null;
             }
+            
             return range;
         }
+
         if (foldStyle === "markbegin")
             return;
+
         var match = line.match(this.foldingStopMarker);
         if (match) {
             var i = match.index + match[0].length;
+
             if (match[1])
                 return this.closingBracketBlock(session, match[1], row, i);
+
             return session.getCommentFoldRange(row, i, -1);
         }
     };
-    this.getSectionRange = function (session, row) {
+    
+    this.getSectionRange = function(session, row) {
         var line = session.getLine(row);
         var startIndent = line.search(/\S/);
         var startRow = row;
@@ -217,93 +276,106 @@ oop.inherits(FoldMode, BaseFoldMode);
             var indent = line.search(/\S/);
             if (indent === -1)
                 continue;
-            if (startIndent > indent)
+            if  (startIndent > indent)
                 break;
             var subRange = this.getFoldWidgetRange(session, "all", row);
+            
             if (subRange) {
                 if (subRange.start.row <= startRow) {
                     break;
-                }
-                else if (subRange.isMultiLine()) {
+                } else if (subRange.isMultiLine()) {
                     row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
+                } else if (startIndent == indent) {
                     break;
                 }
             }
             endRow = row;
         }
+        
         return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
     };
-    this.getCommentRegionBlock = function (session, line, row) {
+    this.getCommentRegionBlock = function(session, line, row) {
         var startColumn = line.search(/\s*$/);
         var maxRow = session.getLength();
         var startRow = row;
+        
         var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
         var depth = 1;
         while (++row < maxRow) {
             line = session.getLine(row);
             var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
         }
+
         var endRow = row;
         if (endRow > startRow) {
             return new Range(startRow, startColumn, endRow, line.length);
         }
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/haxe",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haxe_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/haxe",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/haxe_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var HaxeHighlightRules = require("./haxe_highlight_rules").HaxeHighlightRules;
 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
 var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
+
+var Mode = function() {
     this.HighlightRules = HaxeHighlightRules;
+    
     this.$outdent = new MatchingBraceOutdent();
     this.$behaviour = new CstyleBehaviour();
     this.foldingRules = new CStyleFoldMode();
 };
 oop.inherits(Mode, TextMode);
-(function () {
+
+(function() {
     this.lineCommentStart = "//";
-    this.blockComment = { start: "/*", end: "*/" };
-    this.getNextLineIndent = function (state, line, tab) {
+    this.blockComment = {start: "/*", end: "*/"};
+    
+    this.getNextLineIndent = function(state, line, tab) {
         var indent = this.$getIndent(line);
+
         var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
         var tokens = tokenizedLine.tokens;
-        if (tokens.length && tokens[tokens.length - 1].type == "comment") {
+
+        if (tokens.length && tokens[tokens.length-1].type == "comment") {
             return indent;
         }
+
         if (state == "start") {
             var match = line.match(/^.*[\{\(\[]\s*$/);
             if (match) {
                 indent += tab;
             }
         }
+
         return indent;
     };
-    this.checkOutdent = function (state, line, input) {
+
+    this.checkOutdent = function(state, line, input) {
         return this.$outdent.checkOutdent(line, input);
     };
-    this.autoOutdent = function (state, doc, row) {
+
+    this.autoOutdent = function(state, doc, row) {
         this.$outdent.autoOutdent(doc, row);
     };
+
     this.$id = "ace/mode/haxe";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });                (function() {
                     ace.require(["ace/mode/haxe"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 119 - 0
web/0ab67a107deacf1d9b22eb0b706486db.js

@@ -0,0 +1,119 @@
+ace.define("ace/theme/gob",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-gob";
+exports.cssText = ".ace-gob .ace_gutter {\
+background: #0B1818;\
+color: #03EE03\
+}\
+.ace-gob .ace_print-margin {\
+width: 1px;\
+background: #131313\
+}\
+.ace-gob {\
+background-color: #0B0B0B;\
+color: #00FF00\
+}\
+.ace-gob .ace_cursor {\
+border-color: rgba(16, 248, 255, 0.90);\
+background-color: rgba(16, 240, 248, 0.70);\
+opacity: 0.4;\
+}\
+.ace-gob .ace_marker-layer .ace_selection {\
+background: rgba(221, 240, 255, 0.20)\
+}\
+.ace-gob.ace_multiselect .ace_selection.ace_start {\
+box-shadow: 0 0 3px 0px #141414;\
+}\
+.ace-gob .ace_marker-layer .ace_step {\
+background: rgb(16, 128, 0)\
+}\
+.ace-gob .ace_marker-layer .ace_bracket {\
+margin: -1px 0 0 -1px;\
+border: 1px solid rgba(64, 255, 255, 0.25)\
+}\
+.ace-gob .ace_marker-layer .ace_active-line {\
+background: rgba(255, 255, 255, 0.04)\
+}\
+.ace-gob .ace_gutter-active-line {\
+background-color: rgba(255, 255, 255, 0.04)\
+}\
+.ace-gob .ace_marker-layer .ace_selected-word {\
+border: 1px solid rgba(192, 240, 255, 0.20)\
+}\
+.ace-gob .ace_invisible {\
+color: rgba(255, 255, 255, 0.25)\
+}\
+.ace-gob .ace_keyword,\
+.ace-gob .ace_meta {\
+color: #10D8E8\
+}\
+.ace-gob .ace_constant,\
+.ace-gob .ace_constant.ace_character,\
+.ace-gob .ace_constant.ace_character.ace_escape,\
+.ace-gob .ace_constant.ace_other,\
+.ace-gob .ace_heading,\
+.ace-gob .ace_markup.ace_heading,\
+.ace-gob .ace_support.ace_constant {\
+color: #10F0A0\
+}\
+.ace-gob .ace_invalid.ace_illegal {\
+color: #F8F8F8;\
+background-color: rgba(86, 45, 86, 0.75)\
+}\
+.ace-gob .ace_invalid.ace_deprecated {\
+text-decoration: underline;\
+font-style: italic;\
+color: #20F8C0\
+}\
+.ace-gob .ace_support {\
+color: #20E8B0\
+}\
+.ace-gob .ace_fold {\
+background-color: #50B8B8;\
+border-color: #70F8F8\
+}\
+.ace-gob .ace_support.ace_function {\
+color: #00F800\
+}\
+.ace-gob .ace_list,\
+.ace-gob .ace_markup.ace_list,\
+.ace-gob .ace_storage {\
+color: #10FF98\
+}\
+.ace-gob .ace_entity.ace_name.ace_function,\
+.ace-gob .ace_meta.ace_tag,\
+.ace-gob .ace_variable {\
+color: #00F868\
+}\
+.ace-gob .ace_string {\
+color: #10F060\
+}\
+.ace-gob .ace_string.ace_regexp {\
+color: #20F090;\
+}\
+.ace-gob .ace_comment {\
+font-style: italic;\
+color: #00E060;\
+}\
+.ace-gob .ace_variable {\
+color: #00F888;\
+}\
+.ace-gob .ace_xml-pe {\
+color: #488858;\
+}\
+.ace-gob .ace_indent-guide {\
+background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y\
+}\
+";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});                (function() {
+                    ace.require(["ace/theme/gob"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

文件差异内容过多而无法显示
+ 6 - 0
web/0b56e82ae05b7ec2022e1cb35b8b6e10.js


+ 233 - 163
web/49a6772f0e4c0ad12d9475bef3ec1dd4.js → web/0bd6d25a3183a767309cd45cd8b8f347.js

@@ -1,222 +1,262 @@
-ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var DocCommentHighlightRules = function () {
+
+var DocCommentHighlightRules = function() {
     this.$rules = {
-        "start": [{
-                token: "comment.doc.tag",
-                regex: "@[\\w\\d_]+" // TODO: fix email addresses
-            },
-            DocCommentHighlightRules.getTagRule(),
-            {
-                defaultToken: "comment.doc",
-                caseInsensitive: true
-            }]
+        "start" : [ {
+            token : "comment.doc.tag",
+            regex : "@[\\w\\d_]+" // TODO: fix email addresses
+        }, 
+        DocCommentHighlightRules.getTagRule(),
+        {
+            defaultToken : "comment.doc",
+            caseInsensitive: true
+        }]
     };
 };
+
 oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-DocCommentHighlightRules.getTagRule = function (start) {
+
+DocCommentHighlightRules.getTagRule = function(start) {
     return {
-        token: "comment.doc.tag.storage.type",
-        regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
+        token : "comment.doc.tag.storage.type",
+        regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
     };
 };
-DocCommentHighlightRules.getStartRule = function (start) {
+
+DocCommentHighlightRules.getStartRule = function(start) {
     return {
-        token: "comment.doc",
-        regex: "\\/\\*(?=\\*)",
-        next: start
+        token : "comment.doc", // doc comment
+        regex : "\\/\\*(?=\\*)",
+        next  : start
     };
 };
+
 DocCommentHighlightRules.getEndRule = function (start) {
     return {
-        token: "comment.doc",
-        regex: "\\*\\/",
-        next: start
+        token : "comment.doc", // closing comment
+        regex : "\\*\\/",
+        next  : start
     };
 };
+
+
 exports.DocCommentHighlightRules = DocCommentHighlightRules;
 
 });
 
-ace.define("ace/mode/d_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+ace.define("ace/mode/d_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var DHighlightRules = function () {
-    var keywords = ("this|super|import|module|body|mixin|__traits|invariant|alias|asm|delete|" +
-        "typeof|typeid|sizeof|cast|new|in|is|typedef|__vector|__parameters");
-    var keywordControls = ("break|case|continue|default|do|else|for|foreach|foreach_reverse|goto|if|" +
-        "return|switch|while|catch|try|throw|finally|version|assert|unittest|with");
-    var types = ("auto|bool|char|dchar|wchar|byte|ubyte|float|double|real|" +
+
+var DHighlightRules = function() {
+
+    var keywords = (
+        "this|super|import|module|body|mixin|__traits|invariant|alias|asm|delete|"+
+        "typeof|typeid|sizeof|cast|new|in|is|typedef|__vector|__parameters"
+    );
+
+    var keywordControls = (
+        "break|case|continue|default|do|else|for|foreach|foreach_reverse|goto|if|" +
+        "return|switch|while|catch|try|throw|finally|version|assert|unittest|with"
+    );
+    
+    var types = (
+        "auto|bool|char|dchar|wchar|byte|ubyte|float|double|real|" +
         "cfloat|creal|cdouble|cent|ifloat|ireal|idouble|" +
         "int|long|short|void|uint|ulong|ushort|ucent|" +
-        "function|delegate|string|wstring|dstring|size_t|ptrdiff_t|hash_t|Object");
-    var modifiers = ("abstract|align|debug|deprecated|export|extern|const|final|in|inout|out|" +
+        "function|delegate|string|wstring|dstring|size_t|ptrdiff_t|hash_t|Object"
+    );
+
+    var modifiers = (
+        "abstract|align|debug|deprecated|export|extern|const|final|in|inout|out|" +
         "ref|immutable|lazy|nothrow|override|package|pragma|private|protected|" +
-        "public|pure|scope|shared|__gshared|synchronized|static|volatile");
-    var storages = ("class|struct|union|template|interface|enum|macro");
-    var stringEscapesSeq = {
+        "public|pure|scope|shared|__gshared|synchronized|static|volatile"
+    );
+    
+    var storages = (
+        "class|struct|union|template|interface|enum|macro"
+    );
+    
+    var stringEscapesSeq =  {
         token: "constant.language.escape",
         regex: "\\\\(?:(?:x[0-9A-F]{2})|(?:[0-7]{1,3})|(?:['\"\\?0abfnrtv\\\\])|" +
             "(?:u[0-9a-fA-F]{4})|(?:U[0-9a-fA-F]{8}))"
     };
-    var builtinConstants = ("null|true|false|" +
-        "__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__|" +
-        "__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__");
-    var operators = ("/|/\\=|&|&\\=|&&|\\|\\|\\=|\\|\\||\\-|\\-\\=|\\-\\-|\\+|" +
+
+    var builtinConstants = (
+        "null|true|false|"+
+        "__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION__|"+
+        "__FILE__|__MODULE__|__LINE__|__FUNCTION__|__PRETTY_FUNCTION__"
+    );
+    
+    var operators = (
+        "/|/\\=|&|&\\=|&&|\\|\\|\\=|\\|\\||\\-|\\-\\=|\\-\\-|\\+|" +
         "\\+\\=|\\+\\+|\\<|\\<\\=|\\<\\<|\\<\\<\\=|\\<\\>|\\<\\>\\=|\\>|\\>\\=|\\>\\>\\=|" +
         "\\>\\>\\>\\=|\\>\\>|\\>\\>\\>|\\!|\\!\\=|\\!\\<\\>|\\!\\<\\>\\=|\\!\\<|\\!\\<\\=|" +
         "\\!\\>|\\!\\>\\=|\\?|\\$|\\=|\\=\\=|\\*|\\*\\=|%|%\\=|" +
-        "\\^|\\^\\=|\\^\\^|\\^\\^\\=|~|~\\=|\\=\\>|#");
+        "\\^|\\^\\=|\\^\\^|\\^\\^\\=|~|~\\=|\\=\\>|#"
+    );
+
     var keywordMapper = this.$keywords = this.createKeywordMapper({
-        "keyword.modifier": modifiers,
-        "keyword.control": keywordControls,
-        "keyword.type": types,
-        "keyword": keywords,
-        "keyword.storage": storages,
+        "keyword.modifier" : modifiers,
+        "keyword.control" :  keywordControls,
+        "keyword.type" :     types,
+        "keyword":           keywords,
+        "keyword.storage":   storages,
         "punctation": "\\.|\\,|;|\\.\\.|\\.\\.\\.",
-        "keyword.operator": operators,
+        "keyword.operator" : operators,
         "constant.language": builtinConstants
     }, "identifier");
+    
     var identifierRe = "[a-zA-Z_\u00a1-\uffff][a-zA-Z\\d_\u00a1-\uffff]*\\b";
+
     this.$rules = {
-        "start": [
-            {
-                token: "comment",
-                regex: "\\/\\/.*$"
+        "start" : [
+            {     //-------------------------------------------------------- COMMENTS
+                token : "comment",
+                regex : "\\/\\/.*$"
             },
             DocCommentHighlightRules.getStartRule("doc-start"),
             {
-                token: "comment",
-                regex: "\\/\\*",
-                next: "star-comment"
+                token : "comment", // multi line comment
+                regex : "\\/\\*",
+                next : "star-comment"
             }, {
                 token: "comment.shebang",
                 regex: "^\\s*#!.*"
             }, {
-                token: "comment",
-                regex: "\\/\\+",
+                token : "comment",
+                regex : "\\/\\+",
                 next: "plus-comment"
-            }, {
-                onMatch: function (value, currentState, state) {
+            }, {  //-------------------------------------------------------- STRINGS
+                onMatch: function(value, currentState, state) {
                     state.unshift(this.next, value.substr(2));
                     return "string";
                 },
                 regex: 'q"(?:[\\[\\(\\{\\<]+)',
                 next: 'operator-heredoc-string'
             }, {
-                onMatch: function (value, currentState, state) {
+                onMatch: function(value, currentState, state) {
                     state.unshift(this.next, value.substr(2));
                     return "string";
                 },
                 regex: 'q"(?:[a-zA-Z_]+)$',
                 next: 'identifier-heredoc-string'
             }, {
-                token: "string",
-                regex: '[xr]?"',
-                next: "quote-string"
+                token : "string", // multi line string start
+                regex : '[xr]?"',
+                next : "quote-string"
             }, {
-                token: "string",
-                regex: '[xr]?`',
-                next: "backtick-string"
-            }, {
-                token: "string",
-                regex: "[xr]?['](?:(?:\\\\.)|(?:[^'\\\\]))*?['][cdw]?"
+                token : "string", // multi line string start
+                regex : '[xr]?`',
+                next : "backtick-string"
             }, {
+                token : "string", // single line
+                regex : "[xr]?['](?:(?:\\\\.)|(?:[^'\\\\]))*?['][cdw]?"
+            }, {  //-------------------------------------------------------- RULES
                 token: ["keyword", "text", "paren.lparen"],
                 regex: /(asm)(\s*)({)/,
                 next: "d-asm"
             }, {
                 token: ["keyword", "text", "paren.lparen", "constant.language"],
-                regex: "(__traits)(\\s*)(\\()(" + identifierRe + ")"
-            }, {
+                regex: "(__traits)(\\s*)(\\()("+identifierRe+")"
+            }, { // import|module abc
                 token: ["keyword", "text", "variable.module"],
-                regex: "(import|module)(\\s+)((?:" + identifierRe + "\\.?)*)"
-            }, {
+                regex: "(import|module)(\\s+)((?:"+identifierRe+"\\.?)*)"
+            }, { // storage Name
                 token: ["keyword.storage", "text", "entity.name.type"],
-                regex: "(" + storages + ")(\\s*)(" + identifierRe + ")"
-            }, {
+                regex: "("+storages+")(\\s*)("+identifierRe+")"
+            }, { // alias|typedef foo bar;
                 token: ["keyword", "text", "variable.storage", "text"],
-                regex: "(alias|typedef)(\\s*)(" + identifierRe + ")(\\s*)"
+                regex: "(alias|typedef)(\\s*)("+identifierRe+")(\\s*)"
+            }, {  //-------------------------------------------------------- OTHERS
+                token : "constant.numeric", // hex
+                regex : "0[xX][0-9a-fA-F_]+(l|ul|u|f|F|L|U|UL)?\\b"
             }, {
-                token: "constant.numeric",
-                regex: "0[xX][0-9a-fA-F_]+(l|ul|u|f|F|L|U|UL)?\\b"
-            }, {
-                token: "constant.numeric",
-                regex: "[+-]?\\d[\\d_]*(?:(?:\\.[\\d_]*)?(?:[eE][+-]?[\\d_]+)?)?(l|ul|u|f|F|L|U|UL)?\\b"
+                token : "constant.numeric", // float
+                regex : "[+-]?\\d[\\d_]*(?:(?:\\.[\\d_]*)?(?:[eE][+-]?[\\d_]+)?)?(l|ul|u|f|F|L|U|UL)?\\b"
             }, {
                 token: "entity.other.attribute-name",
-                regex: "@" + identifierRe
+                regex: "@"+identifierRe
             }, {
-                token: keywordMapper,
-                regex: "[a-zA-Z_][a-zA-Z0-9_]*\\b"
+                token : keywordMapper,
+                regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b"
             }, {
-                token: "keyword.operator",
-                regex: operators
+                token : "keyword.operator",
+                regex : operators
             }, {
-                token: "punctuation.operator",
-                regex: "\\?|\\:|\\,|\\;|\\.|\\:"
+                token : "punctuation.operator",
+                regex : "\\?|\\:|\\,|\\;|\\.|\\:"
             }, {
-                token: "paren.lparen",
-                regex: "[[({]"
+                token : "paren.lparen",
+                regex : "[[({]"
             }, {
-                token: "paren.rparen",
-                regex: "[\\])}]"
+                token : "paren.rparen",
+                regex : "[\\])}]"
             }, {
-                token: "text",
-                regex: "\\s+"
+                token : "text",
+                regex : "\\s+"
             }
         ],
-        "star-comment": [
+        "star-comment" : [
             {
-                token: "comment",
-                regex: "\\*\\/",
-                next: "start"
+                token : "comment", // closing comment
+                regex : "\\*\\/",
+                next : "start"
             }, {
                 defaultToken: 'comment'
             }
         ],
-        "plus-comment": [
+        "plus-comment" : [
             {
-                token: "comment",
-                regex: "\\+\\/",
-                next: "start"
+                token : "comment", // closing comment
+                regex : "\\+\\/",
+                next : "start"
             }, {
                 defaultToken: 'comment'
             }
         ],
-        "quote-string": [
-            stringEscapesSeq,
-            {
-                token: "string",
-                regex: '"[cdw]?',
-                next: "start"
+        
+        "quote-string" : [
+           stringEscapesSeq,
+           {
+                token : "string",
+                regex : '"[cdw]?',
+                next : "start"
             }, {
                 defaultToken: 'string'
             }
         ],
-        "backtick-string": [
-            stringEscapesSeq,
-            {
-                token: "string",
-                regex: '`[cdw]?',
-                next: "start"
+        
+        "backtick-string" : [
+           stringEscapesSeq,
+           {
+                token : "string",
+                regex : '`[cdw]?',
+                next : "start"
             }, {
                 defaultToken: 'string'
             }
         ],
+        
         "operator-heredoc-string": [
             {
-                onMatch: function (value, currentState, state) {
-                    value = value.substring(value.length - 2, value.length - 1);
-                    var map = { '>': '<', ']': '[', ')': '(', '}': '{' };
-                    if (Object.keys(map).indexOf(value) != -1)
+                onMatch: function(value, currentState, state) {
+                    value = value.substring(value.length-2, value.length-1);
+                    var map = {'>':'<',']':'[',')':'(','}':'{'};
+                    if(Object.keys(map).indexOf(value) != -1)
                         value = map[value];
-                    if (value != state[1])
-                        return "string";
+                    if(value != state[1]) return "string";
                     state.shift();
                     state.shift();
+                    
                     return "string";
                 },
                 regex: '(?:[\\]\\)}>]+)"',
@@ -226,14 +266,15 @@ var DHighlightRules = function () {
                 regex: '[^\\]\\)}>]+'
             }
         ],
+        
         "identifier-heredoc-string": [
             {
-                onMatch: function (value, currentState, state) {
-                    value = value.substring(0, value.length - 1);
-                    if (value != state[1])
-                        return "string";
+                onMatch: function(value, currentState, state) {
+                    value = value.substring(0, value.length-1);
+                    if(value != state[1]) return "string";
                     state.shift();
                     state.shift();
+                    
                     return "string";
                 },
                 regex: '^(?:[A-Za-z_][a-zA-Z0-9]+)"',
@@ -243,6 +284,7 @@ var DHighlightRules = function () {
                 regex: '[^\\]\\)}>]+'
             }
         ],
+        
         "d-asm": [
             {
                 token: "paren.rparen",
@@ -251,7 +293,7 @@ var DHighlightRules = function () {
             }, {
                 token: 'keyword.instruction',
                 regex: '[a-zA-Z]+',
-                next: 'd-asm-instruction'
+                next: 'd-asm-instruction' 
             }, {
                 token: "text",
                 regex: "\\s+"
@@ -286,82 +328,109 @@ var DHighlightRules = function () {
             }
         ]
     };
-    this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
+
+    this.embedRules(DocCommentHighlightRules, "doc-",
+        [ DocCommentHighlightRules.getEndRule("start") ]);
 };
+
 DHighlightRules.metaData = {
-    comment: 'D language',
-    fileTypes: ['d', 'di'],
-    firstLineMatch: '^#!.*\\b[glr]?dmd\\b.',
-    foldingStartMarker: '(?x)/\\*\\*(?!\\*)|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))',
-    foldingStopMarker: '(?<!\\*)\\*\\*/|^\\s*\\}',
-    keyEquivalent: '^~D',
-    name: 'D',
-    scopeName: 'source.d'
+      comment: 'D language',
+      fileTypes: [ 'd', 'di' ],
+      firstLineMatch: '^#!.*\\b[glr]?dmd\\b.',
+      foldingStartMarker: '(?x)/\\*\\*(?!\\*)|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))',
+      foldingStopMarker: '(?<!\\*)\\*\\*/|^\\s*\\}',
+      keyEquivalent: '^~D',
+      name: 'D',
+      scopeName: 'source.d'
 };
 oop.inherits(DHighlightRules, TextHighlightRules);
-exports.DHighlightRules = DHighlightRules;
 
+exports.DHighlightRules = DHighlightRules;
 });
 
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var Range = require("../../range").Range;
 var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
     if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
     }
 };
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
+
+(function() {
+    
     this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
     this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
     this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
     this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
     this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
+    
         if (this.singleLineBlockCommentRe.test(line)) {
             if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
                 return "";
         }
+    
         var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
         if (!fw && this.startRegionRe.test(line))
             return "start"; // lineCommentRegionStart
+    
         return fw;
     };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
         var line = session.getLine(row);
+        
         if (this.startRegionRe.test(line))
             return this.getCommentRegionBlock(session, line, row);
+        
         var match = line.match(this.foldingStartMarker);
         if (match) {
             var i = match.index;
+
             if (match[1])
                 return this.openingBracketBlock(session, match[1], row, i);
+                
             var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
             if (range && !range.isMultiLine()) {
                 if (forceMultiline) {
                     range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
+                } else if (foldStyle != "all")
                     range = null;
             }
+            
             return range;
         }
+
         if (foldStyle === "markbegin")
             return;
+
         var match = line.match(this.foldingStopMarker);
         if (match) {
             var i = match.index + match[0].length;
+
             if (match[1])
                 return this.closingBracketBlock(session, match[1], row, i);
+
             return session.getCommentFoldRange(row, i, -1);
         }
     };
-    this.getSectionRange = function (session, row) {
+    
+    this.getSectionRange = function(session, row) {
         var line = session.getLine(row);
         var startIndent = line.search(/\S/);
         var startRow = row;
@@ -374,72 +443,73 @@ oop.inherits(FoldMode, BaseFoldMode);
             var indent = line.search(/\S/);
             if (indent === -1)
                 continue;
-            if (startIndent > indent)
+            if  (startIndent > indent)
                 break;
             var subRange = this.getFoldWidgetRange(session, "all", row);
+            
             if (subRange) {
                 if (subRange.start.row <= startRow) {
                     break;
-                }
-                else if (subRange.isMultiLine()) {
+                } else if (subRange.isMultiLine()) {
                     row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
+                } else if (startIndent == indent) {
                     break;
                 }
             }
             endRow = row;
         }
+        
         return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
     };
-    this.getCommentRegionBlock = function (session, line, row) {
+    this.getCommentRegionBlock = function(session, line, row) {
         var startColumn = line.search(/\s*$/);
         var maxRow = session.getLength();
         var startRow = row;
+        
         var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
         var depth = 1;
         while (++row < maxRow) {
             line = session.getLine(row);
             var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
         }
+
         var endRow = row;
         if (endRow > startRow) {
             return new Range(startRow, startColumn, endRow, line.length);
         }
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/d",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/d_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
-*/
+ace.define("ace/mode/d",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/d_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var DHighlightRules = require("./d_highlight_rules").DHighlightRules;
 var FoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
+
+var Mode = function() {
     this.HighlightRules = DHighlightRules;
     this.foldingRules = new FoldMode();
     this.$behaviour = this.$defaultBehaviour;
 };
 oop.inherits(Mode, TextMode);
-(function () {
+
+(function() {
     this.lineCommentStart = "//";
-    this.blockComment = { start: "/*", end: "*/" };
+    this.blockComment = {start: "/*", end: "*/"};
     this.$id = "ace/mode/d";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });                (function() {
                     ace.require(["ace/mode/d"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

文件差异内容过多而无法显示
+ 0 - 4
web/0c0d52a441dccb36d64840526d7c262e.js


+ 422 - 0
web/0c125a87d8efb9ce303b6b91783eb165.js

@@ -0,0 +1,422 @@
+ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var DocCommentHighlightRules = function() {
+    this.$rules = {
+        "start" : [ {
+            token : "comment.doc.tag",
+            regex : "@[\\w\\d_]+" // TODO: fix email addresses
+        }, 
+        DocCommentHighlightRules.getTagRule(),
+        {
+            defaultToken : "comment.doc",
+            caseInsensitive: true
+        }]
+    };
+};
+
+oop.inherits(DocCommentHighlightRules, TextHighlightRules);
+
+DocCommentHighlightRules.getTagRule = function(start) {
+    return {
+        token : "comment.doc.tag.storage.type",
+        regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
+    };
+};
+
+DocCommentHighlightRules.getStartRule = function(start) {
+    return {
+        token : "comment.doc", // doc comment
+        regex : "\\/\\*(?=\\*)",
+        next  : start
+    };
+};
+
+DocCommentHighlightRules.getEndRule = function (start) {
+    return {
+        token : "comment.doc", // closing comment
+        regex : "\\*\\/",
+        next  : start
+    };
+};
+
+
+exports.DocCommentHighlightRules = DocCommentHighlightRules;
+
+});
+
+ace.define("ace/mode/asl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
+    "use strict";
+
+    var oop = require("../lib/oop");
+    var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
+    var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+    var ASLHighlightRules = function() {
+        var keywords = (
+            "Default|DefinitionBlock|Device|Method|Else|ElseIf|For|Function|If|Include|Method|Return|" +
+            "Scope|Switch|Case|While|Break|BreakPoint|Continue|NoOp|Wait|True|False|" +
+            "AccessAs|Acquire|Alias|BankField|Buffer|Concatenate|ConcatenateResTemplate|" +
+            "CondRefOf|Connection|CopyObject|CreateBitField|CreateByteField|CreateDWordField|" +
+            "CreateField|CreateQWordField|CreateWordField|DataTableRegion|Debug|" +
+            "DMA|DWordIO|DWordMemory|DWordSpace|EisaId|EISAID|EndDependentFn|Event|ExtendedIO|" +
+            "ExtendedMemory|ExtendedSpace|External|Fatal|Field|FindSetLeftBit|FindSetRightBit|" +
+            "FixedDMA|FixedIO|Fprintf|FromBCD|GpioInt|GpioIo|I2CSerialBusV2|IndexField|" +
+            "Interrupt|IO|IRQ|IRQNoFlags|Load|LoadTable|Match|Memory32|Memory32Fixed|" +
+            "Mid|Mutex|Name|Notify|Offset|ObjectType|OperationRegion|Package|PowerResource|Printf|" +
+            "QWordIO|QWordMemory|QWordSpace|RawDataBuffer|Register|Release|Reset|ResourceTemplate|" +
+            "Signal|SizeOf|Sleep|SPISerialBusV2|Stall|StartDependentFn|StartDependentFnNoPri|" +
+            "Store|ThermalZone|Timer|ToBCD|ToBuffer|ToDecimalString|ToInteger|ToPLD|ToString|" +
+            "ToUUID|UARTSerialBusV2|Unicode|Unload|VendorLong|VendorShort|WordBusNumber|WordIO|" +
+            "WordSpace"
+        );
+
+        var keywordOperators = (
+            "Add|And|Decrement|Divide|Increment|Index|LAnd|LEqual|LGreater|LGreaterEqual|" +
+            "LLess|LLessEqual|LNot|LNotEqual|LOr|Mod|Multiply|NAnd|NOr|Not|Or|RefOf|Revision|" +
+            "ShiftLeft|ShiftRight|Subtract|XOr|DerefOf"
+        );
+
+        var flags = (
+            "AttribQuick|AttribSendReceive|AttribByte|AttribBytes|AttribRawBytes|" +
+            "AttribRawProcessBytes|AttribWord|AttribBlock|AttribProcessCall|AttribBlockProcessCall|" +
+            "AnyAcc|ByteAcc|WordAcc|DWordAcc|QWordAcc|BufferAcc|" +
+            "AddressRangeMemory|AddressRangeReserved|AddressRangeNVS|AddressRangeACPI|" +
+            "RegionSpaceKeyword|FFixedHW|PCC|" +
+            "AddressingMode7Bit|AddressingMode10Bit|" +
+            "DataBitsFive|DataBitsSix|DataBitsSeven|DataBitsEight|DataBitsNine|" +
+            "BusMaster|NotBusMaster|" +
+            "ClockPhaseFirst|ClockPhaseSecond|ClockPolarityLow|ClockPolarityHigh|" +
+            "SubDecode|PosDecode|" +
+            "BigEndianing|LittleEndian|" +
+            "FlowControlNone|FlowControlXon|FlowControlHardware|" +
+            "Edge|Level|ActiveHigh|ActiveLow|ActiveBoth|Decode16|Decode10|" +
+            "IoRestrictionNone|IoRestrictionInputOnly|IoRestrictionOutputOnly|" +
+            "IoRestrictionNoneAndPreserve|Lock|NoLock|MTR|MEQ|MLE|MLT|MGE|MGT|" +
+            "MaxFixed|MaxNotFixed|Cacheable|WriteCombining|Prefetchable|NonCacheable|" +
+            "MinFixed|MinNotFixed|" +
+            "ParityTypeNone|ParityTypeSpace|ParityTypeMark|ParityTypeOdd|ParityTypeEven|" +
+            "PullDefault|PullUp|PullDown|PullNone|PolarityHigh|PolarityLow|" +
+            "ISAOnlyRanges|NonISAOnlyRanges|EntireRange|ReadWrite|ReadOnly|" +
+            "UserDefRegionSpace|SystemIO|SystemMemory|PCI_Config|EmbeddedControl|" +
+            "SMBus|SystemCMOS|PciBarTarget|IPMI|GeneralPurposeIO|GenericSerialBus|" +
+            "ResourceConsumer|ResourceProducer|Serialized|NotSerialized|" +
+            "Shared|Exclusive|SharedAndWake|ExclusiveAndWake|ControllerInitiated|DeviceInitiated|" +
+            "StopBitsZero|StopBitsOne|StopBitsOnePlusHalf|StopBitsTwo|" +
+            "Width8Bit|Width16Bit|Width32Bit|Width64Bit|Width128Bit|Width256Bit|" +
+            "SparseTranslation|DenseTranslation|TypeTranslation|TypeStatic|" +
+            "Preserve|WriteAsOnes|WriteAsZeros|Transfer8|Transfer16|Transfer8_16|" +
+            "ThreeWireMode|FourWireMode"
+        );
+
+        var storageTypes = (
+            "UnknownObj|IntObj|StrObj|BuffObj|PkgObj|FieldUnitObj|DeviceObj|" +
+            "EventObj|MethodObj|MutexObj|OpRegionObj|PowerResObj|ProcessorObj|" +
+            "ThermalZoneObj|BuffFieldObj|DDBHandleObj"
+        );
+
+        var builtinConstants = (
+            "__FILE__|__PATH__|__LINE__|__DATE__|__IASL__"
+        );
+
+        var strNumbers = (
+            "One|Ones|Zero"
+        );
+
+        var deprecated = (
+            "Memory24|Processor"
+        );
+
+        var keywordMapper = this.createKeywordMapper({
+            "keyword": keywords,
+            "constant.numeric": strNumbers,
+            "keyword.operator": keywordOperators,
+            "constant.language": builtinConstants,
+            "storage.type": storageTypes,
+            "constant.library": flags,
+            "invalid.deprecated": deprecated
+        }, "identifier");
+
+        this.$rules = {
+            "start" : [
+                {
+                    token : "comment",
+                    regex : "\\/\\/.*$"
+                },
+                DocCommentHighlightRules.getStartRule("doc-start"),
+                {
+                    token : "comment", // multi line comment
+                    regex : "\\/\\*",
+                    next : "comment"
+                },
+                DocCommentHighlightRules.getStartRule("doc-start"),
+                {
+                    token : "comment", // ignored fields / comments
+                    regex : "\\\[",
+                    next : "ignoredfield"
+                }, {
+                    token : "variable",
+                    regex : "\\Local[0-7]|\\Arg[0-6]"
+                }, {
+                    token : "keyword", // pre-compiler directives
+                    regex : "#\\s*(?:define|elif|else|endif|error|if|ifdef|ifndef|include|includebuffer|line|pragma|undef|warning)\\b",
+                    next  : "directive"
+                }, {
+                    token : "string", // single line
+                    regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+                }, {
+                    token : "constant.character", // single line
+                    regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+                }, {
+                    token : "constant.numeric", // hex
+                    regex : /0[xX][0-9a-fA-F]+\b/
+                }, {
+                    token : "constant.numeric",
+                    regex : /[0-9]+\b/
+                }, {
+                    token : keywordMapper,
+                    regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+                }, {
+                    token : "keyword.operator",
+                    regex : /[!\~\*\/%+-<>\^|=&]/
+                }, {
+                    token : "lparen",
+                    regex : "[[({]"
+                }, {
+                    token : "rparen",
+                    regex : "[\\])}]"
+                }, {
+                    token : "text",
+                    regex : "\\s+"
+                }
+            ],
+            "comment" : [
+                {
+                    token : "comment", // closing comment
+                    regex : "\\*\\/",
+                    next : "start"
+                }, {
+                    defaultToken : "comment"
+                }
+            ],
+            "ignoredfield" : [
+                {
+                    token : "comment", // closing ignored fields / comments
+                    regex : "\\\]",
+                    next : "start"
+                }, {
+                    defaultToken : "comment"
+                }
+            ],
+            "directive" : [
+                {
+                    token : "constant.other.multiline",
+                    regex : /\\/
+                },
+                {
+                    token : "constant.other.multiline",
+                    regex : /.*\\/
+                },
+                {
+                    token : "constant.other",
+                    regex : "\\s*<.+?>*s",
+                    next : "start"
+                },
+                {
+                    token : "constant.other", // single line
+                    regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]*s',
+                    next : "start"
+                },
+                {
+                    token : "constant.other", // single line
+                    regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",
+                    next : "start"
+                },
+                {
+                    token : "constant.other",
+                    regex : /[^\\\/]+/,
+                    next : "start"
+                }
+            ]
+        };
+
+        this.embedRules(DocCommentHighlightRules, "doc-",
+            [ DocCommentHighlightRules.getEndRule("start") ]);
+    };
+
+    oop.inherits(ASLHighlightRules, TextHighlightRules);
+
+    exports.ASLHighlightRules = ASLHighlightRules;
+});
+
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
+    if (commentRegex) {
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
+    }
+};
+oop.inherits(FoldMode, BaseFoldMode);
+
+(function() {
+    
+    this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
+    this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
+    this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
+    this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
+    this._getFoldWidgetBase = this.getFoldWidget;
+    this.getFoldWidget = function(session, foldStyle, row) {
+        var line = session.getLine(row);
+    
+        if (this.singleLineBlockCommentRe.test(line)) {
+            if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
+                return "";
+        }
+    
+        var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
+        if (!fw && this.startRegionRe.test(line))
+            return "start"; // lineCommentRegionStart
+    
+        return fw;
+    };
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
+        var line = session.getLine(row);
+        
+        if (this.startRegionRe.test(line))
+            return this.getCommentRegionBlock(session, line, row);
+        
+        var match = line.match(this.foldingStartMarker);
+        if (match) {
+            var i = match.index;
+
+            if (match[1])
+                return this.openingBracketBlock(session, match[1], row, i);
+                
+            var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
+            if (range && !range.isMultiLine()) {
+                if (forceMultiline) {
+                    range = this.getSectionRange(session, row);
+                } else if (foldStyle != "all")
+                    range = null;
+            }
+            
+            return range;
+        }
+
+        if (foldStyle === "markbegin")
+            return;
+
+        var match = line.match(this.foldingStopMarker);
+        if (match) {
+            var i = match.index + match[0].length;
+
+            if (match[1])
+                return this.closingBracketBlock(session, match[1], row, i);
+
+            return session.getCommentFoldRange(row, i, -1);
+        }
+    };
+    
+    this.getSectionRange = function(session, row) {
+        var line = session.getLine(row);
+        var startIndent = line.search(/\S/);
+        var startRow = row;
+        var startColumn = line.length;
+        row = row + 1;
+        var endRow = row;
+        var maxRow = session.getLength();
+        while (++row < maxRow) {
+            line = session.getLine(row);
+            var indent = line.search(/\S/);
+            if (indent === -1)
+                continue;
+            if  (startIndent > indent)
+                break;
+            var subRange = this.getFoldWidgetRange(session, "all", row);
+            
+            if (subRange) {
+                if (subRange.start.row <= startRow) {
+                    break;
+                } else if (subRange.isMultiLine()) {
+                    row = subRange.end.row;
+                } else if (startIndent == indent) {
+                    break;
+                }
+            }
+            endRow = row;
+        }
+        
+        return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
+    };
+    this.getCommentRegionBlock = function(session, line, row) {
+        var startColumn = line.search(/\s*$/);
+        var maxRow = session.getLength();
+        var startRow = row;
+        
+        var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
+        var depth = 1;
+        while (++row < maxRow) {
+            line = session.getLine(row);
+            var m = re.exec(line);
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
+        }
+
+        var endRow = row;
+        if (endRow > startRow) {
+            return new Range(startRow, startColumn, endRow, line.length);
+        }
+    };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/asl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/asl_highlight_rules","ace/mode/folding/cstyle"], function (require, exports, module) {
+    "use strict";
+
+    var oop = require("../lib/oop");
+    var TextMode = require("./text").Mode;
+    var ASLHighlightRules = require("./asl_highlight_rules").ASLHighlightRules;
+    var FoldMode = require("./folding/cstyle").FoldMode;
+
+    var Mode = function () {
+        this.HighlightRules = ASLHighlightRules;
+        this.foldingRules = new FoldMode();
+        this.$behaviour = this.$defaultBehaviour;
+    };
+    oop.inherits(Mode, TextMode);
+
+    (function () {
+        this.$id = "ace/mode/asl";
+    }).call(Mode.prototype);
+
+    exports.Mode = Mode;
+});                (function() {
+                    ace.require(["ace/mode/asl"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 95 - 0
web/0cab51dee983721ec757e7e209a67c1d.js

@@ -0,0 +1,95 @@
+ace.define("ace/theme/xcode",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
+
+exports.isDark = false;
+exports.cssClass = "ace-xcode";
+exports.cssText = "\
+.ace-xcode .ace_gutter {\
+background: #e8e8e8;\
+color: #333\
+}\
+.ace-xcode .ace_print-margin {\
+width: 1px;\
+background: #e8e8e8\
+}\
+.ace-xcode {\
+background-color: #FFFFFF;\
+color: #000000\
+}\
+.ace-xcode .ace_cursor {\
+color: #000000\
+}\
+.ace-xcode .ace_marker-layer .ace_selection {\
+background: #B5D5FF\
+}\
+.ace-xcode.ace_multiselect .ace_selection.ace_start {\
+box-shadow: 0 0 3px 0px #FFFFFF;\
+}\
+.ace-xcode .ace_marker-layer .ace_step {\
+background: rgb(198, 219, 174)\
+}\
+.ace-xcode .ace_marker-layer .ace_bracket {\
+margin: -1px 0 0 -1px;\
+border: 1px solid #BFBFBF\
+}\
+.ace-xcode .ace_marker-layer .ace_active-line {\
+background: rgba(0, 0, 0, 0.071)\
+}\
+.ace-xcode .ace_gutter-active-line {\
+background-color: rgba(0, 0, 0, 0.071)\
+}\
+.ace-xcode .ace_marker-layer .ace_selected-word {\
+border: 1px solid #B5D5FF\
+}\
+.ace-xcode .ace_constant.ace_language,\
+.ace-xcode .ace_keyword,\
+.ace-xcode .ace_meta,\
+.ace-xcode .ace_variable.ace_language {\
+color: #C800A4\
+}\
+.ace-xcode .ace_invisible {\
+color: #BFBFBF\
+}\
+.ace-xcode .ace_constant.ace_character,\
+.ace-xcode .ace_constant.ace_other {\
+color: #275A5E\
+}\
+.ace-xcode .ace_constant.ace_numeric {\
+color: #3A00DC\
+}\
+.ace-xcode .ace_entity.ace_other.ace_attribute-name,\
+.ace-xcode .ace_support.ace_constant,\
+.ace-xcode .ace_support.ace_function {\
+color: #450084\
+}\
+.ace-xcode .ace_fold {\
+background-color: #C800A4;\
+border-color: #000000\
+}\
+.ace-xcode .ace_entity.ace_name.ace_tag,\
+.ace-xcode .ace_support.ace_class,\
+.ace-xcode .ace_support.ace_type {\
+color: #790EAD\
+}\
+.ace-xcode .ace_storage {\
+color: #C900A4\
+}\
+.ace-xcode .ace_string {\
+color: #DF0002\
+}\
+.ace-xcode .ace_comment {\
+color: #008E00\
+}\
+.ace-xcode .ace_indent-guide {\
+background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});                (function() {
+                    ace.require(["ace/theme/xcode"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 137 - 88
web/de03b970a689d024ab3383991180d48d.js → web/0cbaf3ecc6b20dbc83c2164e9a1eac02.js

@@ -1,111 +1,133 @@
-ace.define("ace/mode/logiql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* THIS FILE WAS AUTOGENERATED FROM tool\LogicBlox.tmbundle\Syntaxes\LogicBlox.tmLanguage (UUID: 59bf5022-e261-453f-b1cb-9f9fa0712413) */
+ace.define("ace/mode/logiql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var LogiQLHighlightRules = function () {
-    this.$rules = { start: [{ token: 'comment.block',
-                regex: '/\\*',
-                push: [{ token: 'comment.block', regex: '\\*/', next: 'pop' },
-                    { defaultToken: 'comment.block' }]
+
+var LogiQLHighlightRules = function() {
+
+    this.$rules = { start: 
+       [ { token: 'comment.block',
+           regex: '/\\*',
+           push: 
+            [ { token: 'comment.block', regex: '\\*/', next: 'pop' },
+              { defaultToken: 'comment.block' } ]
             },
-            { token: 'comment.single',
-                regex: '//.*'
+         { token: 'comment.single',
+           regex: '//.*'
             },
-            { token: 'constant.numeric',
-                regex: '\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?[fd]?'
+         { token: 'constant.numeric',
+           regex: '\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?[fd]?'
             },
-            { token: 'string',
-                regex: '"',
-                push: [{ token: 'string', regex: '"', next: 'pop' },
-                    { defaultToken: 'string' }]
+         { token: 'string',
+           regex: '"',
+           push: 
+            [ { token: 'string', regex: '"', next: 'pop' },
+              { defaultToken: 'string' } ]
             },
-            { token: 'constant.language',
-                regex: '\\b(true|false)\\b'
+         { token: 'constant.language',
+           regex: '\\b(true|false)\\b'
             },
-            { token: 'entity.name.type.logicblox',
-                regex: '`[a-zA-Z_:]+(\\d|\\a)*\\b'
+         { token: 'entity.name.type.logicblox',
+           regex: '`[a-zA-Z_:]+(\\d|\\a)*\\b'
             },
-            { token: 'keyword.start', regex: '->', comment: 'Constraint' },
-            { token: 'keyword.start', regex: '-->', comment: 'Level 1 Constraint' },
-            { token: 'keyword.start', regex: '<-', comment: 'Rule' },
-            { token: 'keyword.start', regex: '<--', comment: 'Level 1 Rule' },
-            { token: 'keyword.end', regex: '\\.', comment: 'Terminator' },
-            { token: 'keyword.other', regex: '!', comment: 'Negation' },
-            { token: 'keyword.other', regex: ',', comment: 'Conjunction' },
-            { token: 'keyword.other', regex: ';', comment: 'Disjunction' },
-            { token: 'keyword.operator', regex: '<=|>=|!=|<|>', comment: 'Equality' },
-            { token: 'keyword.other', regex: '@', comment: 'Equality' },
-            { token: 'keyword.operator', regex: '\\+|-|\\*|/', comment: 'Arithmetic operations' },
-            { token: 'keyword', regex: '::', comment: 'Colon colon' },
-            { token: 'support.function',
-                regex: '\\b(agg\\s*<<)',
-                push: [{ include: '$self' },
-                    { token: 'support.function',
-                        regex: '>>',
-                        next: 'pop' }]
+         { token: 'keyword.start', regex: '->',  comment: 'Constraint' },
+         { token: 'keyword.start', regex: '-->', comment: 'Level 1 Constraint'},
+         { token: 'keyword.start', regex: '<-',  comment: 'Rule' },
+         { token: 'keyword.start', regex: '<--', comment: 'Level 1 Rule' },
+         { token: 'keyword.end',   regex: '\\.', comment: 'Terminator' },
+         { token: 'keyword.other', regex: '!',   comment: 'Negation' },
+         { token: 'keyword.other', regex: ',',   comment: 'Conjunction' },
+         { token: 'keyword.other', regex: ';',   comment: 'Disjunction' },
+         { token: 'keyword.operator', regex: '<=|>=|!=|<|>', comment: 'Equality'},
+         { token: 'keyword.other', regex: '@', comment: 'Equality' },
+         { token: 'keyword.operator', regex: '\\+|-|\\*|/', comment: 'Arithmetic operations'},
+         { token: 'keyword', regex: '::', comment: 'Colon colon' },
+         { token: 'support.function',
+           regex: '\\b(agg\\s*<<)',
+           push: 
+            [ { include: '$self' },
+              { token: 'support.function',
+                regex: '>>',
+                next: 'pop' } ]
             },
-            { token: 'storage.modifier',
-                regex: '\\b(lang:[\\w:]*)'
+         { token: 'storage.modifier',
+           regex: '\\b(lang:[\\w:]*)'
             },
-            { token: ['storage.type', 'text'],
-                regex: '(export|sealed|clauses|block|alias|alias_all)(\\s*\\()(?=`)'
+         { token: [ 'storage.type', 'text' ],
+           regex: '(export|sealed|clauses|block|alias|alias_all)(\\s*\\()(?=`)'
             },
-            { token: 'entity.name',
-                regex: '[a-zA-Z_][a-zA-Z_0-9:]*(@prev|@init|@final)?(?=(\\(|\\[))'
+         { token: 'entity.name',
+           regex: '[a-zA-Z_][a-zA-Z_0-9:]*(@prev|@init|@final)?(?=(\\(|\\[))'
             },
-            { token: 'variable.parameter',
-                regex: '([a-zA-Z][a-zA-Z_0-9]*|_)\\s*(?=(,|\\.|<-|->|\\)|\\]|=))'
-            }] };
+         { token: 'variable.parameter',
+           regex: '([a-zA-Z][a-zA-Z_0-9]*|_)\\s*(?=(,|\\.|<-|->|\\)|\\]|=))'
+            } ] };
+    
     this.normalizeRules();
 };
+
 oop.inherits(LogiQLHighlightRules, TextHighlightRules);
-exports.LogiQLHighlightRules = LogiQLHighlightRules;
 
+exports.LogiQLHighlightRules = LogiQLHighlightRules;
 });
 
-ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var BaseFoldMode = require("./fold_mode").FoldMode;
 var Range = require("../../range").Range;
-var FoldMode = exports.FoldMode = function () { };
+
+var FoldMode = exports.FoldMode = function() {};
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.getFoldWidgetRange = function (session, foldStyle, row) {
+
+(function() {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row) {
         var range = this.indentationBlock(session, row);
         if (range)
             return range;
+
         var re = /\S/;
         var line = session.getLine(row);
         var startLevel = line.search(re);
         if (startLevel == -1 || line[startLevel] != "#")
             return;
+
         var startColumn = line.length;
         var maxRow = session.getLength();
         var startRow = row;
         var endRow = row;
+
         while (++row < maxRow) {
             line = session.getLine(row);
             var level = line.search(re);
+
             if (level == -1)
                 continue;
+
             if (line[level] != "#")
                 break;
+
             endRow = row;
         }
+
         if (endRow > startRow) {
             var endColumn = session.getLine(endRow).length;
             return new Range(startRow, startColumn, endRow, endColumn);
         }
     };
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
         var indent = line.search(/\S/);
         var next = session.getLine(row + 1);
         var prev = session.getLine(row - 1);
         var prevIndent = prev.search(/\S/);
         var nextIndent = next.search(/\S/);
+
         if (indent == -1) {
-            session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
+            session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
             return "";
         }
         if (prevIndent == -1) {
@@ -114,57 +136,72 @@ oop.inherits(FoldMode, BaseFoldMode);
                 session.foldWidgets[row + 1] = "";
                 return "start";
             }
-        }
-        else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
+        } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
             if (session.getLine(row - 2).search(/\S/) == -1) {
                 session.foldWidgets[row - 1] = "start";
                 session.foldWidgets[row + 1] = "";
                 return "";
             }
         }
-        if (prevIndent != -1 && prevIndent < indent)
+
+        if (prevIndent!= -1 && prevIndent < indent)
             session.foldWidgets[row - 1] = "start";
         else
             session.foldWidgets[row - 1] = "";
+
         if (indent < nextIndent)
             return "start";
         else
             return "";
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
+ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
+"use strict";
+
 var Range = require("../range").Range;
-var MatchingBraceOutdent = function () { };
-(function () {
-    this.checkOutdent = function (line, input) {
-        if (!/^\s+$/.test(line))
+
+var MatchingBraceOutdent = function() {};
+
+(function() {
+
+    this.checkOutdent = function(line, input) {
+        if (! /^\s+$/.test(line))
             return false;
+
         return /^\s*\}/.test(input);
     };
-    this.autoOutdent = function (doc, row) {
+
+    this.autoOutdent = function(doc, row) {
         var line = doc.getLine(row);
         var match = line.match(/^(\s*\})/);
-        if (!match)
-            return 0;
+
+        if (!match) return 0;
+
         var column = match[1].length;
-        var openBracePos = doc.findMatchingBracket({ row: row, column: column });
-        if (!openBracePos || openBracePos.row == row)
-            return 0;
+        var openBracePos = doc.findMatchingBracket({row: row, column: column});
+
+        if (!openBracePos || openBracePos.row == row) return 0;
+
         var indent = this.$getIndent(doc.getLine(openBracePos.row));
-        doc.replace(new Range(row, 0, row, column - 1), indent);
+        doc.replace(new Range(row, 0, row, column-1), indent);
     };
-    this.$getIndent = function (line) {
+
+    this.$getIndent = function(line) {
         return line.match(/^\s*/)[0];
     };
+
 }).call(MatchingBraceOutdent.prototype);
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
 
+exports.MatchingBraceOutdent = MatchingBraceOutdent;
 });
 
-ace.define("ace/mode/logiql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/logiql_highlight_rules","ace/mode/folding/coffee","ace/token_iterator","ace/range","ace/mode/behaviour/cstyle","ace/mode/matching_brace_outdent"], function(require, exports, module){"use strict";
+ace.define("ace/mode/logiql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/logiql_highlight_rules","ace/mode/folding/coffee","ace/token_iterator","ace/range","ace/mode/behaviour/cstyle","ace/mode/matching_brace_outdent"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var LogiQLHighlightRules = require("./logiql_highlight_rules").LogiQLHighlightRules;
@@ -173,62 +210,74 @@ var TokenIterator = require("../token_iterator").TokenIterator;
 var Range = require("../range").Range;
 var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var Mode = function () {
+
+var Mode = function() {
     this.HighlightRules = LogiQLHighlightRules;
     this.foldingRules = new FoldMode();
     this.$outdent = new MatchingBraceOutdent();
     this.$behaviour = new CstyleBehaviour();
 };
 oop.inherits(Mode, TextMode);
-(function () {
+
+(function() {
     this.lineCommentStart = "//";
-    this.blockComment = { start: "/*", end: "*/" };
-    this.getNextLineIndent = function (state, line, tab) {
+    this.blockComment = {start: "/*", end: "*/"};
+
+    this.getNextLineIndent = function(state, line, tab) {
         var indent = this.$getIndent(line);
+
         var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
         var tokens = tokenizedLine.tokens;
         var endState = tokenizedLine.state;
-        if (/comment|string/.test(endState))
+        if (/comment|string/.test(endState))  
             return indent;
         if (tokens.length && tokens[tokens.length - 1].type == "comment.single")
             return indent;
+
         var match = line.match();
         if (/(-->|<--|<-|->|{)\s*$/.test(line))
             indent += tab;
         return indent;
     };
-    this.checkOutdent = function (state, line, input) {
+
+    this.checkOutdent = function(state, line, input) {
         if (this.$outdent.checkOutdent(line, input))
             return true;
+
         if (input !== "\n" && input !== "\r\n")
             return false;
+            
         if (!/^\s+/.test(line))
             return false;
+
         return true;
     };
-    this.autoOutdent = function (state, doc, row) {
+
+    this.autoOutdent = function(state, doc, row) {
         if (this.$outdent.autoOutdent(doc, row))
             return;
         var prevLine = doc.getLine(row);
         var match = prevLine.match(/^\s+/);
         var column = prevLine.lastIndexOf(".") + 1;
-        if (!match || !row || !column)
-            return 0;
+        if (!match || !row || !column) return 0;
+
         var line = doc.getLine(row + 1);
-        var startRange = this.getMatching(doc, { row: row, column: column });
-        if (!startRange || startRange.start.row == row)
-            return 0;
+        var startRange = this.getMatching(doc, {row: row, column: column});
+        if (!startRange || startRange.start.row == row) return 0;
+
         column = match[0].length;
         var indent = this.$getIndent(doc.getLine(startRange.start.row));
         doc.replace(new Range(row + 1, 0, row + 1, column), indent);
     };
-    this.getMatching = function (session, row, column) {
+
+    this.getMatching = function(session, row, column) {
         if (row == undefined)
             row = session.selection.lead;
         if (typeof row == "object") {
             column = row.column;
             row = row.row;
         }
+
         var startToken = session.getTokenAt(row, column);
         var KW_START = "keyword.start", KW_END = "keyword.end";
         var tok;
@@ -237,27 +286,27 @@ oop.inherits(Mode, TextMode);
         if (startToken.type == KW_START) {
             var it = new TokenIterator(session, row, column);
             it.step = it.stepForward;
-        }
-        else if (startToken.type == KW_END) {
+        } else if (startToken.type == KW_END) {
             var it = new TokenIterator(session, row, column);
             it.step = it.stepBackward;
-        }
-        else
+        } else
             return;
+
         while (tok = it.step()) {
             if (tok.type == KW_START || tok.type == KW_END)
                 break;
         }
         if (!tok || tok.type == startToken.type)
             return;
+
         var col = it.getCurrentTokenColumn();
         var row = it.getCurrentTokenRow();
         return new Range(row, col, row, col + tok.value.length);
     };
     this.$id = "ace/mode/logiql";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });                (function() {
                     ace.require(["ace/mode/logiql"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 0 - 310
web/0db77d70de73132c7e5979bf8e82f047.js

@@ -1,310 +0,0 @@
-ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var DocCommentHighlightRules = function () {
-    this.$rules = {
-        "start": [{
-                token: "comment.doc.tag",
-                regex: "@[\\w\\d_]+" // TODO: fix email addresses
-            },
-            DocCommentHighlightRules.getTagRule(),
-            {
-                defaultToken: "comment.doc",
-                caseInsensitive: true
-            }]
-    };
-};
-oop.inherits(DocCommentHighlightRules, TextHighlightRules);
-DocCommentHighlightRules.getTagRule = function (start) {
-    return {
-        token: "comment.doc.tag.storage.type",
-        regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
-    };
-};
-DocCommentHighlightRules.getStartRule = function (start) {
-    return {
-        token: "comment.doc",
-        regex: "\\/\\*(?=\\*)",
-        next: start
-    };
-};
-DocCommentHighlightRules.getEndRule = function (start) {
-    return {
-        token: "comment.doc",
-        regex: "\\*\\/",
-        next: start
-    };
-};
-exports.DocCommentHighlightRules = DocCommentHighlightRules;
-
-});
-
-ace.define("ace/mode/scrypt_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from ./tmthemes/tmscrypt.tmLanguage (uuid: ) */
-"use strict";
-var oop = require("../lib/oop");
-var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var scryptHighlightRules = function () {
-    var keywords = ("contract|library|loop|new|private|" +
-        "public|if|else|struct|type|" +
-        "require|static|const|import|exit|return|asm");
-    var buildinConstants = ("true|false");
-    var langClasses = ("function|auto|constructor|bytes|int|bool|SigHashPreimage|PrivKey|PubKey|Sig|Ripemd160|Sha1|Sha256|" +
-        "SigHashType|SigHashPreimage|OpCodeType");
-    var keywordMapper = this.createKeywordMapper({
-        "variable.language": "this",
-        "keyword": keywords,
-        "constant.language": buildinConstants,
-        "support.function": langClasses
-    }, "identifier");
-    this.$rules = {
-        "start": [
-            {
-                token: "comment",
-                regex: "\\/\\/.*$"
-            },
-            DocCommentHighlightRules.getStartRule("doc-start"),
-            {
-                token: "comment",
-                regex: "\\/\\*",
-                next: "comment"
-            }, {
-                token: "string",
-                regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
-            }, {
-                token: "string",
-                regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
-            }, {
-                token: "constant.numeric",
-                regex: /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/
-            }, {
-                token: "constant.numeric",
-                regex: /[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/
-            }, {
-                token: "constant.language.boolean",
-                regex: "(?:true|false)\\b"
-            },
-            {
-                token: ["support.function.math.scrypt", "text", "text"],
-                regex: /\b(abs|min|max|within|ripemd160|sha1|sha256|hash160|hash256|checkSig|checkMultiSig|num2bin|pack|unpack|len|reverseBytes|repeat)(\s*)(\()/
-            }, {
-                token: [
-                    "entity.name.type.scrypt",
-                    "text",
-                    "text",
-                    "text",
-                    "variable.object.property.scrypt"
-                ],
-                regex: /\b(SigHash)(\s*)(\.)(\s*)(ANYONECANPAY|ALL|FORKID|NONE|SINGLE)\b/
-            },
-            {
-                token: [
-                    "entity.name.type.scrypt",
-                    "text",
-                    "text",
-                    "text",
-                    "variable.object.property.scrypt"
-                ],
-                regex: /\b(OpCode)(\s*)(\.)(\s*)(OP_PUSHDATA1|OP_PUSHDATA2|OP_PUSHDATA4|OP_0|OP_FALSE|OP_1NEGATE|OP_1|OP_TRUE|OP_2|OP_3|OP_4|OP_5|OP_6|OP_7|OP_8|OP_9|OP_10|OP_11|OP_12|OP_13|OP_14|OP_15|OP_16|OP_1ADD|OP_1SUB|OP_NEGATE|OP_ABS|OP_NOT|OP_0NOTEQUAL|OP_ADD|OP_SUB|OP_MUL|OP_DIV|OP_MOD|OP_LSHIFT|OP_RSHIFT|OP_BOOLAND|OP_BOOLOR|OP_NUMEQUAL|OP_NUMEQUALVERIFY|OP_NUMNOTEQUAL|OP_LESSTHAN|OP_GREATERTHAN|OP_LESSTHANOREQUAL|OP_GREATERTHANOREQUAL|OP_MIN|OP_MAX|OP_WITHIN|OP_CAT|OP_SPLIT|OP_BIN2NUM|OP_NUM2BIN|OP_SIZE|OP_NOP|OP_IF|OP_NOTIF|OP_ELSE|OP_ENDIF|OP_VERIFY|OP_RETURN|OP_TOALTSTACK|OP_FROMALTSTACK|OP_IFDUP|OP_DEPTH|OP_DROP|OP_DUP|OP_NIP|OP_OVER|OP_PICK|OP_ROLL|OP_ROT|OP_SWAP|OP_TUCK|OP_2DROP|OP_2DUP|OP_3DUP|OP_2OVER|OP_2ROT|OP_2SWAP|OP_RIPEMD160|OP_SHA1|OP_SHA256|OP_HASH160|OP_HASH256|OP_CODESEPARATOR|OP_CHECKSIG|OP_CHECKSIGVERIFY|OP_CHECKMULTISIG|OP_CHECKMULTISIGVERIFY|OP_INVERT|OP_AND|OP_OR|OP_XOR|OP_EQUAL|OP_EQUALVERIFY)\b/
-            }, {
-                token: "entity.name.type.scrypt",
-                regex: /\b(?:P2PKH|P2PK|Tx|HashPuzzleRipemd160|HashPuzzleSha1|HashPuzzleSha256|HashPuzzleHash160|OpCode|SigHash)\b/
-            }, {
-                token: [
-                    "punctuation.separator.period.scrypt",
-                    'text',
-                    "entity.name.function.scrypt",
-                    "text",
-                    "punctuation.definition.parameters.begin.bracket.round.scrypt"
-                ],
-                regex: /(\.)([^\S$\r]*)([\w][\w\d]*)(\s*)(\()/,
-                push: [{
-                        token: "punctuation.definition.parameters.end.bracket.round.scrypt",
-                        regex: /\)/,
-                        next: "pop"
-                    }, {
-                        defaultToken: "start"
-                    }]
-            }, {
-                token: keywordMapper,
-                regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
-            }, {
-                token: "keyword.operator",
-                regex: "!|\\$|%|&|\\||\\^|\\*|\\/|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|<=|>=|<>|<|>|!|&&|\\|\\||\\?|\\:|\\*=|\\/=|%=|\\+=|\\-=|&=|\\|=|\\^="
-            }, {
-                token: "lparen",
-                regex: "[[({]"
-            }, {
-                token: "rparen",
-                regex: "[\\])}]"
-            }, {
-                token: "text",
-                regex: "\\s+"
-            }
-        ],
-        "comment": [
-            {
-                token: "comment",
-                regex: "\\*\\/",
-                next: "start"
-            }, {
-                defaultToken: "comment"
-            }
-        ]
-    };
-    this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
-    this.normalizeRules();
-};
-oop.inherits(scryptHighlightRules, TextHighlightRules);
-exports.scryptHighlightRules = scryptHighlightRules;
-
-});
-
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
-    if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
-    }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
-    this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
-    this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
-    this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
-    this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
-        var line = session.getLine(row);
-        if (this.singleLineBlockCommentRe.test(line)) {
-            if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
-                return "";
-        }
-        var fw = this._getFoldWidgetBase(session, foldStyle, row);
-        if (!fw && this.startRegionRe.test(line))
-            return "start"; // lineCommentRegionStart
-        return fw;
-    };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
-        var line = session.getLine(row);
-        if (this.startRegionRe.test(line))
-            return this.getCommentRegionBlock(session, line, row);
-        var match = line.match(this.foldingStartMarker);
-        if (match) {
-            var i = match.index;
-            if (match[1])
-                return this.openingBracketBlock(session, match[1], row, i);
-            var range = session.getCommentFoldRange(row, i + match[0].length, 1);
-            if (range && !range.isMultiLine()) {
-                if (forceMultiline) {
-                    range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
-                    range = null;
-            }
-            return range;
-        }
-        if (foldStyle === "markbegin")
-            return;
-        var match = line.match(this.foldingStopMarker);
-        if (match) {
-            var i = match.index + match[0].length;
-            if (match[1])
-                return this.closingBracketBlock(session, match[1], row, i);
-            return session.getCommentFoldRange(row, i, -1);
-        }
-    };
-    this.getSectionRange = function (session, row) {
-        var line = session.getLine(row);
-        var startIndent = line.search(/\S/);
-        var startRow = row;
-        var startColumn = line.length;
-        row = row + 1;
-        var endRow = row;
-        var maxRow = session.getLength();
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var indent = line.search(/\S/);
-            if (indent === -1)
-                continue;
-            if (startIndent > indent)
-                break;
-            var subRange = this.getFoldWidgetRange(session, "all", row);
-            if (subRange) {
-                if (subRange.start.row <= startRow) {
-                    break;
-                }
-                else if (subRange.isMultiLine()) {
-                    row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
-                    break;
-                }
-            }
-            endRow = row;
-        }
-        return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
-    };
-    this.getCommentRegionBlock = function (session, line, row) {
-        var startColumn = line.search(/\s*$/);
-        var maxRow = session.getLength();
-        var startRow = row;
-        var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
-        var depth = 1;
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
-        }
-        var endRow = row;
-        if (endRow > startRow) {
-            return new Range(startRow, startColumn, endRow, line.length);
-        }
-    };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/scrypt",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scrypt_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
-*/
-"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var scryptHighlightRules = require("./scrypt_highlight_rules").scryptHighlightRules;
-var FoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
-    this.HighlightRules = scryptHighlightRules;
-    this.foldingRules = new FoldMode();
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.lineCommentStart = "//";
-    this.blockComment = { start: "/*", end: "*/" };
-    this.$quotes = { '"': '"', "'": "'" };
-    this.createWorker = function (session) {
-        return null;
-    };
-    this.$id = "ace/mode/scrypt";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});                (function() {
-                    ace.require(["ace/mode/scrypt"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 33 - 0
web/0dc486b4415f7cbd7ddde8f32b6f12f1.js

@@ -0,0 +1,33 @@
+ace.define("ace/snippets/drools",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+exports.snippetText = "\n\
+snippet rule\n\
+	rule \"${1?:rule_name}\"\n\
+	when\n\
+		${2:// when...} \n\
+	then\n\
+		${3:// then...}\n\
+	end\n\
+\n\
+snippet query\n\
+	query ${1?:query_name}\n\
+		${2:// find} \n\
+	end\n\
+	\n\
+snippet declare\n\
+	declare ${1?:type_name}\n\
+		${2:// attributes} \n\
+	end\n\
+\n\
+";
+exports.scope = "drools";
+
+});                (function() {
+                    ace.require(["ace/snippets/drools"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

文件差异内容过多而无法显示
+ 33 - 22
web/0e7164b2216605b024f4dc8d910ac5e8.js


+ 128 - 0
web/0ebc6c9681e409f2bf3bb6d8ce64e28e.js

@@ -0,0 +1,128 @@
+ace.define("ace/theme/tomorrow_night_bright",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-tomorrow-night-bright";
+exports.cssText = ".ace-tomorrow-night-bright .ace_gutter {\
+background: #1a1a1a;\
+color: #DEDEDE\
+}\
+.ace-tomorrow-night-bright .ace_print-margin {\
+width: 1px;\
+background: #1a1a1a\
+}\
+.ace-tomorrow-night-bright {\
+background-color: #000000;\
+color: #DEDEDE\
+}\
+.ace-tomorrow-night-bright .ace_cursor {\
+color: #9F9F9F\
+}\
+.ace-tomorrow-night-bright .ace_marker-layer .ace_selection {\
+background: #424242\
+}\
+.ace-tomorrow-night-bright.ace_multiselect .ace_selection.ace_start {\
+box-shadow: 0 0 3px 0px #000000;\
+}\
+.ace-tomorrow-night-bright .ace_marker-layer .ace_step {\
+background: rgb(102, 82, 0)\
+}\
+.ace-tomorrow-night-bright .ace_marker-layer .ace_bracket {\
+margin: -1px 0 0 -1px;\
+border: 1px solid #888888\
+}\
+.ace-tomorrow-night-bright .ace_marker-layer .ace_highlight {\
+border: 1px solid rgb(110, 119, 0);\
+border-bottom: 0;\
+box-shadow: inset 0 -1px rgb(110, 119, 0);\
+margin: -1px 0 0 -1px;\
+background: rgba(255, 235, 0, 0.1)\
+}\
+.ace-tomorrow-night-bright .ace_marker-layer .ace_active-line {\
+background: #2A2A2A\
+}\
+.ace-tomorrow-night-bright .ace_gutter-active-line {\
+background-color: #2A2A2A\
+}\
+.ace-tomorrow-night-bright .ace_stack {\
+background-color: rgb(66, 90, 44)\
+}\
+.ace-tomorrow-night-bright .ace_marker-layer .ace_selected-word {\
+border: 1px solid #888888\
+}\
+.ace-tomorrow-night-bright .ace_invisible {\
+color: #343434\
+}\
+.ace-tomorrow-night-bright .ace_keyword,\
+.ace-tomorrow-night-bright .ace_meta,\
+.ace-tomorrow-night-bright .ace_storage,\
+.ace-tomorrow-night-bright .ace_storage.ace_type,\
+.ace-tomorrow-night-bright .ace_support.ace_type {\
+color: #C397D8\
+}\
+.ace-tomorrow-night-bright .ace_keyword.ace_operator {\
+color: #70C0B1\
+}\
+.ace-tomorrow-night-bright .ace_constant.ace_character,\
+.ace-tomorrow-night-bright .ace_constant.ace_language,\
+.ace-tomorrow-night-bright .ace_constant.ace_numeric,\
+.ace-tomorrow-night-bright .ace_keyword.ace_other.ace_unit,\
+.ace-tomorrow-night-bright .ace_support.ace_constant,\
+.ace-tomorrow-night-bright .ace_variable.ace_parameter {\
+color: #E78C45\
+}\
+.ace-tomorrow-night-bright .ace_constant.ace_other {\
+color: #EEEEEE\
+}\
+.ace-tomorrow-night-bright .ace_invalid {\
+color: #CED2CF;\
+background-color: #DF5F5F\
+}\
+.ace-tomorrow-night-bright .ace_invalid.ace_deprecated {\
+color: #CED2CF;\
+background-color: #B798BF\
+}\
+.ace-tomorrow-night-bright .ace_fold {\
+background-color: #7AA6DA;\
+border-color: #DEDEDE\
+}\
+.ace-tomorrow-night-bright .ace_entity.ace_name.ace_function,\
+.ace-tomorrow-night-bright .ace_support.ace_function,\
+.ace-tomorrow-night-bright .ace_variable {\
+color: #7AA6DA\
+}\
+.ace-tomorrow-night-bright .ace_support.ace_class,\
+.ace-tomorrow-night-bright .ace_support.ace_type {\
+color: #E7C547\
+}\
+.ace-tomorrow-night-bright .ace_heading,\
+.ace-tomorrow-night-bright .ace_markup.ace_heading,\
+.ace-tomorrow-night-bright .ace_string {\
+color: #B9CA4A\
+}\
+.ace-tomorrow-night-bright .ace_entity.ace_name.ace_tag,\
+.ace-tomorrow-night-bright .ace_entity.ace_other.ace_attribute-name,\
+.ace-tomorrow-night-bright .ace_meta.ace_tag,\
+.ace-tomorrow-night-bright .ace_string.ace_regexp,\
+.ace-tomorrow-night-bright .ace_variable {\
+color: #D54E53\
+}\
+.ace-tomorrow-night-bright .ace_comment {\
+color: #969896\
+}\
+.ace-tomorrow-night-bright .ace_c9searchresults.ace_keyword {\
+color: #C2C280\
+}\
+.ace-tomorrow-night-bright .ace_indent-guide {\
+background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});                (function() {
+                    ace.require(["ace/theme/tomorrow_night_bright"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 82 - 58
web/71bbf2d4b6293b54d672c2812fa8323e.js → web/100f9b1846c1e1ecae19e0ca2fc8224c.js

@@ -1,97 +1,114 @@
-ace.define("ace/mode/ini_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from tool\tm bundles\ini.tmbundle\Syntaxes\Ini.plist (uuid: ) */
+ace.define("ace/mode/ini_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
 var escapeRe = "\\\\(?:[\\\\0abtrn;#=:]|x[a-fA-F\\d]{4})";
-var IniHighlightRules = function () {
+
+var IniHighlightRules = function() {
     this.$rules = {
         start: [{
-                token: 'punctuation.definition.comment.ini',
-                regex: '#.*',
-                push_: [{
-                        token: 'comment.line.number-sign.ini',
-                        regex: '$|^',
-                        next: 'pop'
-                    }, {
-                        defaultToken: 'comment.line.number-sign.ini'
-                    }]
+            token: 'punctuation.definition.comment.ini',
+            regex: '#.*',
+            push_: [{
+                token: 'comment.line.number-sign.ini',
+                regex: '$|^',
+                next: 'pop'
             }, {
-                token: 'punctuation.definition.comment.ini',
-                regex: ';.*',
-                push_: [{
-                        token: 'comment.line.semicolon.ini',
-                        regex: '$|^',
-                        next: 'pop'
-                    }, {
-                        defaultToken: 'comment.line.semicolon.ini'
-                    }]
+                defaultToken: 'comment.line.number-sign.ini'
+            }]
+        }, {
+            token: 'punctuation.definition.comment.ini',
+            regex: ';.*',
+            push_: [{
+                token: 'comment.line.semicolon.ini',
+                regex: '$|^',
+                next: 'pop'
             }, {
-                token: ['keyword.other.definition.ini', 'text', 'punctuation.separator.key-value.ini'],
-                regex: '\\b([a-zA-Z0-9_.-]+)\\b(\\s*)(=)'
+                defaultToken: 'comment.line.semicolon.ini'
+            }]
+        }, {
+            token: ['keyword.other.definition.ini', 'text', 'punctuation.separator.key-value.ini'],
+            regex: '\\b([a-zA-Z0-9_.-]+)\\b(\\s*)(=)'
+        }, {
+            token: ['punctuation.definition.entity.ini', 'constant.section.group-title.ini', 'punctuation.definition.entity.ini'],
+            regex: '^(\\[)(.*?)(\\])'
+        }, {
+            token: 'punctuation.definition.string.begin.ini',
+            regex: "'",
+            push: [{
+                token: 'punctuation.definition.string.end.ini',
+                regex: "'",
+                next: 'pop'
             }, {
-                token: ['punctuation.definition.entity.ini', 'constant.section.group-title.ini', 'punctuation.definition.entity.ini'],
-                regex: '^(\\[)(.*?)(\\])'
+                token: "constant.language.escape",
+                regex: escapeRe
             }, {
-                token: 'punctuation.definition.string.begin.ini',
-                regex: "'",
-                push: [{
-                        token: 'punctuation.definition.string.end.ini',
-                        regex: "'",
-                        next: 'pop'
-                    }, {
-                        token: "constant.language.escape",
-                        regex: escapeRe
-                    }, {
-                        defaultToken: 'string.quoted.single.ini'
-                    }]
+                defaultToken: 'string.quoted.single.ini'
+            }]
+        }, {
+            token: 'punctuation.definition.string.begin.ini',
+            regex: '"',
+            push: [{
+                token: "constant.language.escape",
+                regex: escapeRe
             }, {
-                token: 'punctuation.definition.string.begin.ini',
+                token: 'punctuation.definition.string.end.ini',
                 regex: '"',
-                push: [{
-                        token: "constant.language.escape",
-                        regex: escapeRe
-                    }, {
-                        token: 'punctuation.definition.string.end.ini',
-                        regex: '"',
-                        next: 'pop'
-                    }, {
-                        defaultToken: 'string.quoted.double.ini'
-                    }]
+                next: 'pop'
+            }, {
+                defaultToken: 'string.quoted.double.ini'
             }]
+        }]
     };
+
     this.normalizeRules();
 };
+
 IniHighlightRules.metaData = {
     fileTypes: ['ini', 'conf'],
     keyEquivalent: '^~I',
     name: 'Ini',
     scopeName: 'source.ini'
 };
+
+
 oop.inherits(IniHighlightRules, TextHighlightRules);
-exports.IniHighlightRules = IniHighlightRules;
 
+exports.IniHighlightRules = IniHighlightRules;
 });
 
-ace.define("ace/mode/folding/ini",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/ini",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var Range = require("../../range").Range;
 var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function () {
+
+var FoldMode = exports.FoldMode = function() {
 };
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
+
+(function() {
+
     this.foldingStartMarker = /^\s*\[([^\])]*)]\s*(?:$|[;#])/;
-    this.getFoldWidgetRange = function (session, foldStyle, row) {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row) {
         var re = this.foldingStartMarker;
         var line = session.getLine(row);
+        
         var m = line.match(re);
-        if (!m)
-            return;
+        
+        if (!m) return;
+        
         var startName = m[1] + ".";
+        
         var startColumn = line.length;
         var maxRow = session.getLength();
         var startRow = row;
         var endRow = row;
+
         while (++row < maxRow) {
             line = session.getLine(row);
             if (/^\s*$/.test(line))
@@ -99,35 +116,42 @@ oop.inherits(FoldMode, BaseFoldMode);
             m = line.match(re);
             if (m && m[1].lastIndexOf(startName, 0) !== 0)
                 break;
+
             endRow = row;
         }
+
         if (endRow > startRow) {
             var endColumn = session.getLine(endRow).length;
             return new Range(startRow, startColumn, endRow, endColumn);
         }
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/ini",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ini_highlight_rules","ace/mode/folding/ini"], function(require, exports, module){"use strict";
+ace.define("ace/mode/ini",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ini_highlight_rules","ace/mode/folding/ini"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var IniHighlightRules = require("./ini_highlight_rules").IniHighlightRules;
 var FoldMode = require("./folding/ini").FoldMode;
-var Mode = function () {
+
+var Mode = function() {
     this.HighlightRules = IniHighlightRules;
     this.foldingRules = new FoldMode();
     this.$behaviour = this.$defaultBehaviour;
 };
 oop.inherits(Mode, TextMode);
-(function () {
+
+(function() {
     this.lineCommentStart = ";";
     this.blockComment = null;
     this.$id = "ace/mode/ini";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });                (function() {
                     ace.require(["ace/mode/ini"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

文件差异内容过多而无法显示
+ 0 - 0
web/103d2d5aeb83325c62e06eeb03ce110f.js


文件差异内容过多而无法显示
+ 10 - 0
web/1084edaced97872890c9d87a9944cdcd.js


+ 125 - 0
web/10bc79414b62df132421027bbf5e5c3e.js

@@ -0,0 +1,125 @@
+ace.define("ace/theme/crimson_editor",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
+exports.isDark = false;
+exports.cssText = ".ace-crimson-editor .ace_gutter {\
+background: #ebebeb;\
+color: #333;\
+overflow : hidden;\
+}\
+.ace-crimson-editor .ace_gutter-layer {\
+width: 100%;\
+text-align: right;\
+}\
+.ace-crimson-editor .ace_print-margin {\
+width: 1px;\
+background: #e8e8e8;\
+}\
+.ace-crimson-editor {\
+background-color: #FFFFFF;\
+color: rgb(64, 64, 64);\
+}\
+.ace-crimson-editor .ace_cursor {\
+color: black;\
+}\
+.ace-crimson-editor .ace_invisible {\
+color: rgb(191, 191, 191);\
+}\
+.ace-crimson-editor .ace_identifier {\
+color: black;\
+}\
+.ace-crimson-editor .ace_keyword {\
+color: blue;\
+}\
+.ace-crimson-editor .ace_constant.ace_buildin {\
+color: rgb(88, 72, 246);\
+}\
+.ace-crimson-editor .ace_constant.ace_language {\
+color: rgb(255, 156, 0);\
+}\
+.ace-crimson-editor .ace_constant.ace_library {\
+color: rgb(6, 150, 14);\
+}\
+.ace-crimson-editor .ace_invalid {\
+text-decoration: line-through;\
+color: rgb(224, 0, 0);\
+}\
+.ace-crimson-editor .ace_fold {\
+}\
+.ace-crimson-editor .ace_support.ace_function {\
+color: rgb(192, 0, 0);\
+}\
+.ace-crimson-editor .ace_support.ace_constant {\
+color: rgb(6, 150, 14);\
+}\
+.ace-crimson-editor .ace_support.ace_type,\
+.ace-crimson-editor .ace_support.ace_class {\
+color: rgb(109, 121, 222);\
+}\
+.ace-crimson-editor .ace_keyword.ace_operator {\
+color: rgb(49, 132, 149);\
+}\
+.ace-crimson-editor .ace_string {\
+color: rgb(128, 0, 128);\
+}\
+.ace-crimson-editor .ace_comment {\
+color: rgb(76, 136, 107);\
+}\
+.ace-crimson-editor .ace_comment.ace_doc {\
+color: rgb(0, 102, 255);\
+}\
+.ace-crimson-editor .ace_comment.ace_doc.ace_tag {\
+color: rgb(128, 159, 191);\
+}\
+.ace-crimson-editor .ace_constant.ace_numeric {\
+color: rgb(0, 0, 64);\
+}\
+.ace-crimson-editor .ace_variable {\
+color: rgb(0, 64, 128);\
+}\
+.ace-crimson-editor .ace_xml-pe {\
+color: rgb(104, 104, 91);\
+}\
+.ace-crimson-editor .ace_marker-layer .ace_selection {\
+background: rgb(181, 213, 255);\
+}\
+.ace-crimson-editor .ace_marker-layer .ace_step {\
+background: rgb(252, 255, 0);\
+}\
+.ace-crimson-editor .ace_marker-layer .ace_stack {\
+background: rgb(164, 229, 101);\
+}\
+.ace-crimson-editor .ace_marker-layer .ace_bracket {\
+margin: -1px 0 0 -1px;\
+border: 1px solid rgb(192, 192, 192);\
+}\
+.ace-crimson-editor .ace_marker-layer .ace_active-line {\
+background: rgb(232, 242, 254);\
+}\
+.ace-crimson-editor .ace_gutter-active-line {\
+background-color : #dcdcdc;\
+}\
+.ace-crimson-editor .ace_meta.ace_tag {\
+color:rgb(28, 2, 255);\
+}\
+.ace-crimson-editor .ace_marker-layer .ace_selected-word {\
+background: rgb(250, 250, 255);\
+border: 1px solid rgb(200, 200, 250);\
+}\
+.ace-crimson-editor .ace_string.ace_regex {\
+color: rgb(192, 0, 192);\
+}\
+.ace-crimson-editor .ace_indent-guide {\
+background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
+}";
+
+exports.cssClass = "ace-crimson-editor";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});                (function() {
+                    ace.require(["ace/theme/crimson_editor"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 5931 - 0
web/117389396b5ae8131c2a299bfc802c7a.js

@@ -0,0 +1,5931 @@
+ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/dom","ace/lib/oop","ace/lib/keys","ace/lib/event","ace/search","ace/lib/useragent","ace/search_highlight","ace/commands/multi_select_commands","ace/mode/text","ace/multi_select"], function(require, exports, module) {
+  'use strict';
+
+  function log() {
+    var d = "";
+    function format(p) {
+      if (typeof p != "object")
+        return p + "";
+      if ("line" in p) {
+        return p.line + ":" + p.ch;
+      }
+      if ("anchor" in p) {
+        return format(p.anchor) + "->" + format(p.head);
+      }
+      if (Array.isArray(p))
+        return "[" + p.map(function(x) {
+          return format(x);
+        }) + "]";
+      return JSON.stringify(p);
+    }
+    for (var i = 0; i < arguments.length; i++) {
+      var p = arguments[i];
+      var f = format(p);
+      d += f + "  ";
+    }
+    console.log(d);
+  }
+  var Range = require("../range").Range;
+  var EventEmitter = require("../lib/event_emitter").EventEmitter;
+  var dom = require("../lib/dom");
+  var oop = require("../lib/oop");
+  var KEYS = require("../lib/keys");
+  var event = require("../lib/event");
+  var Search = require("../search").Search;
+  var useragent = require("../lib/useragent");
+  var SearchHighlight = require("../search_highlight").SearchHighlight;
+  var multiSelectCommands = require("../commands/multi_select_commands");
+  var TextModeTokenRe = require("../mode/text").Mode.prototype.tokenRe;
+  require("../multi_select");
+
+  var CodeMirror = function(ace) {
+    this.ace = ace;
+    this.state = {};
+    this.marks = {};
+    this.$uid = 0;
+    this.onChange = this.onChange.bind(this);
+    this.onSelectionChange = this.onSelectionChange.bind(this);
+    this.onBeforeEndOperation = this.onBeforeEndOperation.bind(this);
+    this.ace.on('change', this.onChange);
+    this.ace.on('changeSelection', this.onSelectionChange);
+    this.ace.on('beforeEndOperation', this.onBeforeEndOperation);
+  };
+  CodeMirror.Pos = function(line, ch) {
+    if (!(this instanceof Pos)) return new Pos(line, ch);
+    this.line = line; this.ch = ch;
+  };
+  CodeMirror.defineOption = function(name, val, setter) {};
+  CodeMirror.commands = {
+    redo: function(cm) { cm.ace.redo(); },
+    undo: function(cm) { cm.ace.undo(); },
+    newlineAndIndent: function(cm) { cm.ace.insert("\n"); }
+  };
+  CodeMirror.keyMap = {};
+  CodeMirror.addClass = CodeMirror.rmClass = function() {};
+  CodeMirror.e_stop = CodeMirror.e_preventDefault = event.stopEvent;
+  CodeMirror.keyName = function(e) {
+    var key = (KEYS[e.keyCode] || e.key || "");
+    if (key.length == 1) key = key.toUpperCase();
+    key = event.getModifierString(e).replace(/(^|-)\w/g, function(m) {
+      return m.toUpperCase();
+    }) + key;
+    return key;
+  };
+  CodeMirror.keyMap['default'] = function(key) {
+    return function(cm) {
+      var cmd = cm.ace.commands.commandKeyBinding[key.toLowerCase()];
+      return cmd && cm.ace.execCommand(cmd) !== false;
+    };
+  };
+  CodeMirror.lookupKey = function lookupKey(key, map, handle) {
+    if (!map) map = "default";
+    if (typeof map == "string")
+      map = CodeMirror.keyMap[map];
+    var found = typeof map == "function" ? map(key) : map[key];
+    if (found === false) return "nothing";
+    if (found === "...") return "multi";
+    if (found != null && handle(found)) return "handled";
+
+    if (map.fallthrough) {
+      if (!Array.isArray(map.fallthrough))
+        return lookupKey(key, map.fallthrough, handle);
+      for (var i = 0; i < map.fallthrough.length; i++) {
+        var result = lookupKey(key, map.fallthrough[i], handle);
+        if (result) return result;
+      }
+    }
+  };
+
+  CodeMirror.signal = function(o, name, e) { return o._signal(name, e) };
+  CodeMirror.on = event.addListener;
+  CodeMirror.off = event.removeListener;
+  CodeMirror.isWordChar = function(ch) {
+    if (ch < "\x7f") return /^\w$/.test(ch);
+    TextModeTokenRe.lastIndex = 0;
+    return TextModeTokenRe.test(ch);
+  };
+  
+(function() {
+  oop.implement(CodeMirror.prototype, EventEmitter);
+  
+  this.destroy = function() {
+    this.ace.off('change', this.onChange);
+    this.ace.off('changeSelection', this.onSelectionChange);
+    this.ace.off('beforeEndOperation', this.onBeforeEndOperation);
+    this.removeOverlay();
+  };
+  this.virtualSelectionMode = function() {
+    return this.ace.inVirtualSelectionMode && this.ace.selection.index;
+  };
+  this.onChange = function(delta) {
+    var change = { text: delta.action[0] == 'i' ? delta.lines : [] };
+    var curOp = this.curOp = this.curOp || {};
+    if (!curOp.changeHandlers)
+      curOp.changeHandlers = this._eventRegistry["change"] && this._eventRegistry["change"].slice();
+    if (!curOp.lastChange) {
+      curOp.lastChange = curOp.change = change;
+    } else {
+      curOp.lastChange.next = curOp.lastChange = change;
+    }
+    this.$updateMarkers(delta);
+  };
+  this.onSelectionChange = function() {
+    var curOp = this.curOp = this.curOp || {};
+    if (!curOp.cursorActivityHandlers)
+      curOp.cursorActivityHandlers = this._eventRegistry["cursorActivity"] && this._eventRegistry["cursorActivity"].slice();
+    this.curOp.cursorActivity = true;
+    if (this.ace.inMultiSelectMode) {
+      this.ace.keyBinding.removeKeyboardHandler(multiSelectCommands.keyboardHandler);
+    }
+  };
+  this.operation = function(fn, force) {
+    if (!force && this.curOp || force && this.curOp && this.curOp.force) {
+      return fn();
+    }
+    if (force || !this.ace.curOp) {
+      if (this.curOp)
+        this.onBeforeEndOperation();
+    }
+    if (!this.ace.curOp) {
+      var prevOp = this.ace.prevOp;
+      this.ace.startOperation({
+        command: { name: "vim",  scrollIntoView: "cursor" }
+      });
+    }
+    var curOp = this.curOp = this.curOp || {};
+    this.curOp.force = force;
+    var result = fn();
+    if (this.ace.curOp && this.ace.curOp.command.name == "vim") {
+      if (this.state.dialog)
+        this.ace.curOp.command.scrollIntoView = false;
+      this.ace.endOperation();
+      if (!curOp.cursorActivity && !curOp.lastChange && prevOp)
+        this.ace.prevOp = prevOp;
+    }
+    if (force || !this.ace.curOp) {
+      if (this.curOp)
+        this.onBeforeEndOperation();
+    }
+    return result;
+  };
+  this.onBeforeEndOperation = function() {
+    var op = this.curOp;
+    if (op) {
+      if (op.change) { this.signal("change", op.change, op); }
+      if (op && op.cursorActivity) { this.signal("cursorActivity", null, op); }
+      this.curOp = null;
+    }
+  };
+
+  this.signal = function(eventName, e, handlers) {
+    var listeners = handlers ? handlers[eventName + "Handlers"]
+        : (this._eventRegistry || {})[eventName];
+    if (!listeners)
+        return;
+    listeners = listeners.slice();
+    for (var i=0; i<listeners.length; i++)
+        listeners[i](this, e);
+  };
+  this.firstLine = function() { return 0; };
+  this.lastLine = function() { return this.ace.session.getLength() - 1; };
+  this.lineCount = function() { return this.ace.session.getLength(); };
+  this.setCursor = function(line, ch) {
+    if (typeof line === 'object') {
+      ch = line.ch;
+      line = line.line;
+    }
+    if (!this.ace.inVirtualSelectionMode)
+      this.ace.exitMultiSelectMode();
+    this.ace.session.unfold({row: line, column: ch});
+    this.ace.selection.moveTo(line, ch);
+  };
+  this.getCursor = function(p) {
+    var sel = this.ace.selection;
+    var pos = p == 'anchor' ? (sel.isEmpty() ? sel.lead : sel.anchor) :
+        p == 'head' || !p ? sel.lead : sel.getRange()[p];
+    return toCmPos(pos);
+  };
+  this.listSelections = function(p) {
+    var ranges = this.ace.multiSelect.rangeList.ranges;
+    if (!ranges.length || this.ace.inVirtualSelectionMode)
+      return [{anchor: this.getCursor('anchor'), head: this.getCursor('head')}];
+    return ranges.map(function(r) {
+      return {
+        anchor: this.clipPos(toCmPos(r.cursor == r.end ? r.start : r.end)),
+        head: this.clipPos(toCmPos(r.cursor))
+      };
+    }, this);
+  };
+  this.setSelections = function(p, primIndex) {
+    var sel = this.ace.multiSelect;
+    var ranges = p.map(function(x) {
+      var anchor = toAcePos(x.anchor);
+      var head = toAcePos(x.head);
+      var r = Range.comparePoints(anchor, head) < 0
+        ? new Range.fromPoints(anchor, head)
+        : new Range.fromPoints(head, anchor);
+      r.cursor = Range.comparePoints(r.start, head) ? r.end : r.start;
+      return r;
+    });
+    
+    if (this.ace.inVirtualSelectionMode) {
+      this.ace.selection.fromOrientedRange(ranges[0]);
+      return;
+    }
+    if (!primIndex) {
+        ranges = ranges.reverse();
+    } else if (ranges[primIndex]) {
+       ranges.push(ranges.splice(primIndex, 1)[0]);
+    }
+    sel.toSingleRange(ranges[0].clone());
+    var session = this.ace.session;
+    for (var i = 0; i < ranges.length; i++) {
+      var range = session.$clipRangeToDocument(ranges[i]); // todo why ace doesn't do this?
+      sel.addRange(range);
+    }
+  };
+  this.setSelection = function(a, h, options) {
+    var sel = this.ace.selection;
+    sel.moveTo(a.line, a.ch);
+    sel.selectTo(h.line, h.ch);
+    if (options && options.origin == '*mouse') {
+      this.onBeforeEndOperation();
+    }
+  };
+  this.somethingSelected = function(p) {
+    return !this.ace.selection.isEmpty();
+  };
+  this.clipPos = function(p) {
+    var pos = this.ace.session.$clipPositionToDocument(p.line, p.ch);
+    return toCmPos(pos);
+  };
+  this.markText = function(cursor) {
+    return {clear: function() {}, find: function() {}};
+  };
+  this.$updateMarkers = function(delta) {
+    var isInsert = delta.action == "insert";
+    var start = delta.start;
+    var end = delta.end;
+    var rowShift = (end.row - start.row) * (isInsert ? 1 : -1);
+    var colShift = (end.column - start.column) * (isInsert ? 1 : -1);
+    if (isInsert) end = start;
+    
+    for (var i in this.marks) {
+      var point = this.marks[i];
+      var cmp = Range.comparePoints(point, start);
+      if (cmp < 0) {
+        continue; // delta starts after the range
+      }
+      if (cmp === 0) {
+        if (isInsert) {
+          if (point.bias == 1) {
+            cmp = 1;
+          } else {
+            point.bias = -1;
+            continue;
+          }
+        }
+      }
+      var cmp2 = isInsert ? cmp : Range.comparePoints(point, end);
+      if (cmp2 > 0) {
+        point.row += rowShift;
+        point.column += point.row == end.row ? colShift : 0;
+        continue;
+      }
+      if (!isInsert && cmp2 <= 0) {
+        point.row = start.row;
+        point.column = start.column;
+        if (cmp2 === 0)
+          point.bias = 1;
+      }
+    }
+  };
+  var Marker = function(cm, id, row, column) {
+    this.cm = cm;
+    this.id = id;
+    this.row = row;
+    this.column = column;
+    cm.marks[this.id] = this;
+  };
+  Marker.prototype.clear = function() { delete this.cm.marks[this.id] };
+  Marker.prototype.find = function() { return toCmPos(this) };
+  this.setBookmark = function(cursor, options) {
+    var bm = new Marker(this, this.$uid++, cursor.line, cursor.ch);
+    if (!options || !options.insertLeft)
+      bm.$insertRight = true;
+    this.marks[bm.id] = bm;
+    return bm;
+  };
+  this.moveH = function(increment, unit) {
+    if (unit == 'char') {
+      var sel = this.ace.selection;
+      sel.clearSelection();
+      sel.moveCursorBy(0, increment);
+    }
+  };
+  this.findPosV = function(start, amount, unit, goalColumn) {
+    if (unit == 'page') {
+      var renderer = this.ace.renderer;
+      var config = renderer.layerConfig;
+      amount = amount * Math.floor(config.height / config.lineHeight);
+      unit = 'line';
+    }
+    if (unit == 'line') {
+      var screenPos = this.ace.session.documentToScreenPosition(start.line, start.ch);
+      if (goalColumn != null)
+        screenPos.column = goalColumn;
+      screenPos.row += amount;
+      screenPos.row = Math.min(Math.max(0, screenPos.row), this.ace.session.getScreenLength() - 1);
+      var pos = this.ace.session.screenToDocumentPosition(screenPos.row, screenPos.column);
+      return toCmPos(pos);
+    } else {
+      debugger;
+    }
+  };
+  this.charCoords = function(pos, mode) {
+    if (mode == 'div' || !mode) {
+      var sc = this.ace.session.documentToScreenPosition(pos.line, pos.ch);
+      return {left: sc.column, top: sc.row};
+    }if (mode == 'local') {
+      var renderer = this.ace.renderer;
+      var sc = this.ace.session.documentToScreenPosition(pos.line, pos.ch);
+      var lh = renderer.layerConfig.lineHeight;
+      var cw = renderer.layerConfig.characterWidth;
+      var top = lh * sc.row;
+      return {left: sc.column * cw, top: top, bottom: top + lh};
+    }
+  };
+  this.coordsChar = function(pos, mode) {
+    var renderer = this.ace.renderer;
+    if (mode == 'local') {
+      var row = Math.max(0, Math.floor(pos.top / renderer.lineHeight));
+      var col = Math.max(0, Math.floor(pos.left / renderer.characterWidth));
+      var ch = renderer.session.screenToDocumentPosition(row, col);
+      return toCmPos(ch);
+    } else if (mode == 'div') {
+      throw "not implemented";
+    }
+  };
+  this.getSearchCursor = function(query, pos, caseFold) {
+    var caseSensitive = false;
+    var isRegexp = false;
+    if (query instanceof RegExp && !query.global) {
+      caseSensitive = !query.ignoreCase;
+      query = query.source;
+      isRegexp = true;
+    }
+    var search = new Search();
+    if (pos.ch == undefined) pos.ch = Number.MAX_VALUE;
+    var acePos = {row: pos.line, column: pos.ch};
+    var cm = this;
+    var last = null;
+    return {
+      findNext: function() { return this.find(false) },
+      findPrevious: function() {return this.find(true) },
+      find: function(back) {
+        search.setOptions({
+          needle: query,
+          caseSensitive: caseSensitive,
+          wrap: false,
+          backwards: back,
+          regExp: isRegexp,
+          start: last || acePos
+        });
+        var range = search.find(cm.ace.session);
+        if (range && range.isEmpty()) {
+          if (cm.getLine(range.start.row).length == range.start.column) {
+            search.$options.start = range;
+            range = search.find(cm.ace.session);
+          }
+        }
+        last = range;
+        return last;
+      },
+      from: function() { return last && toCmPos(last.start) },
+      to: function() { return last && toCmPos(last.end) },
+      replace: function(text) {
+        if (last) {
+          last.end = cm.ace.session.doc.replace(last, text);
+        }
+      }
+    };
+  };
+  this.scrollTo = function(x, y) {
+    var renderer = this.ace.renderer;
+    var config = renderer.layerConfig;
+    var maxHeight = config.maxHeight;
+    maxHeight -= (renderer.$size.scrollerHeight - renderer.lineHeight) * renderer.$scrollPastEnd;
+    if (y != null) this.ace.session.setScrollTop(Math.max(0, Math.min(y, maxHeight)));
+    if (x != null) this.ace.session.setScrollLeft(Math.max(0, Math.min(x, config.width)));
+  };
+  this.scrollInfo = function() { return 0; };
+  this.scrollIntoView = function(pos, margin) {
+    if (pos) {
+      var renderer = this.ace.renderer;
+      var viewMargin = { "top": 0, "bottom": margin };
+      renderer.scrollCursorIntoView(toAcePos(pos),
+        (renderer.lineHeight * 2) / renderer.$size.scrollerHeight, viewMargin);
+    }
+  };
+  this.getLine = function(row) { return this.ace.session.getLine(row) };
+  this.getRange = function(s, e) {
+    return this.ace.session.getTextRange(new Range(s.line, s.ch, e.line, e.ch));
+  };
+  this.replaceRange = function(text, s, e) {
+    if (!e) e = s;
+    return this.ace.session.replace(new Range(s.line, s.ch, e.line, e.ch), text);
+  };
+  this.replaceSelection = 
+  this.replaceSelections = function(p) {
+    var sel = this.ace.selection;
+    if (this.ace.inVirtualSelectionMode) {
+      this.ace.session.replace(sel.getRange(), p[0] || "");
+      return;
+    }
+    sel.inVirtualSelectionMode = true;
+    var ranges = sel.rangeList.ranges;
+    if (!ranges.length) ranges = [this.ace.multiSelect.getRange()];
+    for (var i = ranges.length; i--;)
+       this.ace.session.replace(ranges[i], p[i] || "");
+    sel.inVirtualSelectionMode = false;
+  };
+  this.getSelection = function() {
+    return this.ace.getSelectedText();
+  };
+  this.getSelections = function() {
+    return this.listSelections().map(function(x) {
+      return this.getRange(x.anchor, x.head);
+    }, this);
+  };
+  this.getInputField = function() {
+    return this.ace.textInput.getElement();
+  };
+  this.getWrapperElement = function() {
+    return this.ace.container;
+  };
+  var optMap = {
+    indentWithTabs: "useSoftTabs",
+    indentUnit: "tabSize",
+    tabSize: "tabSize",
+    firstLineNumber: "firstLineNumber",
+    readOnly: "readOnly"
+  };
+  this.setOption = function(name, val) {
+    this.state[name] = val;
+    switch (name) {
+      case 'indentWithTabs':
+        name = optMap[name];
+        val = !val;
+      break;
+      case 'keyMap':
+        this.state.$keyMap = val;
+        return;
+      break;
+      default:
+        name = optMap[name];
+    }
+    if (name)
+      this.ace.setOption(name, val);
+  };
+  this.getOption = function(name, val) {
+    var aceOpt = optMap[name];
+    if (aceOpt)
+      val = this.ace.getOption(aceOpt);
+    switch (name) {
+      case 'indentWithTabs':
+        name = optMap[name];
+        return !val;
+      case 'keyMap':
+        return this.state.$keyMap;
+    }
+    return aceOpt ? val : this.state[name];
+  };
+  this.toggleOverwrite = function(on) {
+    this.state.overwrite = on;
+    return this.ace.setOverwrite(on);
+  };
+  this.addOverlay = function(o) {
+    if (!this.$searchHighlight || !this.$searchHighlight.session) {
+      var highlight = new SearchHighlight(null, "ace_highlight-marker", "text");
+      var marker = this.ace.session.addDynamicMarker(highlight);
+      highlight.id = marker.id;
+      highlight.session = this.ace.session;
+      highlight.destroy = function(o) {
+        highlight.session.off("change", highlight.updateOnChange);
+        highlight.session.off("changeEditor", highlight.destroy);
+        highlight.session.removeMarker(highlight.id);
+        highlight.session = null;
+      };
+      highlight.updateOnChange = function(delta) {
+        var row = delta.start.row;
+        if (row == delta.end.row) highlight.cache[row] = undefined;
+        else highlight.cache.splice(row, highlight.cache.length);
+      };
+      highlight.session.on("changeEditor", highlight.destroy);
+      highlight.session.on("change", highlight.updateOnChange);
+    }
+    var re = new RegExp(o.query.source, "gmi");
+    this.$searchHighlight = o.highlight = highlight;
+    this.$searchHighlight.setRegexp(re);
+    this.ace.renderer.updateBackMarkers();
+  };
+  this.removeOverlay = function(o) {
+    if (this.$searchHighlight && this.$searchHighlight.session) {
+      this.$searchHighlight.destroy();
+    }
+  };
+  this.getScrollInfo = function() {
+    var renderer = this.ace.renderer;
+    var config = renderer.layerConfig;
+    return {
+      left: renderer.scrollLeft,
+      top: renderer.scrollTop,
+      height: config.maxHeight,
+      width: config.width,
+      clientHeight: config.height,
+      clientWidth: config.width
+    };
+  };
+  this.getValue = function() {
+    return this.ace.getValue();
+  };
+  this.setValue = function(v) {
+    return this.ace.setValue(v, -1);
+  };
+  this.getTokenTypeAt = function(pos) {
+    var token = this.ace.session.getTokenAt(pos.line, pos.ch);
+    return token && /comment|string/.test(token.type) ? "string" : "";
+  };
+  this.findMatchingBracket = function(pos) {
+    var m = this.ace.session.findMatchingBracket(toAcePos(pos));
+    return {to: m && toCmPos(m)};
+  };
+  this.indentLine = function(line, method) {
+    if (method === true)
+        this.ace.session.indentRows(line, line, "\t");
+    else if (method === false)
+        this.ace.session.outdentRows(new Range(line, 0, line, 0));
+  };
+  this.indexFromPos = function(pos) {
+    return this.ace.session.doc.positionToIndex(toAcePos(pos));
+  };
+  this.posFromIndex = function(index) {
+    return toCmPos(this.ace.session.doc.indexToPosition(index));
+  };
+  this.focus = function(index) {
+    return this.ace.textInput.focus();
+  };
+  this.blur = function(index) {
+    return this.ace.blur();
+  };
+  this.defaultTextHeight = function(index) {
+    return this.ace.renderer.layerConfig.lineHeight;
+  };
+  this.scanForBracket = function(pos, dir, _, options) {
+    var re = options.bracketRegex.source;
+    var tokenRe = /paren|text|operator|tag/;
+    if (dir == 1) {
+      var m = this.ace.session.$findClosingBracket(re.slice(1, 2), toAcePos(pos), tokenRe);
+    } else {
+      var m = this.ace.session.$findOpeningBracket(re.slice(-2, -1), {row: pos.line, column: pos.ch + 1}, tokenRe);
+    }
+    return m && {pos: toCmPos(m)};
+  };
+  this.refresh = function() {
+    return this.ace.resize(true);
+  };
+  this.getMode = function() {
+    return { name : this.getOption("mode") };
+  };
+  this.execCommand = function(name) {
+    if (name == "indentAuto") this.ace.execCommand("autoindent");
+    else console.log(name + " is not implemented");
+  };
+}).call(CodeMirror.prototype);
+  function toAcePos(cmPos) {
+    return {row: cmPos.line, column: cmPos.ch};
+  }
+  function toCmPos(acePos) {
+    return new Pos(acePos.row, acePos.column);
+  }
+
+  var StringStream = CodeMirror.StringStream = function(string, tabSize) {
+    this.pos = this.start = 0;
+    this.string = string;
+    this.tabSize = tabSize || 8;
+    this.lastColumnPos = this.lastColumnValue = 0;
+    this.lineStart = 0;
+  };
+
+  StringStream.prototype = {
+    eol: function() {return this.pos >= this.string.length;},
+    sol: function() {return this.pos == this.lineStart;},
+    peek: function() {return this.string.charAt(this.pos) || undefined;},
+    next: function() {
+      if (this.pos < this.string.length)
+        return this.string.charAt(this.pos++);
+    },
+    eat: function(match) {
+      var ch = this.string.charAt(this.pos);
+      if (typeof match == "string") var ok = ch == match;
+      else var ok = ch && (match.test ? match.test(ch) : match(ch));
+      if (ok) {++this.pos; return ch;}
+    },
+    eatWhile: function(match) {
+      var start = this.pos;
+      while (this.eat(match)){}
+      return this.pos > start;
+    },
+    eatSpace: function() {
+      var start = this.pos;
+      while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
+      return this.pos > start;
+    },
+    skipToEnd: function() {this.pos = this.string.length;},
+    skipTo: function(ch) {
+      var found = this.string.indexOf(ch, this.pos);
+      if (found > -1) {this.pos = found; return true;}
+    },
+    backUp: function(n) {this.pos -= n;},
+    column: function() {
+      throw "not implemented";
+    },
+    indentation: function() {
+      throw "not implemented";
+    },
+    match: function(pattern, consume, caseInsensitive) {
+      if (typeof pattern == "string") {
+        var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
+        var substr = this.string.substr(this.pos, pattern.length);
+        if (cased(substr) == cased(pattern)) {
+          if (consume !== false) this.pos += pattern.length;
+          return true;
+        }
+      } else {
+        var match = this.string.slice(this.pos).match(pattern);
+        if (match && match.index > 0) return null;
+        if (match && consume !== false) this.pos += match[0].length;
+        return match;
+      }
+    },
+    current: function(){return this.string.slice(this.start, this.pos);},
+    hideFirstChars: function(n, inner) {
+      this.lineStart += n;
+      try { return inner(); }
+      finally { this.lineStart -= n; }
+    }
+  };
+CodeMirror.defineExtension = function(name, fn) {
+  CodeMirror.prototype[name] = fn;
+};
+dom.importCssString(".normal-mode .ace_cursor{\
+    border: none;\
+    background-color: rgba(255,0,0,0.5);\
+}\
+.normal-mode .ace_hidden-cursors .ace_cursor{\
+  background-color: transparent;\
+  border: 1px solid red;\
+  opacity: 0.7\
+}\
+.ace_dialog {\
+  position: absolute;\
+  left: 0; right: 0;\
+  background: inherit;\
+  z-index: 15;\
+  padding: .1em .8em;\
+  overflow: hidden;\
+  color: inherit;\
+}\
+.ace_dialog-top {\
+  border-bottom: 1px solid #444;\
+  top: 0;\
+}\
+.ace_dialog-bottom {\
+  border-top: 1px solid #444;\
+  bottom: 0;\
+}\
+.ace_dialog input {\
+  border: none;\
+  outline: none;\
+  background: transparent;\
+  width: 20em;\
+  color: inherit;\
+  font-family: monospace;\
+}", "vimMode");
+(function() {
+  function dialogDiv(cm, template, bottom) {
+    var wrap = cm.ace.container;
+    var dialog;
+    dialog = wrap.appendChild(document.createElement("div"));
+    if (bottom)
+      dialog.className = "ace_dialog ace_dialog-bottom";
+    else
+      dialog.className = "ace_dialog ace_dialog-top";
+
+    if (typeof template == "string") {
+      dialog.innerHTML = template;
+    } else { // Assuming it's a detached DOM element.
+      dialog.appendChild(template);
+    }
+    return dialog;
+  }
+
+  function closeNotification(cm, newVal) {
+    if (cm.state.currentNotificationClose)
+      cm.state.currentNotificationClose();
+    cm.state.currentNotificationClose = newVal;
+  }
+
+  CodeMirror.defineExtension("openDialog", function(template, callback, options) {
+    if (this.virtualSelectionMode()) return;
+    if (!options) options = {};
+
+    closeNotification(this, null);
+
+    var dialog = dialogDiv(this, template, options.bottom);
+    var closed = false, me = this;
+    this.state.dialog = dialog;
+    function close(newVal) {
+      if (typeof newVal == 'string') {
+        inp.value = newVal;
+      } else {
+        if (closed) return;
+        
+        if (newVal && newVal.type == "blur") {
+          if (document.activeElement === inp)
+            return;
+        }
+        
+        me.state.dialog = null;
+        closed = true;
+        dialog.parentNode.removeChild(dialog);
+        me.focus();
+
+        if (options.onClose) options.onClose(dialog);
+      }
+    }
+
+    var inp = dialog.getElementsByTagName("input")[0], button;
+    if (inp) {
+      if (options.value) {
+        inp.value = options.value;
+        if (options.selectValueOnOpen !== false) inp.select();
+      }
+
+      if (options.onInput)
+        CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);});
+      if (options.onKeyUp)
+        CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);});
+
+      CodeMirror.on(inp, "keydown", function(e) {
+        if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }
+        if (e.keyCode == 13) callback(inp.value);
+        if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {
+          inp.blur();
+          CodeMirror.e_stop(e);
+          close();
+        }
+      });
+
+      if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close);
+
+      inp.focus();
+    } else if (button = dialog.getElementsByTagName("button")[0]) {
+      CodeMirror.on(button, "click", function() {
+        close();
+        me.focus();
+      });
+
+      if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close);
+
+      button.focus();
+    }
+    return close;
+  });
+
+  CodeMirror.defineExtension("openNotification", function(template, options) {
+    if (this.virtualSelectionMode()) return;
+    closeNotification(this, close);
+    var dialog = dialogDiv(this, template, options && options.bottom);
+    var closed = false, doneTimer;
+    var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000;
+
+    function close() {
+      if (closed) return;
+      closed = true;
+      clearTimeout(doneTimer);
+      dialog.parentNode.removeChild(dialog);
+    }
+
+    CodeMirror.on(dialog, 'click', function(e) {
+      CodeMirror.e_preventDefault(e);
+      close();
+    });
+
+    if (duration)
+      doneTimer = setTimeout(close, duration);
+
+    return close;
+  });
+})();
+
+  
+  var defaultKeymap = [
+    { keys: '<Left>', type: 'keyToKey', toKeys: 'h' },
+    { keys: '<Right>', type: 'keyToKey', toKeys: 'l' },
+    { keys: '<Up>', type: 'keyToKey', toKeys: 'k' },
+    { keys: '<Down>', type: 'keyToKey', toKeys: 'j' },
+    { keys: '<Space>', type: 'keyToKey', toKeys: 'l' },
+    { keys: '<BS>', type: 'keyToKey', toKeys: 'h', context: 'normal'},
+    { keys: '<Del>', type: 'keyToKey', toKeys: 'x', context: 'normal'},
+    { keys: '<C-Space>', type: 'keyToKey', toKeys: 'W' },
+    { keys: '<C-BS>', type: 'keyToKey', toKeys: 'B', context: 'normal' },
+    { keys: '<S-Space>', type: 'keyToKey', toKeys: 'w' },
+    { keys: '<S-BS>', type: 'keyToKey', toKeys: 'b', context: 'normal' },
+    { keys: '<C-n>', type: 'keyToKey', toKeys: 'j' },
+    { keys: '<C-p>', type: 'keyToKey', toKeys: 'k' },
+    { keys: '<C-[>', type: 'keyToKey', toKeys: '<Esc>' },
+    { keys: '<C-c>', type: 'keyToKey', toKeys: '<Esc>' },
+    { keys: '<C-[>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
+    { keys: '<C-c>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
+    { keys: '<C-Esc>', type: 'keyToKey', toKeys: '<Esc>' }, // ace_patch ipad keyboard sends C-Esc instead of C-[
+    { keys: '<C-Esc>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
+    { keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' },
+    { keys: 's', type: 'keyToKey', toKeys: 'c', context: 'visual'},
+    { keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' },
+    { keys: 'S', type: 'keyToKey', toKeys: 'VdO', context: 'visual' },
+    { keys: '<Home>', type: 'keyToKey', toKeys: '0' },
+    { keys: '<End>', type: 'keyToKey', toKeys: '$' },
+    { keys: '<PageUp>', type: 'keyToKey', toKeys: '<C-b>' },
+    { keys: '<PageDown>', type: 'keyToKey', toKeys: '<C-f>' },
+    { keys: '<CR>', type: 'keyToKey', toKeys: 'j^', context: 'normal' },
+    { keys: '<Ins>', type: 'action', action: 'toggleOverwrite', context: 'insert' },
+    { keys: 'H', type: 'motion', motion: 'moveToTopLine', motionArgs: { linewise: true, toJumplist: true }},
+    { keys: 'M', type: 'motion', motion: 'moveToMiddleLine', motionArgs: { linewise: true, toJumplist: true }},
+    { keys: 'L', type: 'motion', motion: 'moveToBottomLine', motionArgs: { linewise: true, toJumplist: true }},
+    { keys: 'h', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: false }},
+    { keys: 'l', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: true }},
+    { keys: 'j', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, linewise: true }},
+    { keys: 'k', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, linewise: true }},
+    { keys: 'gj', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: true }},
+    { keys: 'gk', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: false }},
+    { keys: 'w', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false }},
+    { keys: 'W', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false, bigWord: true }},
+    { keys: 'e', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, inclusive: true }},
+    { keys: 'E', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, bigWord: true, inclusive: true }},
+    { keys: 'b', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }},
+    { keys: 'B', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false, bigWord: true }},
+    { keys: 'ge', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, inclusive: true }},
+    { keys: 'gE', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, bigWord: true, inclusive: true }},
+    { keys: '{', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: false, toJumplist: true }},
+    { keys: '}', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: true, toJumplist: true }},
+    { keys: '(', type: 'motion', motion: 'moveBySentence', motionArgs: { forward: false }},
+    { keys: ')', type: 'motion', motion: 'moveBySentence', motionArgs: { forward: true }},
+    { keys: '<C-f>', type: 'motion', motion: 'moveByPage', motionArgs: { forward: true }},
+    { keys: '<C-b>', type: 'motion', motion: 'moveByPage', motionArgs: { forward: false }},
+    { keys: '<C-d>', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: true, explicitRepeat: true }},
+    { keys: '<C-u>', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: false, explicitRepeat: true }},
+    { keys: 'gg', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true }},
+    { keys: 'G', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true }},
+    { keys: '0', type: 'motion', motion: 'moveToStartOfLine' },
+    { keys: '^', type: 'motion', motion: 'moveToFirstNonWhiteSpaceCharacter' },
+    { keys: '+', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true }},
+    { keys: '-', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, toFirstChar:true }},
+    { keys: '_', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true, repeatOffset:-1 }},
+    { keys: '$', type: 'motion', motion: 'moveToEol', motionArgs: { inclusive: true }},
+    { keys: '%', type: 'motion', motion: 'moveToMatchedSymbol', motionArgs: { inclusive: true, toJumplist: true }},
+    { keys: 'f<character>', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: true , inclusive: true }},
+    { keys: 'F<character>', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: false }},
+    { keys: 't<character>', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: true, inclusive: true }},
+    { keys: 'T<character>', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: false }},
+    { keys: ';', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: true }},
+    { keys: ',', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: false }},
+    { keys: '\'<character>', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true, linewise: true}},
+    { keys: '`<character>', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true}},
+    { keys: ']`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true } },
+    { keys: '[`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false } },
+    { keys: ']\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true, linewise: true } },
+    { keys: '[\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false, linewise: true } },
+    { keys: ']p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true, matchIndent: true}},
+    { keys: '[p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true, matchIndent: true}},
+    { keys: ']<character>', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: true, toJumplist: true}},
+    { keys: '[<character>', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: false, toJumplist: true}},
+    { keys: '|', type: 'motion', motion: 'moveToColumn'},
+    { keys: 'o', type: 'motion', motion: 'moveToOtherHighlightedEnd', context:'visual'},
+    { keys: 'O', type: 'motion', motion: 'moveToOtherHighlightedEnd', motionArgs: {sameLine: true}, context:'visual'},
+    { keys: 'd', type: 'operator', operator: 'delete' },
+    { keys: 'y', type: 'operator', operator: 'yank' },
+    { keys: 'c', type: 'operator', operator: 'change' },
+    { keys: '=', type: 'operator', operator: 'indentAuto' },
+    { keys: '>', type: 'operator', operator: 'indent', operatorArgs: { indentRight: true }},
+    { keys: '<', type: 'operator', operator: 'indent', operatorArgs: { indentRight: false }},
+    { keys: 'g~', type: 'operator', operator: 'changeCase' },
+    { keys: 'gu', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, isEdit: true },
+    { keys: 'gU', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, isEdit: true },
+    { keys: 'n', type: 'motion', motion: 'findNext', motionArgs: { forward: true, toJumplist: true }},
+    { keys: 'N', type: 'motion', motion: 'findNext', motionArgs: { forward: false, toJumplist: true }},
+    { keys: 'x', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorMotionArgs: { visualLine: false }},
+    { keys: 'X', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: false }, operatorMotionArgs: { visualLine: true }},
+    { keys: 'D', type: 'operatorMotion', operator: 'delete', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'},
+    { keys: 'D', type: 'operator', operator: 'delete', operatorArgs: { linewise: true }, context: 'visual'},
+    { keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'expandToLine', motionArgs: { linewise: true }, context: 'normal'},
+    { keys: 'Y', type: 'operator', operator: 'yank', operatorArgs: { linewise: true }, context: 'visual'},
+    { keys: 'C', type: 'operatorMotion', operator: 'change', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'},
+    { keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual'},
+    { keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'},
+    { keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'},
+    { keys: '<C-w>', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' },
+    { keys: '<C-w>', type: 'idle', context: 'normal' },
+    { keys: '<C-i>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }},
+    { keys: '<C-o>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }},
+    { keys: '<C-e>', type: 'action', action: 'scroll', actionArgs: { forward: true, linewise: true }},
+    { keys: '<C-y>', type: 'action', action: 'scroll', actionArgs: { forward: false, linewise: true }},
+    { keys: 'a', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'charAfter' }, context: 'normal' },
+    { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }, context: 'normal' },
+    { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' },
+    { keys: 'i', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }, context: 'normal' },
+    { keys: 'gi', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'lastEdit' }, context: 'normal' },
+    { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'firstNonBlank'}, context: 'normal' },
+    { keys: 'gI', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'bol'}, context: 'normal' },
+    { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'startOfSelectedArea' }, context: 'visual' },
+    { keys: 'o', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: true }, context: 'normal' },
+    { keys: 'O', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: false }, context: 'normal' },
+    { keys: 'v', type: 'action', action: 'toggleVisualMode' },
+    { keys: 'V', type: 'action', action: 'toggleVisualMode', actionArgs: { linewise: true }},
+    { keys: '<C-v>', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }},
+    { keys: '<C-q>', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }},
+    { keys: 'gv', type: 'action', action: 'reselectLastSelection' },
+    { keys: 'J', type: 'action', action: 'joinLines', isEdit: true },
+    { keys: 'gJ', type: 'action', action: 'joinLines', actionArgs: { keepSpaces: true }, isEdit: true },
+    { keys: 'p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true }},
+    { keys: 'P', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true }},
+    { keys: 'r<character>', type: 'action', action: 'replace', isEdit: true },
+    { keys: '@<character>', type: 'action', action: 'replayMacro' },
+    { keys: 'q<character>', type: 'action', action: 'enterMacroRecordMode' },
+    { keys: 'R', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { replace: true }, context: 'normal'},
+    { keys: 'R', type: 'operator', operator: 'change', operatorArgs: { linewise: true, fullLine: true }, context: 'visual', exitVisualBlock: true},
+    { keys: 'u', type: 'action', action: 'undo', context: 'normal' },
+    { keys: 'u', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, context: 'visual', isEdit: true },
+    { keys: 'U', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, context: 'visual', isEdit: true },
+    { keys: '<C-r>', type: 'action', action: 'redo' },
+    { keys: 'm<character>', type: 'action', action: 'setMark' },
+    { keys: '"<character>', type: 'action', action: 'setRegister' },
+    { keys: 'zz', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }},
+    { keys: 'z.', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }, motion: 'moveToFirstNonWhiteSpaceCharacter' },
+    { keys: 'zt', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' }},
+    { keys: 'z<CR>', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' }, motion: 'moveToFirstNonWhiteSpaceCharacter' },
+    { keys: 'z-', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' }},
+    { keys: 'zb', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' }, motion: 'moveToFirstNonWhiteSpaceCharacter' },
+    { keys: '.', type: 'action', action: 'repeatLastEdit' },
+    { keys: '<C-a>', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: {increase: true, backtrack: false}},
+    { keys: '<C-x>', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: {increase: false, backtrack: false}},
+    { keys: '<C-t>', type: 'action', action: 'indent', actionArgs: { indentRight: true }, context: 'insert' },
+    { keys: '<C-d>', type: 'action', action: 'indent', actionArgs: { indentRight: false }, context: 'insert' },
+    { keys: 'a<character>', type: 'motion', motion: 'textObjectManipulation' },
+    { keys: 'i<character>', type: 'motion', motion: 'textObjectManipulation', motionArgs: { textObjectInner: true }},
+    { keys: '/', type: 'search', searchArgs: { forward: true, querySrc: 'prompt', toJumplist: true }},
+    { keys: '?', type: 'search', searchArgs: { forward: false, querySrc: 'prompt', toJumplist: true }},
+    { keys: '*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }},
+    { keys: '#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }},
+    { keys: 'g*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true }},
+    { keys: 'g#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true }},
+    { keys: ':', type: 'ex' }
+  ];
+  var defaultKeymapLength = defaultKeymap.length;
+  var defaultExCommandMap = [
+    { name: 'colorscheme', shortName: 'colo' },
+    { name: 'map' },
+    { name: 'imap', shortName: 'im' },
+    { name: 'nmap', shortName: 'nm' },
+    { name: 'vmap', shortName: 'vm' },
+    { name: 'unmap' },
+    { name: 'write', shortName: 'w' },
+    { name: 'undo', shortName: 'u' },
+    { name: 'redo', shortName: 'red' },
+    { name: 'set', shortName: 'se' },
+    { name: 'set', shortName: 'se' },
+    { name: 'setlocal', shortName: 'setl' },
+    { name: 'setglobal', shortName: 'setg' },
+    { name: 'sort', shortName: 'sor' },
+    { name: 'substitute', shortName: 's', possiblyAsync: true },
+    { name: 'nohlsearch', shortName: 'noh' },
+    { name: 'yank', shortName: 'y' },
+    { name: 'delmarks', shortName: 'delm' },
+    { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true },
+    { name: 'global', shortName: 'g' }
+  ];
+
+  var Pos = CodeMirror.Pos;
+
+  var Vim = function() { return vimApi; } //{
+    function enterVimMode(cm) {
+      cm.setOption('disableInput', true);
+      cm.setOption('showCursorWhenSelecting', false);
+      CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
+      cm.on('cursorActivity', onCursorActivity);
+      maybeInitVimState(cm);
+      CodeMirror.on(cm.getInputField(), 'paste', getOnPasteFn(cm));
+    }
+
+    function leaveVimMode(cm) {
+      cm.setOption('disableInput', false);
+      cm.off('cursorActivity', onCursorActivity);
+      CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm));
+      cm.state.vim = null;
+    }
+    function detachVimMap(cm, next) {
+      if (this == CodeMirror.keyMap.vim)
+        CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor");
+
+      if (!next || next.attach != attachVimMap)
+        leaveVimMode(cm);
+    }
+    function attachVimMap(cm, prev) {
+      if (this == CodeMirror.keyMap.vim)
+        CodeMirror.addClass(cm.getWrapperElement(), "cm-fat-cursor");
+
+      if (!prev || prev.attach != attachVimMap)
+        enterVimMode(cm);
+    }
+    CodeMirror.defineOption('vimMode', false, function(cm, val, prev) {
+      if (val && cm.getOption("keyMap") != "vim")
+        cm.setOption("keyMap", "vim");
+      else if (!val && prev != CodeMirror.Init && /^vim/.test(cm.getOption("keyMap")))
+        cm.setOption("keyMap", "default");
+    });
+
+    function cmKey(key, cm) {
+      if (!cm) { return undefined; }
+      if (this[key]) { return this[key]; }
+      var vimKey = cmKeyToVimKey(key);
+      if (!vimKey) {
+        return false;
+      }
+      var cmd = CodeMirror.Vim.findKey(cm, vimKey);
+      if (typeof cmd == 'function') {
+        CodeMirror.signal(cm, 'vim-keypress', vimKey);
+      }
+      return cmd;
+    }
+
+    var modifiers = {'Shift': 'S', 'Ctrl': 'C', 'Alt': 'A', 'Cmd': 'D', 'Mod': 'A'};
+    var specialKeys = {Enter:'CR',Backspace:'BS',Delete:'Del',Insert:'Ins'};
+    function cmKeyToVimKey(key) {
+      if (key.charAt(0) == '\'') {
+        return key.charAt(1);
+      }
+      var pieces = key.split(/-(?!$)/);
+      var lastPiece = pieces[pieces.length - 1];
+      if (pieces.length == 1 && pieces[0].length == 1) {
+        return false;
+      } else if (pieces.length == 2 && pieces[0] == 'Shift' && lastPiece.length == 1) {
+        return false;
+      }
+      var hasCharacter = false;
+      for (var i = 0; i < pieces.length; i++) {
+        var piece = pieces[i];
+        if (piece in modifiers) { pieces[i] = modifiers[piece]; }
+        else { hasCharacter = true; }
+        if (piece in specialKeys) { pieces[i] = specialKeys[piece]; }
+      }
+      if (!hasCharacter) {
+        return false;
+      }
+      if (isUpperCase(lastPiece)) {
+        pieces[pieces.length - 1] = lastPiece.toLowerCase();
+      }
+      return '<' + pieces.join('-') + '>';
+    }
+
+    function getOnPasteFn(cm) {
+      var vim = cm.state.vim;
+      if (!vim.onPasteFn) {
+        vim.onPasteFn = function() {
+          if (!vim.insertMode) {
+            cm.setCursor(offsetCursor(cm.getCursor(), 0, 1));
+            actions.enterInsertMode(cm, {}, vim);
+          }
+        };
+      }
+      return vim.onPasteFn;
+    }
+
+    var numberRegex = /[\d]/;
+    var wordCharTest = [CodeMirror.isWordChar, function(ch) {
+      return ch && !CodeMirror.isWordChar(ch) && !/\s/.test(ch);
+    }], bigWordCharTest = [function(ch) {
+      return /\S/.test(ch);
+    }];
+    function makeKeyRange(start, size) {
+      var keys = [];
+      for (var i = start; i < start + size; i++) {
+        keys.push(String.fromCharCode(i));
+      }
+      return keys;
+    }
+    var upperCaseAlphabet = makeKeyRange(65, 26);
+    var lowerCaseAlphabet = makeKeyRange(97, 26);
+    var numbers = makeKeyRange(48, 10);
+    var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']);
+    var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':', '/']);
+
+    function isLine(cm, line) {
+      return line >= cm.firstLine() && line <= cm.lastLine();
+    }
+    function isLowerCase(k) {
+      return (/^[a-z]$/).test(k);
+    }
+    function isMatchableSymbol(k) {
+      return '()[]{}'.indexOf(k) != -1;
+    }
+    function isNumber(k) {
+      return numberRegex.test(k);
+    }
+    function isUpperCase(k) {
+      return (/^[A-Z]$/).test(k);
+    }
+    function isWhiteSpaceString(k) {
+      return (/^\s*$/).test(k);
+    }
+    function isEndOfSentenceSymbol(k) {
+      return '.?!'.indexOf(k) != -1;
+    }
+    function inArray(val, arr) {
+      for (var i = 0; i < arr.length; i++) {
+        if (arr[i] == val) {
+          return true;
+        }
+      }
+      return false;
+    }
+
+    var options = {};
+    function defineOption(name, defaultValue, type, aliases, callback) {
+      if (defaultValue === undefined && !callback) {
+        throw Error('defaultValue is required unless callback is provided');
+      }
+      if (!type) { type = 'string'; }
+      options[name] = {
+        type: type,
+        defaultValue: defaultValue,
+        callback: callback
+      };
+      if (aliases) {
+        for (var i = 0; i < aliases.length; i++) {
+          options[aliases[i]] = options[name];
+        }
+      }
+      if (defaultValue) {
+        setOption(name, defaultValue);
+      }
+    }
+
+    function setOption(name, value, cm, cfg) {
+      var option = options[name];
+      cfg = cfg || {};
+      var scope = cfg.scope;
+      if (!option) {
+        return new Error('Unknown option: ' + name);
+      }
+      if (option.type == 'boolean') {
+        if (value && value !== true) {
+          return new Error('Invalid argument: ' + name + '=' + value);
+        } else if (value !== false) {
+          value = true;
+        }
+      }
+      if (option.callback) {
+        if (scope !== 'local') {
+          option.callback(value, undefined);
+        }
+        if (scope !== 'global' && cm) {
+          option.callback(value, cm);
+        }
+      } else {
+        if (scope !== 'local') {
+          option.value = option.type == 'boolean' ? !!value : value;
+        }
+        if (scope !== 'global' && cm) {
+          cm.state.vim.options[name] = {value: value};
+        }
+      }
+    }
+
+    function getOption(name, cm, cfg) {
+      var option = options[name];
+      cfg = cfg || {};
+      var scope = cfg.scope;
+      if (!option) {
+        return new Error('Unknown option: ' + name);
+      }
+      if (option.callback) {
+        var local = cm && option.callback(undefined, cm);
+        if (scope !== 'global' && local !== undefined) {
+          return local;
+        }
+        if (scope !== 'local') {
+          return option.callback();
+        }
+        return;
+      } else {
+        var local = (scope !== 'global') && (cm && cm.state.vim.options[name]);
+        return (local || (scope !== 'local') && option || {}).value;
+      }
+    }
+
+    defineOption('filetype', undefined, 'string', ['ft'], function(name, cm) {
+      if (cm === undefined) {
+        return;
+      }
+      if (name === undefined) {
+        var mode = cm.getOption('mode');
+        return mode == 'null' ? '' : mode;
+      } else {
+        var mode = name == '' ? 'null' : name;
+        cm.setOption('mode', mode);
+      }
+    });
+
+    var createCircularJumpList = function() {
+      var size = 100;
+      var pointer = -1;
+      var head = 0;
+      var tail = 0;
+      var buffer = new Array(size);
+      function add(cm, oldCur, newCur) {
+        var current = pointer % size;
+        var curMark = buffer[current];
+        function useNextSlot(cursor) {
+          var next = ++pointer % size;
+          var trashMark = buffer[next];
+          if (trashMark) {
+            trashMark.clear();
+          }
+          buffer[next] = cm.setBookmark(cursor);
+        }
+        if (curMark) {
+          var markPos = curMark.find();
+          if (markPos && !cursorEqual(markPos, oldCur)) {
+            useNextSlot(oldCur);
+          }
+        } else {
+          useNextSlot(oldCur);
+        }
+        useNextSlot(newCur);
+        head = pointer;
+        tail = pointer - size + 1;
+        if (tail < 0) {
+          tail = 0;
+        }
+      }
+      function move(cm, offset) {
+        pointer += offset;
+        if (pointer > head) {
+          pointer = head;
+        } else if (pointer < tail) {
+          pointer = tail;
+        }
+        var mark = buffer[(size + pointer) % size];
+        if (mark && !mark.find()) {
+          var inc = offset > 0 ? 1 : -1;
+          var newCur;
+          var oldCur = cm.getCursor();
+          do {
+            pointer += inc;
+            mark = buffer[(size + pointer) % size];
+            if (mark &&
+                (newCur = mark.find()) &&
+                !cursorEqual(oldCur, newCur)) {
+              break;
+            }
+          } while (pointer < head && pointer > tail);
+        }
+        return mark;
+      }
+      function find(cm, offset) {
+        var oldPointer = pointer;
+        var mark = move(cm, offset);
+        pointer = oldPointer;
+        return mark && mark.find();
+      }
+      return {
+        cachedCursor: undefined, //used for # and * jumps
+        add: add,
+        find: find,
+        move: move
+      };
+    };
+    var createInsertModeChanges = function(c) {
+      if (c) {
+        return {
+          changes: c.changes,
+          expectCursorActivityForChange: c.expectCursorActivityForChange
+        };
+      }
+      return {
+        changes: [],
+        expectCursorActivityForChange: false
+      };
+    };
+
+    function MacroModeState() {
+      this.latestRegister = undefined;
+      this.isPlaying = false;
+      this.isRecording = false;
+      this.replaySearchQueries = [];
+      this.onRecordingDone = undefined;
+      this.lastInsertModeChanges = createInsertModeChanges();
+    }
+    MacroModeState.prototype = {
+      exitMacroRecordMode: function() {
+        var macroModeState = vimGlobalState.macroModeState;
+        if (macroModeState.onRecordingDone) {
+          macroModeState.onRecordingDone(); // close dialog
+        }
+        macroModeState.onRecordingDone = undefined;
+        macroModeState.isRecording = false;
+      },
+      enterMacroRecordMode: function(cm, registerName) {
+        var register =
+            vimGlobalState.registerController.getRegister(registerName);
+        if (register) {
+          register.clear();
+          this.latestRegister = registerName;
+          if (cm.openDialog) {
+            this.onRecordingDone = cm.openDialog(
+                '(recording)['+registerName+']', null, {bottom:true});
+          }
+          this.isRecording = true;
+        }
+      }
+    };
+
+    function maybeInitVimState(cm) {
+      if (!cm.state.vim) {
+        cm.state.vim = {
+          inputState: new InputState(),
+          lastEditInputState: undefined,
+          lastEditActionCommand: undefined,
+          lastHPos: -1,
+          lastHSPos: -1,
+          lastMotion: null,
+          marks: {},
+          fakeCursor: null,
+          insertMode: false,
+          insertModeRepeat: undefined,
+          visualMode: false,
+          visualLine: false,
+          visualBlock: false,
+          lastSelection: null,
+          lastPastedText: null,
+          sel: {},
+          options: {}
+        };
+      }
+      return cm.state.vim;
+    }
+    var vimGlobalState;
+    function resetVimGlobalState() {
+      vimGlobalState = {
+        searchQuery: null,
+        searchIsReversed: false,
+        lastSubstituteReplacePart: undefined,
+        jumpList: createCircularJumpList(),
+        macroModeState: new MacroModeState,
+        lastCharacterSearch: {increment:0, forward:true, selectedCharacter:''},
+        registerController: new RegisterController({}),
+        searchHistoryController: new HistoryController(),
+        exCommandHistoryController : new HistoryController()
+      };
+      for (var optionName in options) {
+        var option = options[optionName];
+        option.value = option.defaultValue;
+      }
+    }
+
+    var lastInsertModeKeyTimer;
+    var vimApi= {
+      buildKeyMap: function() {
+      },
+      getRegisterController: function() {
+        return vimGlobalState.registerController;
+      },
+      resetVimGlobalState_: resetVimGlobalState,
+      getVimGlobalState_: function() {
+        return vimGlobalState;
+      },
+      maybeInitVimState_: maybeInitVimState,
+
+      suppressErrorLogging: false,
+
+      InsertModeKey: InsertModeKey,
+      map: function(lhs, rhs, ctx) {
+        exCommandDispatcher.map(lhs, rhs, ctx);
+      },
+      unmap: function(lhs, ctx) {
+        exCommandDispatcher.unmap(lhs, ctx);
+      },
+      noremap: function(lhs, rhs, ctx) {
+        function toCtxArray(ctx) {
+          return ctx ? [ctx] : ['normal', 'insert', 'visual'];
+        }
+        var ctxsToMap = toCtxArray(ctx);
+        var actualLength = defaultKeymap.length, origLength = defaultKeymapLength;
+        for (var i = actualLength - origLength;
+             i < actualLength && ctxsToMap.length;
+             i++) {
+          var mapping = defaultKeymap[i];
+          if (mapping.keys == rhs &&
+              (!ctx || !mapping.context || mapping.context === ctx) &&
+              mapping.type.substr(0, 2) !== 'ex' &&
+              mapping.type.substr(0, 3) !== 'key') {
+            var newMapping = {};
+            for (var key in mapping) {
+              newMapping[key] = mapping[key];
+            }
+            newMapping.keys = lhs;
+            if (ctx && !newMapping.context) {
+              newMapping.context = ctx;
+            }
+            this._mapCommand(newMapping);
+            var mappedCtxs = toCtxArray(mapping.context);
+            ctxsToMap = ctxsToMap.filter(function(el) { return mappedCtxs.indexOf(el) === -1; });
+          }
+        }
+      },
+      mapclear: function(ctx) {
+        var actualLength = defaultKeymap.length,
+            origLength = defaultKeymapLength;
+        var userKeymap = defaultKeymap.slice(0, actualLength - origLength);
+        defaultKeymap = defaultKeymap.slice(actualLength - origLength);
+        if (ctx) {
+          for (var i = userKeymap.length - 1; i >= 0; i--) {
+            var mapping = userKeymap[i];
+            if (ctx !== mapping.context) {
+              if (mapping.context) {
+                this._mapCommand(mapping);
+              } else {
+                var contexts = ['normal', 'insert', 'visual'];
+                for (var j in contexts) {
+                  if (contexts[j] !== ctx) {
+                    var newMapping = {};
+                    for (var key in mapping) {
+                      newMapping[key] = mapping[key];
+                    }
+                    newMapping.context = contexts[j];
+                    this._mapCommand(newMapping);
+                  }
+                }
+              }
+            }
+          }
+        }
+      },
+      setOption: setOption,
+      getOption: getOption,
+      defineOption: defineOption,
+      defineEx: function(name, prefix, func){
+        if (!prefix) {
+          prefix = name;
+        } else if (name.indexOf(prefix) !== 0) {
+          throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered');
+        }
+        exCommands[name]=func;
+        exCommandDispatcher.commandMap_[prefix]={name:name, shortName:prefix, type:'api'};
+      },
+      handleKey: function (cm, key, origin) {
+        var command = this.findKey(cm, key, origin);
+        if (typeof command === 'function') {
+          return command();
+        }
+      },
+      findKey: function(cm, key, origin) {
+        var vim = maybeInitVimState(cm);
+        function handleMacroRecording() {
+          var macroModeState = vimGlobalState.macroModeState;
+          if (macroModeState.isRecording) {
+            if (key == 'q') {
+              macroModeState.exitMacroRecordMode();
+              clearInputState(cm);
+              return true;
+            }
+            if (origin != 'mapping') {
+              logKey(macroModeState, key);
+            }
+          }
+        }
+        function handleEsc() {
+          if (key == '<Esc>') {
+            clearInputState(cm);
+            if (vim.visualMode) {
+              exitVisualMode(cm);
+            } else if (vim.insertMode) {
+              exitInsertMode(cm);
+            }
+            return true;
+          }
+        }
+        function doKeyToKey(keys) {
+          var match;
+          while (keys) {
+            match = (/<\w+-.+?>|<\w+>|./).exec(keys);
+            key = match[0];
+            keys = keys.substring(match.index + key.length);
+            CodeMirror.Vim.handleKey(cm, key, 'mapping');
+          }
+        }
+
+        function handleKeyInsertMode() {
+          if (handleEsc()) { return true; }
+          var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key;
+          var keysAreChars = key.length == 1;
+          var match = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert');
+          while (keys.length > 1 && match.type != 'full') {
+            var keys = vim.inputState.keyBuffer = keys.slice(1);
+            var thisMatch = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert');
+            if (thisMatch.type != 'none') { match = thisMatch; }
+          }
+          if (match.type == 'none') { clearInputState(cm); return false; }
+          else if (match.type == 'partial') {
+            if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); }
+            lastInsertModeKeyTimer = window.setTimeout(
+              function() { if (vim.insertMode && vim.inputState.keyBuffer) { clearInputState(cm); } },
+              getOption('insertModeEscKeysTimeout'));
+            return !keysAreChars;
+          }
+
+          if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); }
+          if (keysAreChars) {
+            var selections = cm.listSelections();
+            for (var i = 0; i < selections.length; i++) {
+              var here = selections[i].head;
+              cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input');
+            }
+            vimGlobalState.macroModeState.lastInsertModeChanges.changes.pop();
+          }
+          clearInputState(cm);
+          return match.command;
+        }
+
+        function handleKeyNonInsertMode() {
+          if (handleMacroRecording() || handleEsc()) { return true; }
+
+          var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key;
+          if (/^[1-9]\d*$/.test(keys)) { return true; }
+
+          var keysMatcher = /^(\d*)(.*)$/.exec(keys);
+          if (!keysMatcher) { clearInputState(cm); return false; }
+          var context = vim.visualMode ? 'visual' :
+                                         'normal';
+          var match = commandDispatcher.matchCommand(keysMatcher[2] || keysMatcher[1], defaultKeymap, vim.inputState, context);
+          if (match.type == 'none') { clearInputState(cm); return false; }
+          else if (match.type == 'partial') { return true; }
+
+          vim.inputState.keyBuffer = '';
+          var keysMatcher = /^(\d*)(.*)$/.exec(keys);
+          if (keysMatcher[1] && keysMatcher[1] != '0') {
+            vim.inputState.pushRepeatDigit(keysMatcher[1]);
+          }
+          return match.command;
+        }
+
+        var command;
+        if (vim.insertMode) { command = handleKeyInsertMode(); }
+        else { command = handleKeyNonInsertMode(); }
+        if (command === false) {
+          return undefined; //ace_patch
+        } else if (command === true) {
+          return function() { return true; };
+        } else {
+          return function() {
+            if ((command.operator || command.isEdit) && cm.getOption('readOnly'))
+              return; // ace_patch
+            return cm.operation(function() {
+              cm.curOp.isVimOp = true;
+              try {
+                if (command.type == 'keyToKey') {
+                  doKeyToKey(command.toKeys);
+                } else {
+                  commandDispatcher.processCommand(cm, vim, command);
+                }
+              } catch (e) {
+                cm.state.vim = undefined;
+                maybeInitVimState(cm);
+                if (!CodeMirror.Vim.suppressErrorLogging) {
+                  console['log'](e);
+                }
+                throw e;
+              }
+              return true;
+            });
+          };
+        }
+      },
+      handleEx: function(cm, input) {
+        exCommandDispatcher.processCommand(cm, input);
+      },
+
+      defineMotion: defineMotion,
+      defineAction: defineAction,
+      defineOperator: defineOperator,
+      mapCommand: mapCommand,
+      _mapCommand: _mapCommand,
+
+      defineRegister: defineRegister,
+
+      exitVisualMode: exitVisualMode,
+      exitInsertMode: exitInsertMode
+    };
+    function InputState() {
+      this.prefixRepeat = [];
+      this.motionRepeat = [];
+
+      this.operator = null;
+      this.operatorArgs = null;
+      this.motion = null;
+      this.motionArgs = null;
+      this.keyBuffer = []; // For matching multi-key commands.
+      this.registerName = null; // Defaults to the unnamed register.
+    }
+    InputState.prototype.pushRepeatDigit = function(n) {
+      if (!this.operator) {
+        this.prefixRepeat = this.prefixRepeat.concat(n);
+      } else {
+        this.motionRepeat = this.motionRepeat.concat(n);
+      }
+    };
+    InputState.prototype.getRepeat = function() {
+      var repeat = 0;
+      if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) {
+        repeat = 1;
+        if (this.prefixRepeat.length > 0) {
+          repeat *= parseInt(this.prefixRepeat.join(''), 10);
+        }
+        if (this.motionRepeat.length > 0) {
+          repeat *= parseInt(this.motionRepeat.join(''), 10);
+        }
+      }
+      return repeat;
+    };
+
+    function clearInputState(cm, reason) {
+      cm.state.vim.inputState = new InputState();
+      CodeMirror.signal(cm, 'vim-command-done', reason);
+    }
+    function Register(text, linewise, blockwise) {
+      this.clear();
+      this.keyBuffer = [text || ''];
+      this.insertModeChanges = [];
+      this.searchQueries = [];
+      this.linewise = !!linewise;
+      this.blockwise = !!blockwise;
+    }
+    Register.prototype = {
+      setText: function(text, linewise, blockwise) {
+        this.keyBuffer = [text || ''];
+        this.linewise = !!linewise;
+        this.blockwise = !!blockwise;
+      },
+      pushText: function(text, linewise) {
+        if (linewise) {
+          if (!this.linewise) {
+            this.keyBuffer.push('\n');
+          }
+          this.linewise = true;
+        }
+        this.keyBuffer.push(text);
+      },
+      pushInsertModeChanges: function(changes) {
+        this.insertModeChanges.push(createInsertModeChanges(changes));
+      },
+      pushSearchQuery: function(query) {
+        this.searchQueries.push(query);
+      },
+      clear: function() {
+        this.keyBuffer = [];
+        this.insertModeChanges = [];
+        this.searchQueries = [];
+        this.linewise = false;
+      },
+      toString: function() {
+        return this.keyBuffer.join('');
+      }
+    };
+    function defineRegister(name, register) {
+      var registers = vimGlobalState.registerController.registers;
+      if (!name || name.length != 1) {
+        throw Error('Register name must be 1 character');
+      }
+      registers[name] = register;
+      validRegisters.push(name);
+    }
+    function RegisterController(registers) {
+      this.registers = registers;
+      this.unnamedRegister = registers['"'] = new Register();
+      registers['.'] = new Register();
+      registers[':'] = new Register();
+      registers['/'] = new Register();
+    }
+    RegisterController.prototype = {
+      pushText: function(registerName, operator, text, linewise, blockwise) {
+        if (linewise && text.charAt(text.length - 1) !== '\n'){
+          text += '\n';
+        }
+        var register = this.isValidRegister(registerName) ?
+            this.getRegister(registerName) : null;
+        if (!register) {
+          switch (operator) {
+            case 'yank':
+              this.registers['0'] = new Register(text, linewise, blockwise);
+              break;
+            case 'delete':
+            case 'change':
+              if (text.indexOf('\n') == -1) {
+                this.registers['-'] = new Register(text, linewise);
+              } else {
+                this.shiftNumericRegisters_();
+                this.registers['1'] = new Register(text, linewise);
+              }
+              break;
+          }
+          this.unnamedRegister.setText(text, linewise, blockwise);
+          return;
+        }
+        var append = isUpperCase(registerName);
+        if (append) {
+          register.pushText(text, linewise);
+        } else {
+          register.setText(text, linewise, blockwise);
+        }
+        this.unnamedRegister.setText(register.toString(), linewise);
+      },
+      getRegister: function(name) {
+        if (!this.isValidRegister(name)) {
+          return this.unnamedRegister;
+        }
+        name = name.toLowerCase();
+        if (!this.registers[name]) {
+          this.registers[name] = new Register();
+        }
+        return this.registers[name];
+      },
+      isValidRegister: function(name) {
+        return name && inArray(name, validRegisters);
+      },
+      shiftNumericRegisters_: function() {
+        for (var i = 9; i >= 2; i--) {
+          this.registers[i] = this.getRegister('' + (i - 1));
+        }
+      }
+    };
+    function HistoryController() {
+        this.historyBuffer = [];
+        this.iterator = 0;
+        this.initialPrefix = null;
+    }
+    HistoryController.prototype = {
+      nextMatch: function (input, up) {
+        var historyBuffer = this.historyBuffer;
+        var dir = up ? -1 : 1;
+        if (this.initialPrefix === null) this.initialPrefix = input;
+        for (var i = this.iterator + dir; up ? i >= 0 : i < historyBuffer.length; i+= dir) {
+          var element = historyBuffer[i];
+          for (var j = 0; j <= element.length; j++) {
+            if (this.initialPrefix == element.substring(0, j)) {
+              this.iterator = i;
+              return element;
+            }
+          }
+        }
+        if (i >= historyBuffer.length) {
+          this.iterator = historyBuffer.length;
+          return this.initialPrefix;
+        }
+        if (i < 0 ) return input;
+      },
+      pushInput: function(input) {
+        var index = this.historyBuffer.indexOf(input);
+        if (index > -1) this.historyBuffer.splice(index, 1);
+        if (input.length) this.historyBuffer.push(input);
+      },
+      reset: function() {
+        this.initialPrefix = null;
+        this.iterator = this.historyBuffer.length;
+      }
+    };
+    var commandDispatcher = {
+      matchCommand: function(keys, keyMap, inputState, context) {
+        var matches = commandMatches(keys, keyMap, context, inputState);
+        if (!matches.full && !matches.partial) {
+          return {type: 'none'};
+        } else if (!matches.full && matches.partial) {
+          return {type: 'partial'};
+        }
+
+        var bestMatch;
+        for (var i = 0; i < matches.full.length; i++) {
+          var match = matches.full[i];
+          if (!bestMatch) {
+            bestMatch = match;
+          }
+        }
+        if (bestMatch.keys.slice(-11) == '<character>') {
+          var character = lastChar(keys);
+          if (/<C-.>/.test(character) || !character) return {type: 'none'}; //ace_patch
+          inputState.selectedCharacter = character;
+        }
+        return {type: 'full', command: bestMatch};
+      },
+      processCommand: function(cm, vim, command) {
+        vim.inputState.repeatOverride = command.repeatOverride;
+        switch (command.type) {
+          case 'motion':
+            this.processMotion(cm, vim, command);
+            break;
+          case 'operator':
+            this.processOperator(cm, vim, command);
+            break;
+          case 'operatorMotion':
+            this.processOperatorMotion(cm, vim, command);
+            break;
+          case 'action':
+            this.processAction(cm, vim, command);
+            break;
+          case 'search':
+            this.processSearch(cm, vim, command);
+            break;
+          case 'ex':
+          case 'keyToEx':
+            this.processEx(cm, vim, command);
+            break;
+          default:
+            break;
+        }
+      },
+      processMotion: function(cm, vim, command) {
+        vim.inputState.motion = command.motion;
+        vim.inputState.motionArgs = copyArgs(command.motionArgs);
+        this.evalInput(cm, vim);
+      },
+      processOperator: function(cm, vim, command) {
+        var inputState = vim.inputState;
+        if (inputState.operator) {
+          if (inputState.operator == command.operator) {
+            inputState.motion = 'expandToLine';
+            inputState.motionArgs = { linewise: true };
+            this.evalInput(cm, vim);
+            return;
+          } else {
+            clearInputState(cm);
+          }
+        }
+        inputState.operator = command.operator;
+        inputState.operatorArgs = copyArgs(command.operatorArgs);
+        if (command.exitVisualBlock) {
+            vim.visualBlock = false;
+            updateCmSelection(cm);
+        }
+        if (vim.visualMode) {
+          this.evalInput(cm, vim);
+        }
+      },
+      processOperatorMotion: function(cm, vim, command) {
+        var visualMode = vim.visualMode;
+        var operatorMotionArgs = copyArgs(command.operatorMotionArgs);
+        if (operatorMotionArgs) {
+          if (visualMode && operatorMotionArgs.visualLine) {
+            vim.visualLine = true;
+          }
+        }
+        this.processOperator(cm, vim, command);
+        if (!visualMode) {
+          this.processMotion(cm, vim, command);
+        }
+      },
+      processAction: function(cm, vim, command) {
+        var inputState = vim.inputState;
+        var repeat = inputState.getRepeat();
+        var repeatIsExplicit = !!repeat;
+        var actionArgs = copyArgs(command.actionArgs) || {};
+        if (inputState.selectedCharacter) {
+          actionArgs.selectedCharacter = inputState.selectedCharacter;
+        }
+        if (command.operator) {
+          this.processOperator(cm, vim, command);
+        }
+        if (command.motion) {
+          this.processMotion(cm, vim, command);
+        }
+        if (command.motion || command.operator) {
+          this.evalInput(cm, vim);
+        }
+        actionArgs.repeat = repeat || 1;
+        actionArgs.repeatIsExplicit = repeatIsExplicit;
+        actionArgs.registerName = inputState.registerName;
+        clearInputState(cm);
+        vim.lastMotion = null;
+        if (command.isEdit) {
+          this.recordLastEdit(vim, inputState, command);
+        }
+        actions[command.action](cm, actionArgs, vim);
+      },
+      processSearch: function(cm, vim, command) {
+        if (!cm.getSearchCursor) {
+          return;
+        }
+        var forward = command.searchArgs.forward;
+        var wholeWordOnly = command.searchArgs.wholeWordOnly;
+        getSearchState(cm).setReversed(!forward);
+        var promptPrefix = (forward) ? '/' : '?';
+        var originalQuery = getSearchState(cm).getQuery();
+        var originalScrollPos = cm.getScrollInfo();
+        function handleQuery(query, ignoreCase, smartCase) {
+          vimGlobalState.searchHistoryController.pushInput(query);
+          vimGlobalState.searchHistoryController.reset();
+          try {
+            updateSearchQuery(cm, query, ignoreCase, smartCase);
+          } catch (e) {
+            showConfirm(cm, 'Invalid regex: ' + query);
+            clearInputState(cm);
+            return;
+          }
+          commandDispatcher.processMotion(cm, vim, {
+            type: 'motion',
+            motion: 'findNext',
+            motionArgs: { forward: true, toJumplist: command.searchArgs.toJumplist }
+          });
+        }
+        function onPromptClose(query) {
+          cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
+          handleQuery(query, true /** ignoreCase */, true /** smartCase */);
+          var macroModeState = vimGlobalState.macroModeState;
+          if (macroModeState.isRecording) {
+            logSearchQuery(macroModeState, query);
+          }
+        }
+        function onPromptKeyUp(e, query, close) {
+          var keyName = CodeMirror.keyName(e), up, offset;
+          if (keyName == 'Up' || keyName == 'Down') {
+            up = keyName == 'Up' ? true : false;
+            offset = e.target ? e.target.selectionEnd : 0;
+            query = vimGlobalState.searchHistoryController.nextMatch(query, up) || '';
+            close(query);
+            if (offset && e.target) e.target.selectionEnd = e.target.selectionStart = Math.min(offset, e.target.value.length);
+          } else {
+            if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift')
+              vimGlobalState.searchHistoryController.reset();
+          }
+          var parsedQuery;
+          try {
+            parsedQuery = updateSearchQuery(cm, query,
+                true /** ignoreCase */, true /** smartCase */);
+          } catch (e) {
+          }
+          if (parsedQuery) {
+            cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30);
+          } else {
+            clearSearchHighlight(cm);
+            cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
+          }
+        }
+        function onPromptKeyDown(e, query, close) {
+          var keyName = CodeMirror.keyName(e);
+          if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' ||
+              (keyName == 'Backspace' && query == '')) {
+            vimGlobalState.searchHistoryController.pushInput(query);
+            vimGlobalState.searchHistoryController.reset();
+            updateSearchQuery(cm, originalQuery);
+            clearSearchHighlight(cm);
+            cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
+            CodeMirror.e_stop(e);
+            clearInputState(cm);
+            close();
+            cm.focus();
+          } else if (keyName == 'Up' || keyName == 'Down') {
+            CodeMirror.e_stop(e);
+          } else if (keyName == 'Ctrl-U') {
+            CodeMirror.e_stop(e);
+            close('');
+          }
+        }
+        switch (command.searchArgs.querySrc) {
+          case 'prompt':
+            var macroModeState = vimGlobalState.macroModeState;
+            if (macroModeState.isPlaying) {
+              var query = macroModeState.replaySearchQueries.shift();
+              handleQuery(query, true /** ignoreCase */, false /** smartCase */);
+            } else {
+              showPrompt(cm, {
+                  onClose: onPromptClose,
+                  prefix: promptPrefix,
+                  desc: searchPromptDesc,
+                  onKeyUp: onPromptKeyUp,
+                  onKeyDown: onPromptKeyDown
+              });
+            }
+            break;
+          case 'wordUnderCursor':
+            var word = expandWordUnderCursor(cm, false /** inclusive */,
+                true /** forward */, false /** bigWord */,
+                true /** noSymbol */);
+            var isKeyword = true;
+            if (!word) {
+              word = expandWordUnderCursor(cm, false /** inclusive */,
+                  true /** forward */, false /** bigWord */,
+                  false /** noSymbol */);
+              isKeyword = false;
+            }
+            if (!word) {
+              return;
+            }
+            var query = cm.getLine(word.start.line).substring(word.start.ch,
+                word.end.ch);
+            if (isKeyword && wholeWordOnly) {
+                query = '\\b' + query + '\\b';
+            } else {
+              query = escapeRegex(query);
+            }
+            vimGlobalState.jumpList.cachedCursor = cm.getCursor();
+            cm.setCursor(word.start);
+
+            handleQuery(query, true /** ignoreCase */, false /** smartCase */);
+            break;
+        }
+      },
+      processEx: function(cm, vim, command) {
+        function onPromptClose(input) {
+          vimGlobalState.exCommandHistoryController.pushInput(input);
+          vimGlobalState.exCommandHistoryController.reset();
+          exCommandDispatcher.processCommand(cm, input);
+        }
+        function onPromptKeyDown(e, input, close) {
+          var keyName = CodeMirror.keyName(e), up, offset;
+          if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' ||
+              (keyName == 'Backspace' && input == '')) {
+            vimGlobalState.exCommandHistoryController.pushInput(input);
+            vimGlobalState.exCommandHistoryController.reset();
+            CodeMirror.e_stop(e);
+            clearInputState(cm);
+            close();
+            cm.focus();
+          }
+          if (keyName == 'Up' || keyName == 'Down') {
+            CodeMirror.e_stop(e);
+            up = keyName == 'Up' ? true : false;
+            offset = e.target ? e.target.selectionEnd : 0;
+            input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || '';
+            close(input);
+            if (offset && e.target) e.target.selectionEnd = e.target.selectionStart = Math.min(offset, e.target.value.length);
+          } else if (keyName == 'Ctrl-U') {
+            CodeMirror.e_stop(e);
+            close('');
+          } else {
+            if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift')
+              vimGlobalState.exCommandHistoryController.reset();
+          }
+        }
+        if (command.type == 'keyToEx') {
+          exCommandDispatcher.processCommand(cm, command.exArgs.input);
+        } else {
+          if (vim.visualMode) {
+            showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>',
+                onKeyDown: onPromptKeyDown, selectValueOnOpen: false});
+          } else {
+            showPrompt(cm, { onClose: onPromptClose, prefix: ':',
+                onKeyDown: onPromptKeyDown});
+          }
+        }
+      },
+      evalInput: function(cm, vim) {
+        var inputState = vim.inputState;
+        var motion = inputState.motion;
+        var motionArgs = inputState.motionArgs || {};
+        var operator = inputState.operator;
+        var operatorArgs = inputState.operatorArgs || {};
+        var registerName = inputState.registerName;
+        var sel = vim.sel;
+        var origHead = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.head): cm.getCursor('head'));
+        var origAnchor = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.anchor) : cm.getCursor('anchor'));
+        var oldHead = copyCursor(origHead);
+        var oldAnchor = copyCursor(origAnchor);
+        var newHead, newAnchor;
+        var repeat;
+        if (operator) {
+          this.recordLastEdit(vim, inputState);
+        }
+        if (inputState.repeatOverride !== undefined) {
+          repeat = inputState.repeatOverride;
+        } else {
+          repeat = inputState.getRepeat();
+        }
+        if (repeat > 0 && motionArgs.explicitRepeat) {
+          motionArgs.repeatIsExplicit = true;
+        } else if (motionArgs.noRepeat ||
+            (!motionArgs.explicitRepeat && repeat === 0)) {
+          repeat = 1;
+          motionArgs.repeatIsExplicit = false;
+        }
+        if (inputState.selectedCharacter) {
+          motionArgs.selectedCharacter = operatorArgs.selectedCharacter =
+              inputState.selectedCharacter;
+        }
+        motionArgs.repeat = repeat;
+        clearInputState(cm);
+        if (motion) {
+          var motionResult = motions[motion](cm, origHead, motionArgs, vim);
+          vim.lastMotion = motions[motion];
+          if (!motionResult) {
+            return;
+          }
+          if (motionArgs.toJumplist) {
+            if (!operator && cm.ace.curOp != null)
+              cm.ace.curOp.command.scrollIntoView = "center-animate"; // ace_patch
+            var jumpList = vimGlobalState.jumpList;
+            var cachedCursor = jumpList.cachedCursor;
+            if (cachedCursor) {
+              recordJumpPosition(cm, cachedCursor, motionResult);
+              delete jumpList.cachedCursor;
+            } else {
+              recordJumpPosition(cm, origHead, motionResult);
+            }
+          }
+          if (motionResult instanceof Array) {
+            newAnchor = motionResult[0];
+            newHead = motionResult[1];
+          } else {
+            newHead = motionResult;
+          }
+          if (!newHead) {
+            newHead = copyCursor(origHead);
+          }
+          if (vim.visualMode) {
+            if (!(vim.visualBlock && newHead.ch === Infinity)) {
+              newHead = clipCursorToContent(cm, newHead, vim.visualBlock);
+            }
+            if (newAnchor) {
+              newAnchor = clipCursorToContent(cm, newAnchor, true);
+            }
+            newAnchor = newAnchor || oldAnchor;
+            sel.anchor = newAnchor;
+            sel.head = newHead;
+            updateCmSelection(cm);
+            updateMark(cm, vim, '<',
+                cursorIsBefore(newAnchor, newHead) ? newAnchor
+                    : newHead);
+            updateMark(cm, vim, '>',
+                cursorIsBefore(newAnchor, newHead) ? newHead
+                    : newAnchor);
+          } else if (!operator) {
+            newHead = clipCursorToContent(cm, newHead);
+            cm.setCursor(newHead.line, newHead.ch);
+          }
+        }
+        if (operator) {
+          if (operatorArgs.lastSel) {
+            newAnchor = oldAnchor;
+            var lastSel = operatorArgs.lastSel;
+            var lineOffset = Math.abs(lastSel.head.line - lastSel.anchor.line);
+            var chOffset = Math.abs(lastSel.head.ch - lastSel.anchor.ch);
+            if (lastSel.visualLine) {
+              newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch);
+            } else if (lastSel.visualBlock) {
+              newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch + chOffset);
+            } else if (lastSel.head.line == lastSel.anchor.line) {
+              newHead = Pos(oldAnchor.line, oldAnchor.ch + chOffset);
+            } else {
+              newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch);
+            }
+            vim.visualMode = true;
+            vim.visualLine = lastSel.visualLine;
+            vim.visualBlock = lastSel.visualBlock;
+            sel = vim.sel = {
+              anchor: newAnchor,
+              head: newHead
+            };
+            updateCmSelection(cm);
+          } else if (vim.visualMode) {
+            operatorArgs.lastSel = {
+              anchor: copyCursor(sel.anchor),
+              head: copyCursor(sel.head),
+              visualBlock: vim.visualBlock,
+              visualLine: vim.visualLine
+            };
+          }
+          var curStart, curEnd, linewise, mode;
+          var cmSel;
+          if (vim.visualMode) {
+            curStart = cursorMin(sel.head, sel.anchor);
+            curEnd = cursorMax(sel.head, sel.anchor);
+            linewise = vim.visualLine || operatorArgs.linewise;
+            mode = vim.visualBlock ? 'block' :
+                   linewise ? 'line' :
+                   'char';
+            cmSel = makeCmSelection(cm, {
+              anchor: curStart,
+              head: curEnd
+            }, mode);
+            if (linewise) {
+              var ranges = cmSel.ranges;
+              if (mode == 'block') {
+                for (var i = 0; i < ranges.length; i++) {
+                  ranges[i].head.ch = lineLength(cm, ranges[i].head.line);
+                }
+              } else if (mode == 'line') {
+                ranges[0].head = Pos(ranges[0].head.line + 1, 0);
+              }
+            }
+          } else {
+            curStart = copyCursor(newAnchor || oldAnchor);
+            curEnd = copyCursor(newHead || oldHead);
+            if (cursorIsBefore(curEnd, curStart)) {
+              var tmp = curStart;
+              curStart = curEnd;
+              curEnd = tmp;
+            }
+            linewise = motionArgs.linewise || operatorArgs.linewise;
+            if (linewise) {
+              expandSelectionToLine(cm, curStart, curEnd);
+            } else if (motionArgs.forward) {
+              clipToLine(cm, curStart, curEnd);
+            }
+            mode = 'char';
+            var exclusive = !motionArgs.inclusive || linewise;
+            cmSel = makeCmSelection(cm, {
+              anchor: curStart,
+              head: curEnd
+            }, mode, exclusive);
+          }
+          cm.setSelections(cmSel.ranges, cmSel.primary);
+          vim.lastMotion = null;
+          operatorArgs.repeat = repeat; // For indent in visual mode.
+          operatorArgs.registerName = registerName;
+          operatorArgs.linewise = linewise;
+          var operatorMoveTo = operators[operator](
+            cm, operatorArgs, cmSel.ranges, oldAnchor, newHead);
+          if (vim.visualMode) {
+            exitVisualMode(cm, operatorMoveTo != null);
+          }
+          if (operatorMoveTo) {
+            cm.setCursor(operatorMoveTo);
+          }
+        }
+      },
+      recordLastEdit: function(vim, inputState, actionCommand) {
+        var macroModeState = vimGlobalState.macroModeState;
+        if (macroModeState.isPlaying) { return; }
+        vim.lastEditInputState = inputState;
+        vim.lastEditActionCommand = actionCommand;
+        macroModeState.lastInsertModeChanges.changes = [];
+        macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false;
+        macroModeState.lastInsertModeChanges.visualBlock = vim.visualBlock ? vim.sel.head.line - vim.sel.anchor.line : 0;
+      }
+    };
+    var motions = {
+      moveToTopLine: function(cm, _head, motionArgs) {
+        var line = getUserVisibleLines(cm).top + motionArgs.repeat -1;
+        return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
+      },
+      moveToMiddleLine: function(cm) {
+        var range = getUserVisibleLines(cm);
+        var line = Math.floor((range.top + range.bottom) * 0.5);
+        return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
+      },
+      moveToBottomLine: function(cm, _head, motionArgs) {
+        var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1;
+        return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
+      },
+      expandToLine: function(_cm, head, motionArgs) {
+        var cur = head;
+        return Pos(cur.line + motionArgs.repeat - 1, Infinity);
+      },
+      findNext: function(cm, _head, motionArgs) {
+        var state = getSearchState(cm);
+        var query = state.getQuery();
+        if (!query) {
+          return;
+        }
+        var prev = !motionArgs.forward;
+        prev = (state.isReversed()) ? !prev : prev;
+        highlightSearchMatches(cm, query);
+        return findNext(cm, prev/** prev */, query, motionArgs.repeat);
+      },
+      goToMark: function(cm, _head, motionArgs, vim) {
+        var pos = getMarkPos(cm, vim, motionArgs.selectedCharacter);
+        if (pos) {
+          return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos;
+        }
+        return null;
+      },
+      moveToOtherHighlightedEnd: function(cm, _head, motionArgs, vim) {
+        if (vim.visualBlock && motionArgs.sameLine) {
+          var sel = vim.sel;
+          return [
+            clipCursorToContent(cm, Pos(sel.anchor.line, sel.head.ch)),
+            clipCursorToContent(cm, Pos(sel.head.line, sel.anchor.ch))
+          ];
+        } else {
+          return ([vim.sel.head, vim.sel.anchor]);
+        }
+      },
+      jumpToMark: function(cm, head, motionArgs, vim) {
+        var best = head;
+        for (var i = 0; i < motionArgs.repeat; i++) {
+          var cursor = best;
+          for (var key in vim.marks) {
+            if (!isLowerCase(key)) {
+              continue;
+            }
+            var mark = vim.marks[key].find();
+            var isWrongDirection = (motionArgs.forward) ?
+              cursorIsBefore(mark, cursor) : cursorIsBefore(cursor, mark);
+
+            if (isWrongDirection) {
+              continue;
+            }
+            if (motionArgs.linewise && (mark.line == cursor.line)) {
+              continue;
+            }
+
+            var equal = cursorEqual(cursor, best);
+            var between = (motionArgs.forward) ?
+              cursorIsBetween(cursor, mark, best) :
+              cursorIsBetween(best, mark, cursor);
+
+            if (equal || between) {
+              best = mark;
+            }
+          }
+        }
+
+        if (motionArgs.linewise) {
+          best = Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line)));
+        }
+        return best;
+      },
+      moveByCharacters: function(_cm, head, motionArgs) {
+        var cur = head;
+        var repeat = motionArgs.repeat;
+        var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat;
+        return Pos(cur.line, ch);
+      },
+      moveByLines: function(cm, head, motionArgs, vim) {
+        var cur = head;
+        var endCh = cur.ch;
+        switch (vim.lastMotion) {
+          case this.moveByLines:
+          case this.moveByDisplayLines:
+          case this.moveByScroll:
+          case this.moveToColumn:
+          case this.moveToEol:
+            endCh = vim.lastHPos;
+            break;
+          default:
+            vim.lastHPos = endCh;
+        }
+        var repeat = motionArgs.repeat+(motionArgs.repeatOffset||0);
+        var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat;
+        var first = cm.firstLine();
+        var last = cm.lastLine();
+        if (line < first && cur.line == first){
+          return this.moveToStartOfLine(cm, head, motionArgs, vim);
+        }else if (line > last && cur.line == last){
+            return this.moveToEol(cm, head, motionArgs, vim, true);
+        }
+        var fold = cm.ace.session.getFoldLine(line);
+        if (fold) {
+          if (motionArgs.forward) {
+            if (line > fold.start.row)
+              line = fold.end.row + 1;
+          } else {
+            line = fold.start.row;
+          }
+        }
+        if (motionArgs.toFirstChar){
+          endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line));
+          vim.lastHPos = endCh;
+        }
+        vim.lastHSPos = cm.charCoords(Pos(line, endCh),'div').left;
+        return Pos(line, endCh);
+      },
+      moveByDisplayLines: function(cm, head, motionArgs, vim) {
+        var cur = head;
+        switch (vim.lastMotion) {
+          case this.moveByDisplayLines:
+          case this.moveByScroll:
+          case this.moveByLines:
+          case this.moveToColumn:
+          case this.moveToEol:
+            break;
+          default:
+            vim.lastHSPos = cm.charCoords(cur,'div').left;
+        }
+        var repeat = motionArgs.repeat;
+        var res=cm.findPosV(cur,(motionArgs.forward ? repeat : -repeat),'line',vim.lastHSPos);
+        if (res.hitSide) {
+          if (motionArgs.forward) {
+            var lastCharCoords = cm.charCoords(res, 'div');
+            var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos };
+            var res = cm.coordsChar(goalCoords, 'div');
+          } else {
+            var resCoords = cm.charCoords(Pos(cm.firstLine(), 0), 'div');
+            resCoords.left = vim.lastHSPos;
+            res = cm.coordsChar(resCoords, 'div');
+          }
+        }
+        vim.lastHPos = res.ch;
+        return res;
+      },
+      moveByPage: function(cm, head, motionArgs) {
+        var curStart = head;
+        var repeat = motionArgs.repeat;
+        return cm.findPosV(curStart, (motionArgs.forward ? repeat : -repeat), 'page');
+      },
+      moveByParagraph: function(cm, head, motionArgs) {
+        var dir = motionArgs.forward ? 1 : -1;
+        return findParagraph(cm, head, motionArgs.repeat, dir);
+      },
+      moveBySentence: function(cm, head, motionArgs) {
+        var dir = motionArgs.forward ? 1 : -1;
+        return findSentence(cm, head, motionArgs.repeat, dir);
+      },
+      moveByScroll: function(cm, head, motionArgs, vim) {
+        var scrollbox = cm.getScrollInfo();
+        var curEnd = null;
+        var repeat = motionArgs.repeat;
+        if (!repeat) {
+          repeat = scrollbox.clientHeight / (2 * cm.defaultTextHeight());
+        }
+        var orig = cm.charCoords(head, 'local');
+        motionArgs.repeat = repeat;
+        var curEnd = motions.moveByDisplayLines(cm, head, motionArgs, vim);
+        if (!curEnd) {
+          return null;
+        }
+        var dest = cm.charCoords(curEnd, 'local');
+        cm.scrollTo(null, scrollbox.top + dest.top - orig.top);
+        return curEnd;
+      },
+      moveByWords: function(cm, head, motionArgs) {
+        return moveToWord(cm, head, motionArgs.repeat, !!motionArgs.forward,
+            !!motionArgs.wordEnd, !!motionArgs.bigWord);
+      },
+      moveTillCharacter: function(cm, _head, motionArgs) {
+        var repeat = motionArgs.repeat;
+        var curEnd = moveToCharacter(cm, repeat, motionArgs.forward,
+            motionArgs.selectedCharacter);
+        var increment = motionArgs.forward ? -1 : 1;
+        recordLastCharacterSearch(increment, motionArgs);
+        if (!curEnd) return null;
+        curEnd.ch += increment;
+        return curEnd;
+      },
+      moveToCharacter: function(cm, head, motionArgs) {
+        var repeat = motionArgs.repeat;
+        recordLastCharacterSearch(0, motionArgs);
+        return moveToCharacter(cm, repeat, motionArgs.forward,
+            motionArgs.selectedCharacter) || head;
+      },
+      moveToSymbol: function(cm, head, motionArgs) {
+        var repeat = motionArgs.repeat;
+        return findSymbol(cm, repeat, motionArgs.forward,
+            motionArgs.selectedCharacter) || head;
+      },
+      moveToColumn: function(cm, head, motionArgs, vim) {
+        var repeat = motionArgs.repeat;
+        vim.lastHPos = repeat - 1;
+        vim.lastHSPos = cm.charCoords(head,'div').left;
+        return moveToColumn(cm, repeat);
+      },
+      moveToEol: function(cm, head, motionArgs, vim, keepHPos) {
+        var cur = head;
+        var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity);
+        var end=cm.clipPos(retval);
+        end.ch--;
+        if (!keepHPos) {
+          vim.lastHPos = Infinity;
+          vim.lastHSPos = cm.charCoords(end,'div').left;
+        }
+        return retval;
+      },
+      moveToFirstNonWhiteSpaceCharacter: function(cm, head) {
+        var cursor = head;
+        return Pos(cursor.line,
+                   findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line)));
+      },
+      moveToMatchedSymbol: function(cm, head) {
+        var cursor = head;
+        var line = cursor.line;
+        var ch = cursor.ch;
+        var lineText = cm.getLine(line);
+        var symbol;
+        for (; ch < lineText.length; ch++) {
+          symbol = lineText.charAt(ch);
+          if (symbol && isMatchableSymbol(symbol)) {
+            var style = cm.getTokenTypeAt(Pos(line, ch + 1));
+            if (style !== "string" && style !== "comment") {
+              break;
+            }
+          }
+        }
+        if (ch < lineText.length) {
+          var re = /[<>]/.test(lineText[ch]) ? /[(){}[\]<>]/ : /[(){}[\]]/; //ace_patch?
+          var matched = cm.findMatchingBracket(Pos(line, ch+1), {bracketRegex: re});
+          return matched.to;
+        } else {
+          return cursor;
+        }
+      },
+      moveToStartOfLine: function(_cm, head) {
+        return Pos(head.line, 0);
+      },
+      moveToLineOrEdgeOfDocument: function(cm, _head, motionArgs) {
+        var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine();
+        if (motionArgs.repeatIsExplicit) {
+          lineNum = motionArgs.repeat - cm.getOption('firstLineNumber');
+        }
+        return Pos(lineNum,
+                   findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum)));
+      },
+      textObjectManipulation: function(cm, head, motionArgs, vim) {
+        var mirroredPairs = {'(': ')', ')': '(',
+                             '{': '}', '}': '{',
+                             '[': ']', ']': '[',
+                             '<': '>', '>': '<'};
+        var selfPaired = {'\'': true, '"': true, '`': true};
+
+        var character = motionArgs.selectedCharacter;
+        if (character == 'b') {
+          character = '(';
+        } else if (character == 'B') {
+          character = '{';
+        }
+        var inclusive = !motionArgs.textObjectInner;
+
+        var tmp;
+        if (mirroredPairs[character]) {
+          tmp = selectCompanionObject(cm, head, character, inclusive);
+        } else if (selfPaired[character]) {
+          tmp = findBeginningAndEnd(cm, head, character, inclusive);
+        } else if (character === 'W') {
+          tmp = expandWordUnderCursor(cm, inclusive, true /** forward */,
+                                                     true /** bigWord */);
+        } else if (character === 'w') {
+          tmp = expandWordUnderCursor(cm, inclusive, true /** forward */,
+                                                     false /** bigWord */);
+        } else if (character === 'p') {
+          tmp = findParagraph(cm, head, motionArgs.repeat, 0, inclusive);
+          motionArgs.linewise = true;
+          if (vim.visualMode) {
+            if (!vim.visualLine) { vim.visualLine = true; }
+          } else {
+            var operatorArgs = vim.inputState.operatorArgs;
+            if (operatorArgs) { operatorArgs.linewise = true; }
+            tmp.end.line--;
+          }
+        } else {
+          return null;
+        }
+
+        if (!cm.state.vim.visualMode) {
+          return [tmp.start, tmp.end];
+        } else {
+          return expandSelection(cm, tmp.start, tmp.end);
+        }
+      },
+
+      repeatLastCharacterSearch: function(cm, head, motionArgs) {
+        var lastSearch = vimGlobalState.lastCharacterSearch;
+        var repeat = motionArgs.repeat;
+        var forward = motionArgs.forward === lastSearch.forward;
+        var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1);
+        cm.moveH(-increment, 'char');
+        motionArgs.inclusive = forward ? true : false;
+        var curEnd = moveToCharacter(cm, repeat, forward, lastSearch.selectedCharacter);
+        if (!curEnd) {
+          cm.moveH(increment, 'char');
+          return head;
+        }
+        curEnd.ch += increment;
+        return curEnd;
+      }
+    };
+
+    function defineMotion(name, fn) {
+      motions[name] = fn;
+    }
+
+    function fillArray(val, times) {
+      var arr = [];
+      for (var i = 0; i < times; i++) {
+        arr.push(val);
+      }
+      return arr;
+    }
+    var operators = {
+      change: function(cm, args, ranges) {
+        var finalHead, text;
+        var vim = cm.state.vim;
+        var anchor = ranges[0].anchor,
+            head = ranges[0].head;
+        if (!vim.visualMode) {
+          text = cm.getRange(anchor, head);
+          var lastState = vim.lastEditInputState || {};
+          if (lastState.motion == "moveByWords" && !isWhiteSpaceString(text)) {
+            var match = (/\s+$/).exec(text);
+            if (match && lastState.motionArgs && lastState.motionArgs.forward) {
+              head = offsetCursor(head, 0, - match[0].length);
+              text = text.slice(0, - match[0].length);
+            }
+          }
+          var prevLineEnd = new Pos(anchor.line - 1, Number.MAX_VALUE);
+          var wasLastLine = cm.firstLine() == cm.lastLine();
+          if (head.line > cm.lastLine() && args.linewise && !wasLastLine) {
+            cm.replaceRange('', prevLineEnd, head);
+          } else {
+            cm.replaceRange('', anchor, head);
+          }
+          if (args.linewise) {
+            if (!wasLastLine) {
+              cm.setCursor(prevLineEnd);
+              CodeMirror.commands.newlineAndIndent(cm);
+            }
+            anchor.ch = Number.MAX_VALUE;
+          }
+          finalHead = anchor;
+        } else if (args.fullLine) {
+            head.ch = Number.MAX_VALUE;
+            head.line--;
+            cm.setSelection(anchor, head)
+            text = cm.getSelection();
+            cm.replaceSelection("");
+            finalHead = anchor;
+        } else {
+          text = cm.getSelection();
+          var replacement = fillArray('', ranges.length);
+          cm.replaceSelections(replacement);
+          finalHead = cursorMin(ranges[0].head, ranges[0].anchor);
+        }
+        vimGlobalState.registerController.pushText(
+            args.registerName, 'change', text,
+            args.linewise, ranges.length > 1);
+        actions.enterInsertMode(cm, {head: finalHead}, cm.state.vim);
+      },
+      'delete': function(cm, args, ranges) {
+        var finalHead, text;
+        var vim = cm.state.vim;
+        if (!vim.visualBlock) {
+          var anchor = ranges[0].anchor,
+              head = ranges[0].head;
+          if (args.linewise &&
+              head.line != cm.firstLine() &&
+              anchor.line == cm.lastLine() &&
+              anchor.line == head.line - 1) {
+            if (anchor.line == cm.firstLine()) {
+              anchor.ch = 0;
+            } else {
+              anchor = Pos(anchor.line - 1, lineLength(cm, anchor.line - 1));
+            }
+          }
+          text = cm.getRange(anchor, head);
+          cm.replaceRange('', anchor, head);
+          finalHead = anchor;
+          if (args.linewise) {
+            finalHead = motions.moveToFirstNonWhiteSpaceCharacter(cm, anchor);
+          }
+        } else {
+          text = cm.getSelection();
+          var replacement = fillArray('', ranges.length);
+          cm.replaceSelections(replacement);
+          finalHead = ranges[0].anchor;
+        }
+        vimGlobalState.registerController.pushText(
+            args.registerName, 'delete', text,
+            args.linewise, vim.visualBlock);
+        var includeLineBreak = vim.insertMode
+        return clipCursorToContent(cm, finalHead, includeLineBreak);
+      },
+      indent: function(cm, args, ranges) {
+        var vim = cm.state.vim;
+        var startLine = ranges[0].anchor.line;
+        var endLine = vim.visualBlock ?
+          ranges[ranges.length - 1].anchor.line :
+          ranges[0].head.line;
+        var repeat = (vim.visualMode) ? args.repeat : 1;
+        if (args.linewise) {
+          endLine--;
+        }
+        for (var i = startLine; i <= endLine; i++) {
+          for (var j = 0; j < repeat; j++) {
+            cm.indentLine(i, args.indentRight);
+          }
+        }
+        return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor);
+      },
+      indentAuto: function(cm, _args, ranges) {
+        cm.execCommand("indentAuto");
+        return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor);
+      },
+      changeCase: function(cm, args, ranges, oldAnchor, newHead) {
+        var selections = cm.getSelections();
+        var swapped = [];
+        var toLower = args.toLower;
+        for (var j = 0; j < selections.length; j++) {
+          var toSwap = selections[j];
+          var text = '';
+          if (toLower === true) {
+            text = toSwap.toLowerCase();
+          } else if (toLower === false) {
+            text = toSwap.toUpperCase();
+          } else {
+            for (var i = 0; i < toSwap.length; i++) {
+              var character = toSwap.charAt(i);
+              text += isUpperCase(character) ? character.toLowerCase() :
+                  character.toUpperCase();
+            }
+          }
+          swapped.push(text);
+        }
+        cm.replaceSelections(swapped);
+        if (args.shouldMoveCursor){
+          return newHead;
+        } else if (!cm.state.vim.visualMode && args.linewise && ranges[0].anchor.line + 1 == ranges[0].head.line) {
+          return motions.moveToFirstNonWhiteSpaceCharacter(cm, oldAnchor);
+        } else if (args.linewise){
+          return oldAnchor;
+        } else {
+          return cursorMin(ranges[0].anchor, ranges[0].head);
+        }
+      },
+      yank: function(cm, args, ranges, oldAnchor) {
+        var vim = cm.state.vim;
+        var text = cm.getSelection();
+        var endPos = vim.visualMode
+          ? cursorMin(vim.sel.anchor, vim.sel.head, ranges[0].head, ranges[0].anchor)
+          : oldAnchor;
+        vimGlobalState.registerController.pushText(
+            args.registerName, 'yank',
+            text, args.linewise, vim.visualBlock);
+        return endPos;
+      }
+    };
+
+    function defineOperator(name, fn) {
+      operators[name] = fn;
+    }
+
+    var actions = {
+      jumpListWalk: function(cm, actionArgs, vim) {
+        if (vim.visualMode) {
+          return;
+        }
+        var repeat = actionArgs.repeat;
+        var forward = actionArgs.forward;
+        var jumpList = vimGlobalState.jumpList;
+
+        var mark = jumpList.move(cm, forward ? repeat : -repeat);
+        var markPos = mark ? mark.find() : undefined;
+        markPos = markPos ? markPos : cm.getCursor();
+        cm.setCursor(markPos);
+        cm.ace.curOp.command.scrollIntoView = "center-animate"; // ace_patch
+      },
+      scroll: function(cm, actionArgs, vim) {
+        if (vim.visualMode) {
+          return;
+        }
+        var repeat = actionArgs.repeat || 1;
+        var lineHeight = cm.defaultTextHeight();
+        var top = cm.getScrollInfo().top;
+        var delta = lineHeight * repeat;
+        var newPos = actionArgs.forward ? top + delta : top - delta;
+        var cursor = copyCursor(cm.getCursor());
+        var cursorCoords = cm.charCoords(cursor, 'local');
+        if (actionArgs.forward) {
+          if (newPos > cursorCoords.top) {
+             cursor.line += (newPos - cursorCoords.top) / lineHeight;
+             cursor.line = Math.ceil(cursor.line);
+             cm.setCursor(cursor);
+             cursorCoords = cm.charCoords(cursor, 'local');
+             cm.scrollTo(null, cursorCoords.top);
+          } else {
+             cm.scrollTo(null, newPos);
+          }
+        } else {
+          var newBottom = newPos + cm.getScrollInfo().clientHeight;
+          if (newBottom < cursorCoords.bottom) {
+             cursor.line -= (cursorCoords.bottom - newBottom) / lineHeight;
+             cursor.line = Math.floor(cursor.line);
+             cm.setCursor(cursor);
+             cursorCoords = cm.charCoords(cursor, 'local');
+             cm.scrollTo(
+                 null, cursorCoords.bottom - cm.getScrollInfo().clientHeight);
+          } else {
+             cm.scrollTo(null, newPos);
+          }
+        }
+      },
+      scrollToCursor: function(cm, actionArgs) {
+        var lineNum = cm.getCursor().line;
+        var charCoords = cm.charCoords(Pos(lineNum, 0), 'local');
+        var height = cm.getScrollInfo().clientHeight;
+        var y = charCoords.top;
+        var lineHeight = charCoords.bottom - y;
+        switch (actionArgs.position) {
+          case 'center': y = y - (height / 2) + lineHeight;
+            break;
+          case 'bottom': y = y - height + lineHeight;
+            break;
+        }
+        cm.scrollTo(null, y);
+      },
+      replayMacro: function(cm, actionArgs, vim) {
+        var registerName = actionArgs.selectedCharacter;
+        var repeat = actionArgs.repeat;
+        var macroModeState = vimGlobalState.macroModeState;
+        if (registerName == '@') {
+          registerName = macroModeState.latestRegister;
+        } else {
+          macroModeState.latestRegister = registerName;
+        }
+        while(repeat--){
+          executeMacroRegister(cm, vim, macroModeState, registerName);
+        }
+      },
+      enterMacroRecordMode: function(cm, actionArgs) {
+        var macroModeState = vimGlobalState.macroModeState;
+        var registerName = actionArgs.selectedCharacter;
+        if (vimGlobalState.registerController.isValidRegister(registerName)) {
+          macroModeState.enterMacroRecordMode(cm, registerName);
+        }
+      },
+      toggleOverwrite: function(cm) {
+        if (!cm.state.overwrite) {
+          cm.toggleOverwrite(true);
+          cm.setOption('keyMap', 'vim-replace');
+          CodeMirror.signal(cm, "vim-mode-change", {mode: "replace"});
+        } else {
+          cm.toggleOverwrite(false);
+          cm.setOption('keyMap', 'vim-insert');
+          CodeMirror.signal(cm, "vim-mode-change", {mode: "insert"});
+        }
+      },
+      enterInsertMode: function(cm, actionArgs, vim) {
+        if (cm.getOption('readOnly')) { return; }
+        vim.insertMode = true;
+        vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1;
+        var insertAt = (actionArgs) ? actionArgs.insertAt : null;
+        var sel = vim.sel;
+        var head = actionArgs.head || cm.getCursor('head');
+        var height = cm.listSelections().length;
+        if (insertAt == 'eol') {
+          head = Pos(head.line, lineLength(cm, head.line));
+        } else if (insertAt == 'bol') {
+          head = Pos(head.line, 0);
+        } else if (insertAt == 'charAfter') {
+          head = offsetCursor(head, 0, 1);
+        } else if (insertAt == 'firstNonBlank') {
+          head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head);
+        } else if (insertAt == 'startOfSelectedArea') {
+          if (!vim.visualMode)
+              return;
+          if (!vim.visualBlock) {
+            if (sel.head.line < sel.anchor.line) {
+              head = sel.head;
+            } else {
+              head = Pos(sel.anchor.line, 0);
+            }
+          } else {
+            head = Pos(
+                Math.min(sel.head.line, sel.anchor.line),
+                Math.min(sel.head.ch, sel.anchor.ch));
+            height = Math.abs(sel.head.line - sel.anchor.line) + 1;
+          }
+        } else if (insertAt == 'endOfSelectedArea') {
+            if (!vim.visualMode)
+              return;
+          if (!vim.visualBlock) {
+            if (sel.head.line >= sel.anchor.line) {
+              head = offsetCursor(sel.head, 0, 1);
+            } else {
+              head = Pos(sel.anchor.line, 0);
+            }
+          } else {
+            head = Pos(
+                Math.min(sel.head.line, sel.anchor.line),
+                Math.max(sel.head.ch + 1, sel.anchor.ch));
+            height = Math.abs(sel.head.line - sel.anchor.line) + 1;
+          }
+        } else if (insertAt == 'inplace') {
+          if (vim.visualMode){
+            return;
+          }
+        } else if (insertAt == 'lastEdit') {
+          head = getLastEditPos(cm) || head;
+        }
+        cm.setOption('disableInput', false);
+        if (actionArgs && actionArgs.replace) {
+          cm.toggleOverwrite(true);
+          cm.setOption('keyMap', 'vim-replace');
+          CodeMirror.signal(cm, "vim-mode-change", {mode: "replace"});
+        } else {
+          cm.toggleOverwrite(false);
+          cm.setOption('keyMap', 'vim-insert');
+          CodeMirror.signal(cm, "vim-mode-change", {mode: "insert"});
+        }
+        if (!vimGlobalState.macroModeState.isPlaying) {
+          cm.on('change', onChange);
+          CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);
+        }
+        if (vim.visualMode) {
+          exitVisualMode(cm);
+        }
+        selectForInsert(cm, head, height);
+      },
+      toggleVisualMode: function(cm, actionArgs, vim) {
+        var repeat = actionArgs.repeat;
+        var anchor = cm.getCursor();
+        var head;
+        if (!vim.visualMode) {
+          vim.visualMode = true;
+          vim.visualLine = !!actionArgs.linewise;
+          vim.visualBlock = !!actionArgs.blockwise;
+          head = clipCursorToContent(
+              cm, Pos(anchor.line, anchor.ch + repeat - 1),
+              true /** includeLineBreak */);
+          vim.sel = {
+            anchor: anchor,
+            head: head
+          };
+          CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""});
+          updateCmSelection(cm);
+          updateMark(cm, vim, '<', cursorMin(anchor, head));
+          updateMark(cm, vim, '>', cursorMax(anchor, head));
+        } else if (vim.visualLine ^ actionArgs.linewise ||
+            vim.visualBlock ^ actionArgs.blockwise) {
+          vim.visualLine = !!actionArgs.linewise;
+          vim.visualBlock = !!actionArgs.blockwise;
+          CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""});
+          updateCmSelection(cm);
+        } else {
+          exitVisualMode(cm);
+        }
+      },
+      reselectLastSelection: function(cm, _actionArgs, vim) {
+        var lastSelection = vim.lastSelection;
+        if (vim.visualMode) {
+          updateLastSelection(cm, vim);
+        }
+        if (lastSelection) {
+          var anchor = lastSelection.anchorMark.find();
+          var head = lastSelection.headMark.find();
+          if (!anchor || !head) {
+            return;
+          }
+          vim.sel = {
+            anchor: anchor,
+            head: head
+          };
+          vim.visualMode = true;
+          vim.visualLine = lastSelection.visualLine;
+          vim.visualBlock = lastSelection.visualBlock;
+          updateCmSelection(cm);
+          updateMark(cm, vim, '<', cursorMin(anchor, head));
+          updateMark(cm, vim, '>', cursorMax(anchor, head));
+          CodeMirror.signal(cm, 'vim-mode-change', {
+            mode: 'visual',
+            subMode: vim.visualLine ? 'linewise' :
+                     vim.visualBlock ? 'blockwise' : ''});
+        }
+      },
+      joinLines: function(cm, actionArgs, vim) {
+        var curStart, curEnd;
+        if (vim.visualMode) {
+          curStart = cm.getCursor('anchor');
+          curEnd = cm.getCursor('head');
+          if (cursorIsBefore(curEnd, curStart)) {
+            var tmp = curEnd;
+            curEnd = curStart;
+            curStart = tmp;
+          }
+          curEnd.ch = lineLength(cm, curEnd.line) - 1;
+        } else {
+          var repeat = Math.max(actionArgs.repeat, 2);
+          curStart = cm.getCursor();
+          curEnd = clipCursorToContent(cm, Pos(curStart.line + repeat - 1,
+                                               Infinity));
+        }
+        var finalCh = 0;
+        for (var i = curStart.line; i < curEnd.line; i++) {
+          finalCh = lineLength(cm, curStart.line);
+          var tmp = Pos(curStart.line + 1,
+                        lineLength(cm, curStart.line + 1));
+          var text = cm.getRange(curStart, tmp);
+          text = actionArgs.keepSpaces
+            ? text.replace(/\n\r?/g, '')
+            : text.replace(/\n\s*/g, ' ');
+          cm.replaceRange(text, curStart, tmp);
+        }
+        var curFinalPos = Pos(curStart.line, finalCh);
+        if (vim.visualMode) {
+          exitVisualMode(cm, false);
+        }
+        cm.setCursor(curFinalPos);
+      },
+      newLineAndEnterInsertMode: function(cm, actionArgs, vim) {
+        vim.insertMode = true;
+        var insertAt = copyCursor(cm.getCursor());
+        if (insertAt.line === cm.firstLine() && !actionArgs.after) {
+          cm.replaceRange('\n', Pos(cm.firstLine(), 0));
+          cm.setCursor(cm.firstLine(), 0);
+        } else {
+          insertAt.line = (actionArgs.after) ? insertAt.line :
+              insertAt.line - 1;
+          insertAt.ch = lineLength(cm, insertAt.line);
+          cm.setCursor(insertAt);
+          var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment ||
+              CodeMirror.commands.newlineAndIndent;
+          newlineFn(cm);
+        }
+        this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim);
+      },
+      paste: function(cm, actionArgs, vim) {
+        var cur = copyCursor(cm.getCursor());
+        var register = vimGlobalState.registerController.getRegister(
+            actionArgs.registerName);
+        var text = register.toString();
+        if (!text) {
+          return;
+        }
+        if (actionArgs.matchIndent) {
+          var tabSize = cm.getOption("tabSize");
+          var whitespaceLength = function(str) {
+            var tabs = (str.split("\t").length - 1);
+            var spaces = (str.split(" ").length - 1);
+            return tabs * tabSize + spaces * 1;
+          };
+          var currentLine = cm.getLine(cm.getCursor().line);
+          var indent = whitespaceLength(currentLine.match(/^\s*/)[0]);
+          var chompedText = text.replace(/\n$/, '');
+          var wasChomped = text !== chompedText;
+          var firstIndent = whitespaceLength(text.match(/^\s*/)[0]);
+          var text = chompedText.replace(/^\s*/gm, function(wspace) {
+            var newIndent = indent + (whitespaceLength(wspace) - firstIndent);
+            if (newIndent < 0) {
+              return "";
+            }
+            else if (cm.getOption("indentWithTabs")) {
+              var quotient = Math.floor(newIndent / tabSize);
+              return Array(quotient + 1).join('\t');
+            }
+            else {
+              return Array(newIndent + 1).join(' ');
+            }
+          });
+          text += wasChomped ? "\n" : "";
+        }
+        if (actionArgs.repeat > 1) {
+          var text = Array(actionArgs.repeat + 1).join(text);
+        }
+        var linewise = register.linewise;
+        var blockwise = register.blockwise;
+        if (blockwise) {
+          text = text.split('\n');
+          if (linewise) {
+              text.pop();
+          }
+          for (var i = 0; i < text.length; i++) {
+            text[i] = (text[i] == '') ? ' ' : text[i];
+          }
+          cur.ch += actionArgs.after ? 1 : 0;
+          cur.ch = Math.min(lineLength(cm, cur.line), cur.ch);
+        } else if (linewise) {
+          if(vim.visualMode) {
+            text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n';
+          } else if (actionArgs.after) {
+            text = '\n' + text.slice(0, text.length - 1);
+            cur.ch = lineLength(cm, cur.line);
+          } else {
+            cur.ch = 0;
+          }
+        } else {
+          cur.ch += actionArgs.after ? 1 : 0;
+        }
+        var curPosFinal;
+        var idx;
+        if (vim.visualMode) {
+          vim.lastPastedText = text;
+          var lastSelectionCurEnd;
+          var selectedArea = getSelectedAreaRange(cm, vim);
+          var selectionStart = selectedArea[0];
+          var selectionEnd = selectedArea[1];
+          var selectedText = cm.getSelection();
+          var selections = cm.listSelections();
+          var emptyStrings = new Array(selections.length).join('1').split('1');
+          if (vim.lastSelection) {
+            lastSelectionCurEnd = vim.lastSelection.headMark.find();
+          }
+          vimGlobalState.registerController.unnamedRegister.setText(selectedText);
+          if (blockwise) {
+            cm.replaceSelections(emptyStrings);
+            selectionEnd = Pos(selectionStart.line + text.length-1, selectionStart.ch);
+            cm.setCursor(selectionStart);
+            selectBlock(cm, selectionEnd);
+            cm.replaceSelections(text);
+            curPosFinal = selectionStart;
+          } else if (vim.visualBlock) {
+            cm.replaceSelections(emptyStrings);
+            cm.setCursor(selectionStart);
+            cm.replaceRange(text, selectionStart, selectionStart);
+            curPosFinal = selectionStart;
+          } else {
+            cm.replaceRange(text, selectionStart, selectionEnd);
+            curPosFinal = cm.posFromIndex(cm.indexFromPos(selectionStart) + text.length - 1);
+          }
+          if(lastSelectionCurEnd) {
+            vim.lastSelection.headMark = cm.setBookmark(lastSelectionCurEnd);
+          }
+          if (linewise) {
+            curPosFinal.ch=0;
+          }
+        } else {
+          if (blockwise) {
+            cm.setCursor(cur);
+            for (var i = 0; i < text.length; i++) {
+              var line = cur.line+i;
+              if (line > cm.lastLine()) {
+                cm.replaceRange('\n',  Pos(line, 0));
+              }
+              var lastCh = lineLength(cm, line);
+              if (lastCh < cur.ch) {
+                extendLineToColumn(cm, line, cur.ch);
+              }
+            }
+            cm.setCursor(cur);
+            selectBlock(cm, Pos(cur.line + text.length-1, cur.ch));
+            cm.replaceSelections(text);
+            curPosFinal = cur;
+          } else {
+            cm.replaceRange(text, cur);
+            if (linewise && actionArgs.after) {
+              curPosFinal = Pos(
+              cur.line + 1,
+              findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1)));
+            } else if (linewise && !actionArgs.after) {
+              curPosFinal = Pos(
+                cur.line,
+                findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line)));
+            } else if (!linewise && actionArgs.after) {
+              idx = cm.indexFromPos(cur);
+              curPosFinal = cm.posFromIndex(idx + text.length - 1);
+            } else {
+              idx = cm.indexFromPos(cur);
+              curPosFinal = cm.posFromIndex(idx + text.length);
+            }
+          }
+        }
+        if (vim.visualMode) {
+          exitVisualMode(cm, false);
+        }
+        cm.setCursor(curPosFinal);
+      },
+      undo: function(cm, actionArgs) {
+        cm.operation(function() {
+          repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)();
+          cm.setCursor(cm.getCursor('anchor'));
+        });
+      },
+      redo: function(cm, actionArgs) {
+        repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)();
+      },
+      setRegister: function(_cm, actionArgs, vim) {
+        vim.inputState.registerName = actionArgs.selectedCharacter;
+      },
+      setMark: function(cm, actionArgs, vim) {
+        var markName = actionArgs.selectedCharacter;
+        updateMark(cm, vim, markName, cm.getCursor());
+      },
+      replace: function(cm, actionArgs, vim) {
+        var replaceWith = actionArgs.selectedCharacter;
+        var curStart = cm.getCursor();
+        var replaceTo;
+        var curEnd;
+        var selections = cm.listSelections();
+        if (vim.visualMode) {
+          curStart = cm.getCursor('start');
+          curEnd = cm.getCursor('end');
+        } else {
+          var line = cm.getLine(curStart.line);
+          replaceTo = curStart.ch + actionArgs.repeat;
+          if (replaceTo > line.length) {
+            replaceTo=line.length;
+          }
+          curEnd = Pos(curStart.line, replaceTo);
+        }
+        if (replaceWith=='\n') {
+          if (!vim.visualMode) cm.replaceRange('', curStart, curEnd);
+          (CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm);
+        } else {
+          var replaceWithStr = cm.getRange(curStart, curEnd);
+          replaceWithStr = replaceWithStr.replace(/[^\n]/g, replaceWith);
+          if (vim.visualBlock) {
+            var spaces = new Array(cm.getOption("tabSize")+1).join(' ');
+            replaceWithStr = cm.getSelection();
+            replaceWithStr = replaceWithStr.replace(/\t/g, spaces).replace(/[^\n]/g, replaceWith).split('\n');
+            cm.replaceSelections(replaceWithStr);
+          } else {
+            cm.replaceRange(replaceWithStr, curStart, curEnd);
+          }
+          if (vim.visualMode) {
+            curStart = cursorIsBefore(selections[0].anchor, selections[0].head) ?
+                         selections[0].anchor : selections[0].head;
+            cm.setCursor(curStart);
+            exitVisualMode(cm, false);
+          } else {
+            cm.setCursor(offsetCursor(curEnd, 0, -1));
+          }
+        }
+      },
+      incrementNumberToken: function(cm, actionArgs) {
+        var cur = cm.getCursor();
+        var lineStr = cm.getLine(cur.line);
+        var re = /(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;
+        var match;
+        var start;
+        var end;
+        var numberStr;
+        while ((match = re.exec(lineStr)) !== null) {
+          start = match.index;
+          end = start + match[0].length;
+          if (cur.ch < end)break;
+        }
+        if (!actionArgs.backtrack && (end <= cur.ch))return;
+        if (match) {
+          var baseStr = match[2] || match[4]
+          var digits = match[3] || match[5]
+          var increment = actionArgs.increase ? 1 : -1;
+          var base = {'0b': 2, '0': 8, '': 10, '0x': 16}[baseStr.toLowerCase()];
+          var number = parseInt(match[1] + digits, base) + (increment * actionArgs.repeat);
+          numberStr = number.toString(base);
+          var zeroPadding = baseStr ? new Array(digits.length - numberStr.length + 1 + match[1].length).join('0') : ''
+          if (numberStr.charAt(0) === '-') {
+            numberStr = '-' + baseStr + zeroPadding + numberStr.substr(1);
+          } else {
+            numberStr = baseStr + zeroPadding + numberStr;
+          }
+          var from = Pos(cur.line, start);
+          var to = Pos(cur.line, end);
+          cm.replaceRange(numberStr, from, to);
+        } else {
+          return;
+        }
+        cm.setCursor(Pos(cur.line, start + numberStr.length - 1));
+      },
+      repeatLastEdit: function(cm, actionArgs, vim) {
+        var lastEditInputState = vim.lastEditInputState;
+        if (!lastEditInputState) { return; }
+        var repeat = actionArgs.repeat;
+        if (repeat && actionArgs.repeatIsExplicit) {
+          vim.lastEditInputState.repeatOverride = repeat;
+        } else {
+          repeat = vim.lastEditInputState.repeatOverride || repeat;
+        }
+        repeatLastEdit(cm, vim, repeat, false /** repeatForInsert */);
+      },
+      indent: function(cm, actionArgs) {
+        cm.indentLine(cm.getCursor().line, actionArgs.indentRight);
+      },
+      exitInsertMode: exitInsertMode
+    };
+
+    function defineAction(name, fn) {
+      actions[name] = fn;
+    }
+    function clipCursorToContent(cm, cur, includeLineBreak) {
+      var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() );
+      var maxCh = lineLength(cm, line) - 1;
+      maxCh = (includeLineBreak) ? maxCh + 1 : maxCh;
+      var ch = Math.min(Math.max(0, cur.ch), maxCh);
+      return Pos(line, ch);
+    }
+    function copyArgs(args) {
+      var ret = {};
+      for (var prop in args) {
+        if (args.hasOwnProperty(prop)) {
+          ret[prop] = args[prop];
+        }
+      }
+      return ret;
+    }
+    function offsetCursor(cur, offsetLine, offsetCh) {
+      if (typeof offsetLine === 'object') {
+        offsetCh = offsetLine.ch;
+        offsetLine = offsetLine.line;
+      }
+      return Pos(cur.line + offsetLine, cur.ch + offsetCh);
+    }
+    function commandMatches(keys, keyMap, context, inputState) {
+      var match, partial = [], full = [];
+      for (var i = 0; i < keyMap.length; i++) {
+        var command = keyMap[i];
+        if (context == 'insert' && command.context != 'insert' ||
+            command.context && command.context != context ||
+            inputState.operator && command.type == 'action' ||
+            !(match = commandMatch(keys, command.keys))) { continue; }
+        if (match == 'partial') { partial.push(command); }
+        if (match == 'full') { full.push(command); }
+      }
+      return {
+        partial: partial.length && partial,
+        full: full.length && full
+      };
+    }
+    function commandMatch(pressed, mapped) {
+      if (mapped.slice(-11) == '<character>') {
+        var prefixLen = mapped.length - 11;
+        var pressedPrefix = pressed.slice(0, prefixLen);
+        var mappedPrefix = mapped.slice(0, prefixLen);
+        return pressedPrefix == mappedPrefix && pressed.length > prefixLen ? 'full' :
+               mappedPrefix.indexOf(pressedPrefix) == 0 ? 'partial' : false;
+      } else {
+        return pressed == mapped ? 'full' :
+               mapped.indexOf(pressed) == 0 ? 'partial' : false;
+      }
+    }
+    function lastChar(keys) {
+      var match = /^.*(<[^>]+>)$/.exec(keys);
+      var selectedCharacter = match ? match[1] : keys.slice(-1);
+      if (selectedCharacter.length > 1){
+        switch(selectedCharacter){
+          case '<CR>':
+            selectedCharacter='\n';
+            break;
+          case '<Space>':
+            selectedCharacter=' ';
+            break;
+          default:
+            selectedCharacter='';
+            break;
+        }
+      }
+      return selectedCharacter;
+    }
+    function repeatFn(cm, fn, repeat) {
+      return function() {
+        for (var i = 0; i < repeat; i++) {
+          fn(cm);
+        }
+      };
+    }
+    function copyCursor(cur) {
+      return Pos(cur.line, cur.ch);
+    }
+    function cursorEqual(cur1, cur2) {
+      return cur1.ch == cur2.ch && cur1.line == cur2.line;
+    }
+    function cursorIsBefore(cur1, cur2) {
+      if (cur1.line < cur2.line) {
+        return true;
+      }
+      if (cur1.line == cur2.line && cur1.ch < cur2.ch) {
+        return true;
+      }
+      return false;
+    }
+    function cursorMin(cur1, cur2) {
+      if (arguments.length > 2) {
+        cur2 = cursorMin.apply(undefined, Array.prototype.slice.call(arguments, 1));
+      }
+      return cursorIsBefore(cur1, cur2) ? cur1 : cur2;
+    }
+    function cursorMax(cur1, cur2) {
+      if (arguments.length > 2) {
+        cur2 = cursorMax.apply(undefined, Array.prototype.slice.call(arguments, 1));
+      }
+      return cursorIsBefore(cur1, cur2) ? cur2 : cur1;
+    }
+    function cursorIsBetween(cur1, cur2, cur3) {
+      var cur1before2 = cursorIsBefore(cur1, cur2);
+      var cur2before3 = cursorIsBefore(cur2, cur3);
+      return cur1before2 && cur2before3;
+    }
+    function lineLength(cm, lineNum) {
+      return cm.getLine(lineNum).length;
+    }
+    function trim(s) {
+      if (s.trim) {
+        return s.trim();
+      }
+      return s.replace(/^\s+|\s+$/g, '');
+    }
+    function escapeRegex(s) {
+      return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, '\\$1');
+    }
+    function extendLineToColumn(cm, lineNum, column) {
+      var endCh = lineLength(cm, lineNum);
+      var spaces = new Array(column-endCh+1).join(' ');
+      cm.setCursor(Pos(lineNum, endCh));
+      cm.replaceRange(spaces, cm.getCursor());
+    }
+    function selectBlock(cm, selectionEnd) {
+      var selections = [], ranges = cm.listSelections();
+      var head = copyCursor(cm.clipPos(selectionEnd));
+      var isClipped = !cursorEqual(selectionEnd, head);
+      var curHead = cm.getCursor('head');
+      var primIndex = getIndex(ranges, curHead);
+      var wasClipped = cursorEqual(ranges[primIndex].head, ranges[primIndex].anchor);
+      var max = ranges.length - 1;
+      var index = max - primIndex > primIndex ? max : 0;
+      var base = ranges[index].anchor;
+
+      var firstLine = Math.min(base.line, head.line);
+      var lastLine = Math.max(base.line, head.line);
+      var baseCh = base.ch, headCh = head.ch;
+
+      var dir = ranges[index].head.ch - baseCh;
+      var newDir = headCh - baseCh;
+      if (dir > 0 && newDir <= 0) {
+        baseCh++;
+        if (!isClipped) { headCh--; }
+      } else if (dir < 0 && newDir >= 0) {
+        baseCh--;
+        if (!wasClipped) { headCh++; }
+      } else if (dir < 0 && newDir == -1) {
+        baseCh--;
+        headCh++;
+      }
+      for (var line = firstLine; line <= lastLine; line++) {
+        var range = {anchor: new Pos(line, baseCh), head: new Pos(line, headCh)};
+        selections.push(range);
+      }
+      cm.setSelections(selections);
+      selectionEnd.ch = headCh;
+      base.ch = baseCh;
+      return base;
+    }
+    function selectForInsert(cm, head, height) {
+      var sel = [];
+      for (var i = 0; i < height; i++) {
+        var lineHead = offsetCursor(head, i, 0);
+        sel.push({anchor: lineHead, head: lineHead});
+      }
+      cm.setSelections(sel, 0);
+    }
+    function getIndex(ranges, cursor, end) {
+      for (var i = 0; i < ranges.length; i++) {
+        var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor);
+        var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor);
+        if (atAnchor || atHead) {
+          return i;
+        }
+      }
+      return -1;
+    }
+    function getSelectedAreaRange(cm, vim) {
+      var lastSelection = vim.lastSelection;
+      var getCurrentSelectedAreaRange = function() {
+        var selections = cm.listSelections();
+        var start =  selections[0];
+        var end = selections[selections.length-1];
+        var selectionStart = cursorIsBefore(start.anchor, start.head) ? start.anchor : start.head;
+        var selectionEnd = cursorIsBefore(end.anchor, end.head) ? end.head : end.anchor;
+        return [selectionStart, selectionEnd];
+      };
+      var getLastSelectedAreaRange = function() {
+        var selectionStart = cm.getCursor();
+        var selectionEnd = cm.getCursor();
+        var block = lastSelection.visualBlock;
+        if (block) {
+          var width = block.width;
+          var height = block.height;
+          selectionEnd = Pos(selectionStart.line + height, selectionStart.ch + width);
+          var selections = [];
+          for (var i = selectionStart.line; i < selectionEnd.line; i++) {
+            var anchor = Pos(i, selectionStart.ch);
+            var head = Pos(i, selectionEnd.ch);
+            var range = {anchor: anchor, head: head};
+            selections.push(range);
+          }
+          cm.setSelections(selections);
+        } else {
+          var start = lastSelection.anchorMark.find();
+          var end = lastSelection.headMark.find();
+          var line = end.line - start.line;
+          var ch = end.ch - start.ch;
+          selectionEnd = {line: selectionEnd.line + line, ch: line ? selectionEnd.ch : ch + selectionEnd.ch};
+          if (lastSelection.visualLine) {
+            selectionStart = Pos(selectionStart.line, 0);
+            selectionEnd = Pos(selectionEnd.line, lineLength(cm, selectionEnd.line));
+          }
+          cm.setSelection(selectionStart, selectionEnd);
+        }
+        return [selectionStart, selectionEnd];
+      };
+      if (!vim.visualMode) {
+        return getLastSelectedAreaRange();
+      } else {
+        return getCurrentSelectedAreaRange();
+      }
+    }
+    function updateLastSelection(cm, vim) {
+      var anchor = vim.sel.anchor;
+      var head = vim.sel.head;
+      if (vim.lastPastedText) {
+        head = cm.posFromIndex(cm.indexFromPos(anchor) + vim.lastPastedText.length);
+        vim.lastPastedText = null;
+      }
+      vim.lastSelection = {'anchorMark': cm.setBookmark(anchor),
+                           'headMark': cm.setBookmark(head),
+                           'anchor': copyCursor(anchor),
+                           'head': copyCursor(head),
+                           'visualMode': vim.visualMode,
+                           'visualLine': vim.visualLine,
+                           'visualBlock': vim.visualBlock};
+    }
+    function expandSelection(cm, start, end) {
+      var sel = cm.state.vim.sel;
+      var head = sel.head;
+      var anchor = sel.anchor;
+      var tmp;
+      if (cursorIsBefore(end, start)) {
+        tmp = end;
+        end = start;
+        start = tmp;
+      }
+      if (cursorIsBefore(head, anchor)) {
+        head = cursorMin(start, head);
+        anchor = cursorMax(anchor, end);
+      } else {
+        anchor = cursorMin(start, anchor);
+        head = cursorMax(head, end);
+        head = offsetCursor(head, 0, -1);
+        if (head.ch == -1 && head.line != cm.firstLine()) {
+          head = Pos(head.line - 1, lineLength(cm, head.line - 1));
+        }
+      }
+      return [anchor, head];
+    }
+    function updateCmSelection(cm, sel, mode) {
+      var vim = cm.state.vim;
+      sel = sel || vim.sel;
+      var mode = mode ||
+        vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char';
+      var cmSel = makeCmSelection(cm, sel, mode);
+      cm.setSelections(cmSel.ranges, cmSel.primary);
+      updateFakeCursor(cm);
+    }
+    function makeCmSelection(cm, sel, mode, exclusive) {
+      var head = copyCursor(sel.head);
+      var anchor = copyCursor(sel.anchor);
+      if (mode == 'char') {
+        var headOffset = !exclusive && !cursorIsBefore(sel.head, sel.anchor) ? 1 : 0;
+        var anchorOffset = cursorIsBefore(sel.head, sel.anchor) ? 1 : 0;
+        head = offsetCursor(sel.head, 0, headOffset);
+        anchor = offsetCursor(sel.anchor, 0, anchorOffset);
+        return {
+          ranges: [{anchor: anchor, head: head}],
+          primary: 0
+        };
+      } else if (mode == 'line') {
+        if (!cursorIsBefore(sel.head, sel.anchor)) {
+          anchor.ch = 0;
+
+          var lastLine = cm.lastLine();
+          if (head.line > lastLine) {
+            head.line = lastLine;
+          }
+          head.ch = lineLength(cm, head.line);
+        } else {
+          head.ch = 0;
+          anchor.ch = lineLength(cm, anchor.line);
+        }
+        return {
+          ranges: [{anchor: anchor, head: head}],
+          primary: 0
+        };
+      } else if (mode == 'block') {
+        var top = Math.min(anchor.line, head.line),
+            left = Math.min(anchor.ch, head.ch),
+            bottom = Math.max(anchor.line, head.line),
+            right = Math.max(anchor.ch, head.ch) + 1;
+        var height = bottom - top + 1;
+        var primary = head.line == top ? 0 : height - 1;
+        var ranges = [];
+        for (var i = 0; i < height; i++) {
+          ranges.push({
+            anchor: Pos(top + i, left),
+            head: Pos(top + i, right)
+          });
+        }
+        return {
+          ranges: ranges,
+          primary: primary
+        };
+      }
+    }
+    function getHead(cm) {
+      var cur = cm.getCursor('head');
+      if (cm.getSelection().length == 1) {
+        cur = cursorMin(cur, cm.getCursor('anchor'));
+      }
+      return cur;
+    }
+    function exitVisualMode(cm, moveHead) {
+      var vim = cm.state.vim;
+      if (moveHead !== false) {
+        cm.setCursor(clipCursorToContent(cm, vim.sel.head));
+      }
+      updateLastSelection(cm, vim);
+      vim.visualMode = false;
+      vim.visualLine = false;
+      vim.visualBlock = false;
+      CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
+      if (vim.fakeCursor) {
+        vim.fakeCursor.clear();
+      }
+    }
+    function clipToLine(cm, curStart, curEnd) {
+      var selection = cm.getRange(curStart, curEnd);
+      if (/\n\s*$/.test(selection)) {
+        var lines = selection.split('\n');
+        lines.pop();
+        var line;
+        for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) {
+          curEnd.line--;
+          curEnd.ch = 0;
+        }
+        if (line) {
+          curEnd.line--;
+          curEnd.ch = lineLength(cm, curEnd.line);
+        } else {
+          curEnd.ch = 0;
+        }
+      }
+    }
+    function expandSelectionToLine(_cm, curStart, curEnd) {
+      curStart.ch = 0;
+      curEnd.ch = 0;
+      curEnd.line++;
+    }
+
+    function findFirstNonWhiteSpaceCharacter(text) {
+      if (!text) {
+        return 0;
+      }
+      var firstNonWS = text.search(/\S/);
+      return firstNonWS == -1 ? text.length : firstNonWS;
+    }
+
+    function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbol) {
+      var cur = getHead(cm);
+      var line = cm.getLine(cur.line);
+      var idx = cur.ch;
+      var test = noSymbol ? wordCharTest[0] : bigWordCharTest [0];
+      while (!test(line.charAt(idx))) {
+        idx++;
+        if (idx >= line.length) { return null; }
+      }
+
+      if (bigWord) {
+        test = bigWordCharTest[0];
+      } else {
+        test = wordCharTest[0];
+        if (!test(line.charAt(idx))) {
+          test = wordCharTest[1];
+        }
+      }
+
+      var end = idx, start = idx;
+      while (test(line.charAt(end)) && end < line.length) { end++; }
+      while (test(line.charAt(start)) && start >= 0) { start--; }
+      start++;
+
+      if (inclusive) {
+        var wordEnd = end;
+        while (/\s/.test(line.charAt(end)) && end < line.length) { end++; }
+        if (wordEnd == end) {
+          var wordStart = start;
+          while (/\s/.test(line.charAt(start - 1)) && start > 0) { start--; }
+          if (!start) { start = wordStart; }
+        }
+      }
+      return { start: Pos(cur.line, start), end: Pos(cur.line, end) };
+    }
+
+    function recordJumpPosition(cm, oldCur, newCur) {
+      if (!cursorEqual(oldCur, newCur)) {
+        vimGlobalState.jumpList.add(cm, oldCur, newCur);
+      }
+    }
+
+    function recordLastCharacterSearch(increment, args) {
+        vimGlobalState.lastCharacterSearch.increment = increment;
+        vimGlobalState.lastCharacterSearch.forward = args.forward;
+        vimGlobalState.lastCharacterSearch.selectedCharacter = args.selectedCharacter;
+    }
+
+    var symbolToMode = {
+        '(': 'bracket', ')': 'bracket', '{': 'bracket', '}': 'bracket',
+        '[': 'section', ']': 'section',
+        '*': 'comment', '/': 'comment',
+        'm': 'method', 'M': 'method',
+        '#': 'preprocess'
+    };
+    var findSymbolModes = {
+      bracket: {
+        isComplete: function(state) {
+          if (state.nextCh === state.symb) {
+            state.depth++;
+            if (state.depth >= 1)return true;
+          } else if (state.nextCh === state.reverseSymb) {
+            state.depth--;
+          }
+          return false;
+        }
+      },
+      section: {
+        init: function(state) {
+          state.curMoveThrough = true;
+          state.symb = (state.forward ? ']' : '[') === state.symb ? '{' : '}';
+        },
+        isComplete: function(state) {
+          return state.index === 0 && state.nextCh === state.symb;
+        }
+      },
+      comment: {
+        isComplete: function(state) {
+          var found = state.lastCh === '*' && state.nextCh === '/';
+          state.lastCh = state.nextCh;
+          return found;
+        }
+      },
+      method: {
+        init: function(state) {
+          state.symb = (state.symb === 'm' ? '{' : '}');
+          state.reverseSymb = state.symb === '{' ? '}' : '{';
+        },
+        isComplete: function(state) {
+          if (state.nextCh === state.symb)return true;
+          return false;
+        }
+      },
+      preprocess: {
+        init: function(state) {
+          state.index = 0;
+        },
+        isComplete: function(state) {
+          if (state.nextCh === '#') {
+            var token = state.lineText.match(/#(\w+)/)[1];
+            if (token === 'endif') {
+              if (state.forward && state.depth === 0) {
+                return true;
+              }
+              state.depth++;
+            } else if (token === 'if') {
+              if (!state.forward && state.depth === 0) {
+                return true;
+              }
+              state.depth--;
+            }
+            if (token === 'else' && state.depth === 0)return true;
+          }
+          return false;
+        }
+      }
+    };
+    function findSymbol(cm, repeat, forward, symb) {
+      var cur = copyCursor(cm.getCursor());
+      var increment = forward ? 1 : -1;
+      var endLine = forward ? cm.lineCount() : -1;
+      var curCh = cur.ch;
+      var line = cur.line;
+      var lineText = cm.getLine(line);
+      var state = {
+        lineText: lineText,
+        nextCh: lineText.charAt(curCh),
+        lastCh: null,
+        index: curCh,
+        symb: symb,
+        reverseSymb: (forward ?  { ')': '(', '}': '{' } : { '(': ')', '{': '}' })[symb],
+        forward: forward,
+        depth: 0,
+        curMoveThrough: false
+      };
+      var mode = symbolToMode[symb];
+      if (!mode)return cur;
+      var init = findSymbolModes[mode].init;
+      var isComplete = findSymbolModes[mode].isComplete;
+      if (init) { init(state); }
+      while (line !== endLine && repeat) {
+        state.index += increment;
+        state.nextCh = state.lineText.charAt(state.index);
+        if (!state.nextCh) {
+          line += increment;
+          state.lineText = cm.getLine(line) || '';
+          if (increment > 0) {
+            state.index = 0;
+          } else {
+            var lineLen = state.lineText.length;
+            state.index = (lineLen > 0) ? (lineLen-1) : 0;
+          }
+          state.nextCh = state.lineText.charAt(state.index);
+        }
+        if (isComplete(state)) {
+          cur.line = line;
+          cur.ch = state.index;
+          repeat--;
+        }
+      }
+      if (state.nextCh || state.curMoveThrough) {
+        return Pos(line, state.index);
+      }
+      return cur;
+    }
+    function findWord(cm, cur, forward, bigWord, emptyLineIsWord) {
+      var lineNum = cur.line;
+      var pos = cur.ch;
+      var line = cm.getLine(lineNum);
+      var dir = forward ? 1 : -1;
+      var charTests = bigWord ? bigWordCharTest: wordCharTest;
+
+      if (emptyLineIsWord && line == '') {
+        lineNum += dir;
+        line = cm.getLine(lineNum);
+        if (!isLine(cm, lineNum)) {
+          return null;
+        }
+        pos = (forward) ? 0 : line.length;
+      }
+
+      while (true) {
+        if (emptyLineIsWord && line == '') {
+          return { from: 0, to: 0, line: lineNum };
+        }
+        var stop = (dir > 0) ? line.length : -1;
+        var wordStart = stop, wordEnd = stop;
+        while (pos != stop) {
+          var foundWord = false;
+          for (var i = 0; i < charTests.length && !foundWord; ++i) {
+            if (charTests[i](line.charAt(pos))) {
+              wordStart = pos;
+              while (pos != stop && charTests[i](line.charAt(pos))) {
+                pos += dir;
+              }
+              wordEnd = pos;
+              foundWord = wordStart != wordEnd;
+              if (wordStart == cur.ch && lineNum == cur.line &&
+                  wordEnd == wordStart + dir) {
+                continue;
+              } else {
+                return {
+                  from: Math.min(wordStart, wordEnd + 1),
+                  to: Math.max(wordStart, wordEnd),
+                  line: lineNum };
+              }
+            }
+          }
+          if (!foundWord) {
+            pos += dir;
+          }
+        }
+        lineNum += dir;
+        if (!isLine(cm, lineNum)) {
+          return null;
+        }
+        line = cm.getLine(lineNum);
+        pos = (dir > 0) ? 0 : line.length;
+      }
+    }
+    function moveToWord(cm, cur, repeat, forward, wordEnd, bigWord) {
+      var curStart = copyCursor(cur);
+      var words = [];
+      if (forward && !wordEnd || !forward && wordEnd) {
+        repeat++;
+      }
+      var emptyLineIsWord = !(forward && wordEnd);
+      for (var i = 0; i < repeat; i++) {
+        var word = findWord(cm, cur, forward, bigWord, emptyLineIsWord);
+        if (!word) {
+          var eodCh = lineLength(cm, cm.lastLine());
+          words.push(forward
+              ? {line: cm.lastLine(), from: eodCh, to: eodCh}
+              : {line: 0, from: 0, to: 0});
+          break;
+        }
+        words.push(word);
+        cur = Pos(word.line, forward ? (word.to - 1) : word.from);
+      }
+      var shortCircuit = words.length != repeat;
+      var firstWord = words[0];
+      var lastWord = words.pop();
+      if (forward && !wordEnd) {
+        if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) {
+          lastWord = words.pop();
+        }
+        return Pos(lastWord.line, lastWord.from);
+      } else if (forward && wordEnd) {
+        return Pos(lastWord.line, lastWord.to - 1);
+      } else if (!forward && wordEnd) {
+        if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) {
+          lastWord = words.pop();
+        }
+        return Pos(lastWord.line, lastWord.to);
+      } else {
+        return Pos(lastWord.line, lastWord.from);
+      }
+    }
+
+    function moveToCharacter(cm, repeat, forward, character) {
+      var cur = cm.getCursor();
+      var start = cur.ch;
+      var idx;
+      for (var i = 0; i < repeat; i ++) {
+        var line = cm.getLine(cur.line);
+        idx = charIdxInLine(start, line, character, forward, true);
+        if (idx == -1) {
+          return null;
+        }
+        start = idx;
+      }
+      return Pos(cm.getCursor().line, idx);
+    }
+
+    function moveToColumn(cm, repeat) {
+      var line = cm.getCursor().line;
+      return clipCursorToContent(cm, Pos(line, repeat - 1));
+    }
+
+    function updateMark(cm, vim, markName, pos) {
+      if (!inArray(markName, validMarks)) {
+        return;
+      }
+      if (vim.marks[markName]) {
+        vim.marks[markName].clear();
+      }
+      vim.marks[markName] = cm.setBookmark(pos);
+    }
+
+    function charIdxInLine(start, line, character, forward, includeChar) {
+      var idx;
+      if (forward) {
+        idx = line.indexOf(character, start + 1);
+        if (idx != -1 && !includeChar) {
+          idx -= 1;
+        }
+      } else {
+        idx = line.lastIndexOf(character, start - 1);
+        if (idx != -1 && !includeChar) {
+          idx += 1;
+        }
+      }
+      return idx;
+    }
+
+    function findParagraph(cm, head, repeat, dir, inclusive) {
+      var line = head.line;
+      var min = cm.firstLine();
+      var max = cm.lastLine();
+      var start, end, i = line;
+      function isEmpty(i) { return !/\S/.test(cm.getLine(i)); } // ace_patch
+      function isBoundary(i, dir, any) {
+        if (any) { return isEmpty(i) != isEmpty(i + dir); }
+        return !isEmpty(i) && isEmpty(i + dir);
+      }
+      function skipFold(i) {
+          dir = dir > 0 ? 1 : -1;
+          var foldLine = cm.ace.session.getFoldLine(i);
+          if (foldLine) {
+              if (i + dir > foldLine.start.row && i + dir < foldLine.end.row)
+                  dir = (dir > 0 ? foldLine.end.row : foldLine.start.row) - i;
+          }
+      }
+      if (dir) {
+        while (min <= i && i <= max && repeat > 0) {
+          skipFold(i);
+          if (isBoundary(i, dir)) { repeat--; }
+          i += dir;
+        }
+        return new Pos(i, 0);
+      }
+
+      var vim = cm.state.vim;
+      if (vim.visualLine && isBoundary(line, 1, true)) {
+        var anchor = vim.sel.anchor;
+        if (isBoundary(anchor.line, -1, true)) {
+          if (!inclusive || anchor.line != line) {
+            line += 1;
+          }
+        }
+      }
+      var startState = isEmpty(line);
+      for (i = line; i <= max && repeat; i++) {
+        if (isBoundary(i, 1, true)) {
+          if (!inclusive || isEmpty(i) != startState) {
+            repeat--;
+          }
+        }
+      }
+      end = new Pos(i, 0);
+      if (i > max && !startState) { startState = true; }
+      else { inclusive = false; }
+      for (i = line; i > min; i--) {
+        if (!inclusive || isEmpty(i) == startState || i == line) {
+          if (isBoundary(i, -1, true)) { break; }
+        }
+      }
+      start = new Pos(i, 0);
+      return { start: start, end: end };
+    }
+
+    function findSentence(cm, cur, repeat, dir) {
+      function nextChar(cm, idx) {
+        if (idx.pos + idx.dir < 0 || idx.pos + idx.dir >= idx.line.length) {
+          idx.ln += idx.dir;
+          if (!isLine(cm, idx.ln)) {
+            idx.line = null;
+            idx.ln = null;
+            idx.pos = null;
+            return;
+          }
+          idx.line = cm.getLine(idx.ln);
+          idx.pos = (idx.dir > 0) ? 0 : idx.line.length - 1;
+        }
+        else {
+          idx.pos += idx.dir;
+        }
+      }
+      function forward(cm, ln, pos, dir) {
+        var line = cm.getLine(ln);
+        var stop = (line === "");
+
+        var curr = {
+          line: line,
+          ln: ln,
+          pos: pos,
+          dir: dir,
+        }
+
+        var last_valid = {
+          ln: curr.ln,
+          pos: curr.pos,
+        }
+
+        var skip_empty_lines = (curr.line === "");
+        nextChar(cm, curr);
+
+        while (curr.line !== null) {
+          last_valid.ln = curr.ln;
+          last_valid.pos = curr.pos;
+
+          if (curr.line === "" && !skip_empty_lines) {
+            return { ln: curr.ln, pos: curr.pos, };
+          }
+          else if (stop && curr.line !== "" && !isWhiteSpaceString(curr.line[curr.pos])) {
+            return { ln: curr.ln, pos: curr.pos, };
+          }
+          else if (isEndOfSentenceSymbol(curr.line[curr.pos])
+            && !stop
+            && (curr.pos === curr.line.length - 1
+              || isWhiteSpaceString(curr.line[curr.pos + 1]))) {
+            stop = true;
+          }
+
+          nextChar(cm, curr);
+        }
+        var line = cm.getLine(last_valid.ln);
+        last_valid.pos = 0;
+        for(var i = line.length - 1; i >= 0; --i) {
+          if (!isWhiteSpaceString(line[i])) {
+            last_valid.pos = i;
+            break;
+          }
+        }
+
+        return last_valid;
+
+      }
+      function reverse(cm, ln, pos, dir) {
+        var line = cm.getLine(ln);
+
+        var curr = {
+          line: line,
+          ln: ln,
+          pos: pos,
+          dir: dir,
+        }
+
+        var last_valid = {
+          ln: curr.ln,
+          pos: null,
+        };
+
+        var skip_empty_lines = (curr.line === "");
+        nextChar(cm, curr);
+
+        while (curr.line !== null) {
+
+          if (curr.line === "" && !skip_empty_lines) {
+            if (last_valid.pos !== null) {
+              return last_valid;
+            }
+            else {
+              return { ln: curr.ln, pos: curr.pos };
+            }
+          }
+          else if (isEndOfSentenceSymbol(curr.line[curr.pos])
+              && last_valid.pos !== null
+              && !(curr.ln === last_valid.ln && curr.pos + 1 === last_valid.pos)) {
+            return last_valid;
+          }
+          else if (curr.line !== "" && !isWhiteSpaceString(curr.line[curr.pos])) {
+            skip_empty_lines = false;
+            last_valid = { ln: curr.ln, pos: curr.pos }
+          }
+
+          nextChar(cm, curr);
+        }
+        var line = cm.getLine(last_valid.ln);
+        last_valid.pos = 0;
+        for(var i = 0; i < line.length; ++i) {
+          if (!isWhiteSpaceString(line[i])) {
+            last_valid.pos = i;
+            break;
+          }
+        }
+        return last_valid;
+      }
+
+      var curr_index = {
+        ln: cur.line,
+        pos: cur.ch,
+      };
+
+      while (repeat > 0) {
+        if (dir < 0) {
+          curr_index = reverse(cm, curr_index.ln, curr_index.pos, dir);
+        }
+        else {
+          curr_index = forward(cm, curr_index.ln, curr_index.pos, dir);
+        }
+        repeat--;
+      }
+
+      return Pos(curr_index.ln, curr_index.pos);
+    }
+    function selectCompanionObject(cm, head, symb, inclusive) {
+      var cur = head, start, end;
+
+      var bracketRegexp = ({
+        '(': /[()]/, ')': /[()]/,
+        '[': /[[\]]/, ']': /[[\]]/,
+        '{': /[{}]/, '}': /[{}]/,
+        '<': /[<>]/, '>': /[<>]/})[symb];
+      var openSym = ({
+        '(': '(', ')': '(',
+        '[': '[', ']': '[',
+        '{': '{', '}': '{',
+        '<': '<', '>': '<'})[symb];
+      var curChar = cm.getLine(cur.line).charAt(cur.ch);
+      var offset = curChar === openSym ? 1 : 0;
+
+      start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1, undefined, {'bracketRegex': bracketRegexp});
+      end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1, undefined, {'bracketRegex': bracketRegexp});
+
+      if (!start || !end) {
+        return { start: cur, end: cur };
+      }
+
+      start = start.pos;
+      end = end.pos;
+
+      if ((start.line == end.line && start.ch > end.ch)
+          || (start.line > end.line)) {
+        var tmp = start;
+        start = end;
+        end = tmp;
+      }
+
+      if (inclusive) {
+        end.ch += 1;
+      } else {
+        start.ch += 1;
+      }
+
+      return { start: start, end: end };
+    }
+    function findBeginningAndEnd(cm, head, symb, inclusive) {
+      var cur = copyCursor(head);
+      var line = cm.getLine(cur.line);
+      var chars = line.split('');
+      var start, end, i, len;
+      var firstIndex = chars.indexOf(symb);
+      if (cur.ch < firstIndex) {
+        cur.ch = firstIndex;
+      }
+      else if (firstIndex < cur.ch && chars[cur.ch] == symb) {
+        end = cur.ch; // assign end to the current cursor
+        --cur.ch; // make sure to look backwards
+      }
+      if (chars[cur.ch] == symb && !end) {
+        start = cur.ch + 1; // assign start to ahead of the cursor
+      } else {
+        for (i = cur.ch; i > -1 && !start; i--) {
+          if (chars[i] == symb) {
+            start = i + 1;
+          }
+        }
+      }
+      if (start && !end) {
+        for (i = start, len = chars.length; i < len && !end; i++) {
+          if (chars[i] == symb) {
+            end = i;
+          }
+        }
+      }
+      if (!start || !end) {
+        return { start: cur, end: cur };
+      }
+      if (inclusive) {
+        --start; ++end;
+      }
+
+      return {
+        start: Pos(cur.line, start),
+        end: Pos(cur.line, end)
+      };
+    }
+    defineOption('pcre', true, 'boolean');
+    function SearchState() {}
+    SearchState.prototype = {
+      getQuery: function() {
+        return vimGlobalState.query;
+      },
+      setQuery: function(query) {
+        vimGlobalState.query = query;
+      },
+      getOverlay: function() {
+        return this.searchOverlay;
+      },
+      setOverlay: function(overlay) {
+        this.searchOverlay = overlay;
+      },
+      isReversed: function() {
+        return vimGlobalState.isReversed;
+      },
+      setReversed: function(reversed) {
+        vimGlobalState.isReversed = reversed;
+      },
+      getScrollbarAnnotate: function() {
+        return this.annotate;
+      },
+      setScrollbarAnnotate: function(annotate) {
+        this.annotate = annotate;
+      }
+    };
+    function getSearchState(cm) {
+      var vim = cm.state.vim;
+      return vim.searchState_ || (vim.searchState_ = new SearchState());
+    }
+    function dialog(cm, template, shortText, onClose, options) {
+      if (cm.openDialog) {
+        cm.openDialog(template, onClose, { bottom: true, value: options.value,
+            onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp,
+            selectValueOnOpen: false, onClose: function() {
+              if (cm.state.vim) {
+                cm.state.vim.status = "";
+                cm.ace.renderer.$loop.schedule(cm.ace.renderer.CHANGE_CURSOR);
+              }
+            }});
+      }
+      else {
+        onClose(prompt(shortText, ''));
+      }
+    }
+    function splitBySlash(argString) {
+      return splitBySeparator(argString, '/');
+    }
+
+    function findUnescapedSlashes(argString) {
+      return findUnescapedSeparators(argString, '/');
+    }
+
+    function splitBySeparator(argString, separator) {
+      var slashes = findUnescapedSeparators(argString, separator) || [];
+      if (!slashes.length) return [];
+      var tokens = [];
+      if (slashes[0] !== 0) return;
+      for (var i = 0; i < slashes.length; i++) {
+        if (typeof slashes[i] == 'number')
+          tokens.push(argString.substring(slashes[i] + 1, slashes[i+1]));
+      }
+      return tokens;
+    }
+
+    function findUnescapedSeparators(str, separator) {
+      if (!separator)
+        separator = '/';
+
+      var escapeNextChar = false;
+      var slashes = [];
+      for (var i = 0; i < str.length; i++) {
+        var c = str.charAt(i);
+        if (!escapeNextChar && c == separator) {
+          slashes.push(i);
+        }
+        escapeNextChar = !escapeNextChar && (c == '\\');
+      }
+      return slashes;
+    }
+    function translateRegex(str) {
+      var specials = '|(){';
+      var unescape = '}';
+      var escapeNextChar = false;
+      var out = [];
+      for (var i = -1; i < str.length; i++) {
+        var c = str.charAt(i) || '';
+        var n = str.charAt(i+1) || '';
+        var specialComesNext = (n && specials.indexOf(n) != -1);
+        if (escapeNextChar) {
+          if (c !== '\\' || !specialComesNext) {
+            out.push(c);
+          }
+          escapeNextChar = false;
+        } else {
+          if (c === '\\') {
+            escapeNextChar = true;
+            if (n && unescape.indexOf(n) != -1) {
+              specialComesNext = true;
+            }
+            if (!specialComesNext || n === '\\') {
+              out.push(c);
+            }
+          } else {
+            out.push(c);
+            if (specialComesNext && n !== '\\') {
+              out.push('\\');
+            }
+          }
+        }
+      }
+      return out.join('');
+    }
+    var charUnescapes = {'\\n': '\n', '\\r': '\r', '\\t': '\t'};
+    function translateRegexReplace(str) {
+      var escapeNextChar = false;
+      var out = [];
+      for (var i = -1; i < str.length; i++) {
+        var c = str.charAt(i) || '';
+        var n = str.charAt(i+1) || '';
+        if (charUnescapes[c + n]) {
+          out.push(charUnescapes[c+n]);
+          i++;
+        } else if (escapeNextChar) {
+          out.push(c);
+          escapeNextChar = false;
+        } else {
+          if (c === '\\') {
+            escapeNextChar = true;
+            if ((isNumber(n) || n === '$')) {
+              out.push('$');
+            } else if (n !== '/' && n !== '\\') {
+              out.push('\\');
+            }
+          } else {
+            if (c === '$') {
+              out.push('$');
+            }
+            out.push(c);
+            if (n === '/') {
+              out.push('\\');
+            }
+          }
+        }
+      }
+      return out.join('');
+    }
+    var unescapes = {'\\/': '/', '\\\\': '\\', '\\n': '\n', '\\r': '\r', '\\t': '\t'};
+    function unescapeRegexReplace(str) {
+      var stream = new CodeMirror.StringStream(str);
+      var output = [];
+      while (!stream.eol()) {
+        while (stream.peek() && stream.peek() != '\\') {
+          output.push(stream.next());
+        }
+        var matched = false;
+        for (var matcher in unescapes) {
+          if (stream.match(matcher, true)) {
+            matched = true;
+            output.push(unescapes[matcher]);
+            break;
+          }
+        }
+        if (!matched) {
+          output.push(stream.next());
+        }
+      }
+      return output.join('');
+    }
+    function parseQuery(query, ignoreCase, smartCase) {
+      var lastSearchRegister = vimGlobalState.registerController.getRegister('/');
+      lastSearchRegister.setText(query);
+      if (query instanceof RegExp) { return query; }
+      var slashes = findUnescapedSlashes(query);
+      var regexPart;
+      var forceIgnoreCase;
+      if (!slashes.length) {
+        regexPart = query;
+      } else {
+        regexPart = query.substring(0, slashes[0]);
+        var flagsPart = query.substring(slashes[0]);
+        forceIgnoreCase = (flagsPart.indexOf('i') != -1);
+      }
+      if (!regexPart) {
+        return null;
+      }
+      if (!getOption('pcre')) {
+        regexPart = translateRegex(regexPart);
+      }
+      if (smartCase) {
+        ignoreCase = (/^[^A-Z]*$/).test(regexPart);
+      }
+      var regexp = new RegExp(regexPart,
+          (ignoreCase || forceIgnoreCase) ? 'i' : undefined);
+      return regexp;
+    }
+    function showConfirm(cm, text) {
+      if (cm.openNotification) {
+        cm.openNotification('<span style="color: red">' + text + '</span>',
+                            {bottom: true, duration: 5000});
+      } else {
+        alert(text);
+      }
+    }
+    function makePrompt(prefix, desc) {
+      var raw = '<span style="font-family: monospace; white-space: pre">' +
+          (prefix || "") + '<input type="text" autocorrect="off" autocapitalize="none" autocomplete="off"></span>';
+      if (desc)
+        raw += ' <span style="color: #888">' + desc + '</span>';
+      return raw;
+    }
+    var searchPromptDesc = '(Javascript regexp)';
+    function showPrompt(cm, options) {
+      var shortText = (options.prefix || '') + ' ' + (options.desc || '');
+      var prompt = makePrompt(options.prefix, options.desc);
+      dialog(cm, prompt, shortText, options.onClose, options);
+    }
+    function regexEqual(r1, r2) {
+      if (r1 instanceof RegExp && r2 instanceof RegExp) {
+          var props = ['global', 'multiline', 'ignoreCase', 'source'];
+          for (var i = 0; i < props.length; i++) {
+              var prop = props[i];
+              if (r1[prop] !== r2[prop]) {
+                  return false;
+              }
+          }
+          return true;
+      }
+      return false;
+    }
+    function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) {
+      if (!rawQuery) {
+        return;
+      }
+      var state = getSearchState(cm);
+      var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase);
+      if (!query) {
+        return;
+      }
+      highlightSearchMatches(cm, query);
+      if (regexEqual(query, state.getQuery())) {
+        return query;
+      }
+      state.setQuery(query);
+      return query;
+    }
+    function searchOverlay(query) {
+      if (query.source.charAt(0) == '^') {
+        var matchSol = true;
+      }
+      return {
+        token: function(stream) {
+          if (matchSol && !stream.sol()) {
+            stream.skipToEnd();
+            return;
+          }
+          var match = stream.match(query, false);
+          if (match) {
+            if (match[0].length == 0) {
+              stream.next();
+              return 'searching';
+            }
+            if (!stream.sol()) {
+              stream.backUp(1);
+              if (!query.exec(stream.next() + match[0])) {
+                stream.next();
+                return null;
+              }
+            }
+            stream.match(query);
+            return 'searching';
+          }
+          while (!stream.eol()) {
+            stream.next();
+            if (stream.match(query, false)) break;
+          }
+        },
+        query: query
+      };
+    }
+    function highlightSearchMatches(cm, query) {
+      var searchState = getSearchState(cm);
+      var overlay = searchState.getOverlay();
+      if (!overlay || query != overlay.query) {
+        if (overlay) {
+          cm.removeOverlay(overlay);
+        }
+        overlay = searchOverlay(query);
+        cm.addOverlay(overlay);
+        if (cm.showMatchesOnScrollbar) {
+          if (searchState.getScrollbarAnnotate()) {
+            searchState.getScrollbarAnnotate().clear();
+          }
+          searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query));
+        }
+        searchState.setOverlay(overlay);
+      }
+    }
+    function findNext(cm, prev, query, repeat) {
+      if (repeat === undefined) { repeat = 1; }
+      return cm.operation(function() {
+        var pos = cm.getCursor();
+        var cursor = cm.getSearchCursor(query, pos);
+        for (var i = 0; i < repeat; i++) {
+          var found = cursor.find(prev);
+          if (i == 0 && found && cursorEqual(cursor.from(), pos)) { found = cursor.find(prev); }
+          if (!found) {
+            cursor = cm.getSearchCursor(query,
+                (prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) );
+            if (!cursor.find(prev)) {
+              return;
+            }
+          }
+        }
+        return cursor.from();
+      });
+    }
+    function clearSearchHighlight(cm) {
+      var state = getSearchState(cm);
+      cm.removeOverlay(getSearchState(cm).getOverlay());
+      state.setOverlay(null);
+      if (state.getScrollbarAnnotate()) {
+        state.getScrollbarAnnotate().clear();
+        state.setScrollbarAnnotate(null);
+      }
+    }
+    function isInRange(pos, start, end) {
+      if (typeof pos != 'number') {
+        pos = pos.line;
+      }
+      if (start instanceof Array) {
+        return inArray(pos, start);
+      } else {
+        if (end) {
+          return (pos >= start && pos <= end);
+        } else {
+          return pos == start;
+        }
+      }
+    }
+    function getUserVisibleLines(cm) {
+      var renderer = cm.ace.renderer;
+      return {
+        top: renderer.getFirstFullyVisibleRow(),
+        bottom: renderer.getLastFullyVisibleRow()
+      }
+    }
+
+    function getMarkPos(cm, vim, markName) {
+      if (markName == '\'' || markName == '`') {
+        return vimGlobalState.jumpList.find(cm, -1) || Pos(0, 0);
+      } else if (markName == '.') {
+        return getLastEditPos(cm);
+      }
+
+      var mark = vim.marks[markName];
+      return mark && mark.find();
+    }
+
+    function getLastEditPos(cm) {
+      var undoManager = cm.ace.session.$undoManager;
+      if (undoManager && undoManager.$lastDelta)
+        return toCmPos(undoManager.$lastDelta.end);
+    }
+
+    var ExCommandDispatcher = function() {
+      this.buildCommandMap_();
+    };
+    ExCommandDispatcher.prototype = {
+      processCommand: function(cm, input, opt_params) {
+        var that = this;
+        cm.operation(function () {
+          cm.curOp.isVimOp = true;
+          that._processCommand(cm, input, opt_params);
+        });
+      },
+      _processCommand: function(cm, input, opt_params) {
+        var vim = cm.state.vim;
+        var commandHistoryRegister = vimGlobalState.registerController.getRegister(':');
+        var previousCommand = commandHistoryRegister.toString();
+        if (vim.visualMode) {
+          exitVisualMode(cm);
+        }
+        var inputStream = new CodeMirror.StringStream(input);
+        commandHistoryRegister.setText(input);
+        var params = opt_params || {};
+        params.input = input;
+        try {
+          this.parseInput_(cm, inputStream, params);
+        } catch(e) {
+          showConfirm(cm, e);
+          throw e;
+        }
+        var command;
+        var commandName;
+        if (!params.commandName) {
+          if (params.line !== undefined) {
+            commandName = 'move';
+          }
+        } else {
+          command = this.matchCommand_(params.commandName);
+          if (command) {
+            commandName = command.name;
+            if (command.excludeFromCommandHistory) {
+              commandHistoryRegister.setText(previousCommand);
+            }
+            this.parseCommandArgs_(inputStream, params, command);
+            if (command.type == 'exToKey') {
+              for (var i = 0; i < command.toKeys.length; i++) {
+                CodeMirror.Vim.handleKey(cm, command.toKeys[i], 'mapping');
+              }
+              return;
+            } else if (command.type == 'exToEx') {
+              this.processCommand(cm, command.toInput);
+              return;
+            }
+          }
+        }
+        if (!commandName) {
+          showConfirm(cm, 'Not an editor command ":' + input + '"');
+          return;
+        }
+        try {
+          exCommands[commandName](cm, params);
+          if ((!command || !command.possiblyAsync) && params.callback) {
+            params.callback();
+          }
+        } catch(e) {
+          showConfirm(cm, e);
+          throw e;
+        }
+      },
+      parseInput_: function(cm, inputStream, result) {
+        inputStream.eatWhile(':');
+        if (inputStream.eat('%')) {
+          result.line = cm.firstLine();
+          result.lineEnd = cm.lastLine();
+        } else {
+          result.line = this.parseLineSpec_(cm, inputStream);
+          if (result.line !== undefined && inputStream.eat(',')) {
+            result.lineEnd = this.parseLineSpec_(cm, inputStream);
+          }
+        }
+        var commandMatch = inputStream.match(/^(\w+)/);
+        if (commandMatch) {
+          result.commandName = commandMatch[1];
+        } else {
+          result.commandName = inputStream.match(/.*/)[0];
+        }
+
+        return result;
+      },
+      parseLineSpec_: function(cm, inputStream) {
+        var numberMatch = inputStream.match(/^(\d+)/);
+        if (numberMatch) {
+          return parseInt(numberMatch[1], 10) - 1;
+        }
+        switch (inputStream.next()) {
+          case '.':
+            return this.parseLineSpecOffset_(inputStream, cm.getCursor().line);
+          case '$':
+            return this.parseLineSpecOffset_(inputStream, cm.lastLine());
+          case '\'':
+            var markName = inputStream.next();
+            var markPos = getMarkPos(cm, cm.state.vim, markName);
+            if (!markPos) throw new Error('Mark not set');
+            return this.parseLineSpecOffset_(inputStream, markPos.line);
+          case '-':
+          case '+':
+            inputStream.backUp(1);
+            return this.parseLineSpecOffset_(inputStream, cm.getCursor().line);
+          default:
+            inputStream.backUp(1);
+            return undefined;
+        }
+      },
+      parseLineSpecOffset_: function(inputStream, line) {
+        var offsetMatch = inputStream.match(/^([+-])?(\d+)/);
+        if (offsetMatch) {
+          var offset = parseInt(offsetMatch[2], 10);
+          if (offsetMatch[1] == "-") {
+            line -= offset;
+          } else {
+            line += offset;
+          }
+        }
+        return line;
+      },
+      parseCommandArgs_: function(inputStream, params, command) {
+        if (inputStream.eol()) {
+          return;
+        }
+        params.argString = inputStream.match(/.*/)[0];
+        var delim = command.argDelimiter || /\s+/;
+        var args = trim(params.argString).split(delim);
+        if (args.length && args[0]) {
+          params.args = args;
+        }
+      },
+      matchCommand_: function(commandName) {
+        for (var i = commandName.length; i > 0; i--) {
+          var prefix = commandName.substring(0, i);
+          if (this.commandMap_[prefix]) {
+            var command = this.commandMap_[prefix];
+            if (command.name.indexOf(commandName) === 0) {
+              return command;
+            }
+          }
+        }
+        return null;
+      },
+      buildCommandMap_: function() {
+        this.commandMap_ = {};
+        for (var i = 0; i < defaultExCommandMap.length; i++) {
+          var command = defaultExCommandMap[i];
+          var key = command.shortName || command.name;
+          this.commandMap_[key] = command;
+        }
+      },
+      map: function(lhs, rhs, ctx) {
+        if (lhs != ':' && lhs.charAt(0) == ':') {
+          if (ctx) { throw Error('Mode not supported for ex mappings'); }
+          var commandName = lhs.substring(1);
+          if (rhs != ':' && rhs.charAt(0) == ':') {
+            this.commandMap_[commandName] = {
+              name: commandName,
+              type: 'exToEx',
+              toInput: rhs.substring(1),
+              user: true
+            };
+          } else {
+            this.commandMap_[commandName] = {
+              name: commandName,
+              type: 'exToKey',
+              toKeys: rhs,
+              user: true
+            };
+          }
+        } else {
+          if (rhs != ':' && rhs.charAt(0) == ':') {
+            var mapping = {
+              keys: lhs,
+              type: 'keyToEx',
+              exArgs: { input: rhs.substring(1) }
+            };
+            if (ctx) { mapping.context = ctx; }
+            defaultKeymap.unshift(mapping);
+          } else {
+            var mapping = {
+              keys: lhs,
+              type: 'keyToKey',
+              toKeys: rhs
+            };
+            if (ctx) { mapping.context = ctx; }
+            defaultKeymap.unshift(mapping);
+          }
+        }
+      },
+      unmap: function(lhs, ctx) {
+        if (lhs != ':' && lhs.charAt(0) == ':') {
+          if (ctx) { throw Error('Mode not supported for ex mappings'); }
+          var commandName = lhs.substring(1);
+          if (this.commandMap_[commandName] && this.commandMap_[commandName].user) {
+            delete this.commandMap_[commandName];
+            return;
+          }
+        } else {
+          var keys = lhs;
+          for (var i = 0; i < defaultKeymap.length; i++) {
+            if (keys == defaultKeymap[i].keys
+                && defaultKeymap[i].context === ctx) {
+              defaultKeymap.splice(i, 1);
+              return;
+            }
+          }
+        }
+      }
+    };
+
+    var exCommands = {
+      colorscheme: function(cm, params) {
+        if (!params.args || params.args.length < 1) {
+          showConfirm(cm, cm.getOption('theme'));
+          return;
+        }
+        cm.setOption('theme', params.args[0]);
+      },
+      map: function(cm, params, ctx) {
+        var mapArgs = params.args;
+        if (!mapArgs || mapArgs.length < 2) {
+          if (cm) {
+            showConfirm(cm, 'Invalid mapping: ' + params.input);
+          }
+          return;
+        }
+        exCommandDispatcher.map(mapArgs[0], mapArgs[1], ctx);
+      },
+      imap: function(cm, params) { this.map(cm, params, 'insert'); },
+      nmap: function(cm, params) { this.map(cm, params, 'normal'); },
+      vmap: function(cm, params) { this.map(cm, params, 'visual'); },
+      unmap: function(cm, params, ctx) {
+        var mapArgs = params.args;
+        if (!mapArgs || mapArgs.length < 1) {
+          if (cm) {
+            showConfirm(cm, 'No such mapping: ' + params.input);
+          }
+          return;
+        }
+        exCommandDispatcher.unmap(mapArgs[0], ctx);
+      },
+      move: function(cm, params) {
+        commandDispatcher.processCommand(cm, cm.state.vim, {
+            type: 'motion',
+            motion: 'moveToLineOrEdgeOfDocument',
+            motionArgs: { forward: false, explicitRepeat: true,
+              linewise: true },
+            repeatOverride: params.line+1});
+      },
+      set: function(cm, params) {
+        var setArgs = params.args;
+        var setCfg = params.setCfg || {};
+        if (!setArgs || setArgs.length < 1) {
+          if (cm) {
+            showConfirm(cm, 'Invalid mapping: ' + params.input);
+          }
+          return;
+        }
+        var expr = setArgs[0].split('=');
+        var optionName = expr[0];
+        var value = expr[1];
+        var forceGet = false;
+
+        if (optionName.charAt(optionName.length - 1) == '?') {
+          if (value) { throw Error('Trailing characters: ' + params.argString); }
+          optionName = optionName.substring(0, optionName.length - 1);
+          forceGet = true;
+        }
+        if (value === undefined && optionName.substring(0, 2) == 'no') {
+          optionName = optionName.substring(2);
+          value = false;
+        }
+
+        var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean';
+        if (optionIsBoolean && value == undefined) {
+          value = true;
+        }
+        if (!optionIsBoolean && value === undefined || forceGet) {
+          var oldValue = getOption(optionName, cm, setCfg);
+          if (oldValue instanceof Error) {
+            showConfirm(cm, oldValue.message);
+          } else if (oldValue === true || oldValue === false) {
+            showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName);
+          } else {
+            showConfirm(cm, '  ' + optionName + '=' + oldValue);
+          }
+        } else {
+          var setOptionReturn = setOption(optionName, value, cm, setCfg);
+          if (setOptionReturn instanceof Error) {
+            showConfirm(cm, setOptionReturn.message);
+          }
+        }
+      },
+      setlocal: function (cm, params) {
+        params.setCfg = {scope: 'local'};
+        this.set(cm, params);
+      },
+      setglobal: function (cm, params) {
+        params.setCfg = {scope: 'global'};
+        this.set(cm, params);
+      },
+      registers: function(cm, params) {
+        var regArgs = params.args;
+        var registers = vimGlobalState.registerController.registers;
+        var regInfo = '----------Registers----------<br><br>';
+        if (!regArgs) {
+          for (var registerName in registers) {
+            var text = registers[registerName].toString();
+            if (text.length) {
+              regInfo += '"' + registerName + '    ' + text + '<br>';
+            }
+          }
+        } else {
+          var registerName;
+          regArgs = regArgs.join('');
+          for (var i = 0; i < regArgs.length; i++) {
+            registerName = regArgs.charAt(i);
+            if (!vimGlobalState.registerController.isValidRegister(registerName)) {
+              continue;
+            }
+            var register = registers[registerName] || new Register();
+            regInfo += '"' + registerName + '    ' + register.toString() + '<br>';
+          }
+        }
+        showConfirm(cm, regInfo);
+      },
+      sort: function(cm, params) {
+        var reverse, ignoreCase, unique, number, pattern;
+        function parseArgs() {
+          if (params.argString) {
+            var args = new CodeMirror.StringStream(params.argString);
+            if (args.eat('!')) { reverse = true; }
+            if (args.eol()) { return; }
+            if (!args.eatSpace()) { return 'Invalid arguments'; }
+            var opts = args.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);
+            if (!opts && !args.eol()) { return 'Invalid arguments'; }
+            if (opts[1]) {
+              ignoreCase = opts[1].indexOf('i') != -1;
+              unique = opts[1].indexOf('u') != -1;
+              var decimal = opts[1].indexOf('d') != -1 || opts[1].indexOf('n') != -1 && 1;
+              var hex = opts[1].indexOf('x') != -1 && 1;
+              var octal = opts[1].indexOf('o') != -1 && 1;
+              if (decimal + hex + octal > 1) { return 'Invalid arguments'; }
+              number = decimal && 'decimal' || hex && 'hex' || octal && 'octal';
+            }
+            if (opts[2]) {
+              pattern = new RegExp(opts[2].substr(1, opts[2].length - 2), ignoreCase ? 'i' : '');
+            }
+          }
+        }
+        var err = parseArgs();
+        if (err) {
+          showConfirm(cm, err + ': ' + params.argString);
+          return;
+        }
+        var lineStart = params.line || cm.firstLine();
+        var lineEnd = params.lineEnd || params.line || cm.lastLine();
+        if (lineStart == lineEnd) { return; }
+        var curStart = Pos(lineStart, 0);
+        var curEnd = Pos(lineEnd, lineLength(cm, lineEnd));
+        var text = cm.getRange(curStart, curEnd).split('\n');
+        var numberRegex = pattern ? pattern :
+           (number == 'decimal') ? /(-?)([\d]+)/ :
+           (number == 'hex') ? /(-?)(?:0x)?([0-9a-f]+)/i :
+           (number == 'octal') ? /([0-7]+)/ : null;
+        var radix = (number == 'decimal') ? 10 : (number == 'hex') ? 16 : (number == 'octal') ? 8 : null;
+        var numPart = [], textPart = [];
+        if (number || pattern) {
+          for (var i = 0; i < text.length; i++) {
+            var matchPart = pattern ? text[i].match(pattern) : null;
+            if (matchPart && matchPart[0] != '') {
+              numPart.push(matchPart);
+            } else if (!pattern && numberRegex.exec(text[i])) {
+              numPart.push(text[i]);
+            } else {
+              textPart.push(text[i]);
+            }
+          }
+        } else {
+          textPart = text;
+        }
+        function compareFn(a, b) {
+          if (reverse) { var tmp; tmp = a; a = b; b = tmp; }
+          if (ignoreCase) { a = a.toLowerCase(); b = b.toLowerCase(); }
+          var anum = number && numberRegex.exec(a);
+          var bnum = number && numberRegex.exec(b);
+          if (!anum) { return a < b ? -1 : 1; }
+          anum = parseInt((anum[1] + anum[2]).toLowerCase(), radix);
+          bnum = parseInt((bnum[1] + bnum[2]).toLowerCase(), radix);
+          return anum - bnum;
+        }
+        function comparePatternFn(a, b) {
+          if (reverse) { var tmp; tmp = a; a = b; b = tmp; }
+          if (ignoreCase) { a[0] = a[0].toLowerCase(); b[0] = b[0].toLowerCase(); }
+          return (a[0] < b[0]) ? -1 : 1;
+        }
+        numPart.sort(pattern ? comparePatternFn : compareFn);
+        if (pattern) {
+          for (var i = 0; i < numPart.length; i++) {
+            numPart[i] = numPart[i].input;
+          }
+        } else if (!number) { textPart.sort(compareFn); }
+        text = (!reverse) ? textPart.concat(numPart) : numPart.concat(textPart);
+        if (unique) { // Remove duplicate lines
+          var textOld = text;
+          var lastLine;
+          text = [];
+          for (var i = 0; i < textOld.length; i++) {
+            if (textOld[i] != lastLine) {
+              text.push(textOld[i]);
+            }
+            lastLine = textOld[i];
+          }
+        }
+        cm.replaceRange(text.join('\n'), curStart, curEnd);
+      },
+      global: function(cm, params) {
+        var argString = params.argString;
+        if (!argString) {
+          showConfirm(cm, 'Regular Expression missing from global');
+          return;
+        }
+        var lineStart = (params.line !== undefined) ? params.line : cm.firstLine();
+        var lineEnd = params.lineEnd || params.line || cm.lastLine();
+        var tokens = splitBySlash(argString);
+        var regexPart = argString, cmd;
+        if (tokens.length) {
+          regexPart = tokens[0];
+          cmd = tokens.slice(1, tokens.length).join('/');
+        }
+        if (regexPart) {
+          try {
+           updateSearchQuery(cm, regexPart, true /** ignoreCase */,
+             true /** smartCase */);
+          } catch (e) {
+           showConfirm(cm, 'Invalid regex: ' + regexPart);
+           return;
+          }
+        }
+        var query = getSearchState(cm).getQuery();
+        var matchedLines = [], content = '';
+        for (var i = lineStart; i <= lineEnd; i++) {
+          var matched = query.test(cm.getLine(i));
+          if (matched) {
+            matchedLines.push(i+1);
+            content+= cm.getLine(i) + '<br>';
+          }
+        }
+        if (!cmd) {
+          showConfirm(cm, content);
+          return;
+        }
+        var index = 0;
+        var nextCommand = function() {
+          if (index < matchedLines.length) {
+            var command = matchedLines[index] + cmd;
+            exCommandDispatcher.processCommand(cm, command, {
+              callback: nextCommand
+            });
+          }
+          index++;
+        };
+        nextCommand();
+      },
+      substitute: function(cm, params) {
+        if (!cm.getSearchCursor) {
+          throw new Error('Search feature not available. Requires searchcursor.js or ' +
+              'any other getSearchCursor implementation.');
+        }
+        var argString = params.argString;
+        var tokens = argString ? splitBySeparator(argString, argString[0]) : [];
+        var regexPart, replacePart = '', trailing, flagsPart, count;
+        var confirm = false; // Whether to confirm each replace.
+        var global = false; // True to replace all instances on a line, false to replace only 1.
+        if (tokens.length) {
+          regexPart = tokens[0];
+          if (getOption('pcre') && regexPart !== '') {
+              regexPart = new RegExp(regexPart).source; //normalize not escaped characters
+          }
+          replacePart = tokens[1];
+          if (regexPart && regexPart[regexPart.length - 1] === '$') {
+            regexPart = regexPart.slice(0, regexPart.length - 1) + '\\n';
+            replacePart = replacePart ? replacePart + '\n' : '\n';
+          }
+          if (replacePart !== undefined) {
+            if (getOption('pcre')) {
+              replacePart = unescapeRegexReplace(replacePart.replace(/([^\\])&/g,"$1$$&"));
+            } else {
+              replacePart = translateRegexReplace(replacePart);
+            }
+            vimGlobalState.lastSubstituteReplacePart = replacePart;
+          }
+          trailing = tokens[2] ? tokens[2].split(' ') : [];
+        } else {
+          if (argString && argString.length) {
+            showConfirm(cm, 'Substitutions should be of the form ' +
+                ':s/pattern/replace/');
+            return;
+          }
+        }
+        if (trailing) {
+          flagsPart = trailing[0];
+          count = parseInt(trailing[1]);
+          if (flagsPart) {
+            if (flagsPart.indexOf('c') != -1) {
+              confirm = true;
+              flagsPart.replace('c', '');
+            }
+            if (flagsPart.indexOf('g') != -1) {
+              global = true;
+              flagsPart.replace('g', '');
+            }
+            if (getOption('pcre')) {
+               regexPart = regexPart + '/' + flagsPart;
+            } else {
+               regexPart = regexPart.replace(/\//g, "\\/") + '/' + flagsPart;
+            }
+          }
+        }
+        if (regexPart) {
+          try {
+            updateSearchQuery(cm, regexPart, true /** ignoreCase */,
+              true /** smartCase */);
+          } catch (e) {
+            showConfirm(cm, 'Invalid regex: ' + regexPart);
+            return;
+          }
+        }
+        replacePart = replacePart || vimGlobalState.lastSubstituteReplacePart;
+        if (replacePart === undefined) {
+          showConfirm(cm, 'No previous substitute regular expression');
+          return;
+        }
+        var state = getSearchState(cm);
+        var query = state.getQuery();
+        var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line;
+        var lineEnd = params.lineEnd || lineStart;
+        if (lineStart == cm.firstLine() && lineEnd == cm.lastLine()) {
+          lineEnd = Infinity;
+        }
+        if (count) {
+          lineStart = lineEnd;
+          lineEnd = lineStart + count - 1;
+        }
+        var startPos = clipCursorToContent(cm, Pos(lineStart, 0));
+        var cursor = cm.getSearchCursor(query, startPos);
+        doReplace(cm, confirm, global, lineStart, lineEnd, cursor, query, replacePart, params.callback);
+      },
+      redo: CodeMirror.commands.redo,
+      undo: CodeMirror.commands.undo,
+      write: function(cm) {
+        if (CodeMirror.commands.save) {
+          CodeMirror.commands.save(cm);
+        } else if (cm.save) {
+          cm.save();
+        }
+      },
+      nohlsearch: function(cm) {
+        clearSearchHighlight(cm);
+      },
+      yank: function (cm) {
+        var cur = copyCursor(cm.getCursor());
+        var line = cur.line;
+        var lineText = cm.getLine(line);
+        vimGlobalState.registerController.pushText(
+          '0', 'yank', lineText, true, true);
+      },
+      delmarks: function(cm, params) {
+        if (!params.argString || !trim(params.argString)) {
+          showConfirm(cm, 'Argument required');
+          return;
+        }
+
+        var state = cm.state.vim;
+        var stream = new CodeMirror.StringStream(trim(params.argString));
+        while (!stream.eol()) {
+          stream.eatSpace();
+          var count = stream.pos;
+
+          if (!stream.match(/[a-zA-Z]/, false)) {
+            showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
+            return;
+          }
+
+          var sym = stream.next();
+          if (stream.match('-', true)) {
+            if (!stream.match(/[a-zA-Z]/, false)) {
+              showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
+              return;
+            }
+
+            var startMark = sym;
+            var finishMark = stream.next();
+            if (isLowerCase(startMark) && isLowerCase(finishMark) ||
+                isUpperCase(startMark) && isUpperCase(finishMark)) {
+              var start = startMark.charCodeAt(0);
+              var finish = finishMark.charCodeAt(0);
+              if (start >= finish) {
+                showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
+                return;
+              }
+              for (var j = 0; j <= finish - start; j++) {
+                var mark = String.fromCharCode(start + j);
+                delete state.marks[mark];
+              }
+            } else {
+              showConfirm(cm, 'Invalid argument: ' + startMark + '-');
+              return;
+            }
+          } else {
+            delete state.marks[sym];
+          }
+        }
+      }
+    };
+
+    var exCommandDispatcher = new ExCommandDispatcher();
+    function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query,
+        replaceWith, callback) {
+      cm.state.vim.exMode = true;
+      var done = false;
+      var lastPos = searchCursor.from();
+      function replaceAll() {
+        cm.operation(function() {
+          while (!done) {
+            replace();
+            next();
+          }
+          stop();
+        });
+      }
+      function replace() {
+        var text = cm.getRange(searchCursor.from(), searchCursor.to());
+        var newText = text.replace(query, replaceWith);
+        searchCursor.replace(newText);
+      }
+      function next() {
+        while(searchCursor.findNext() &&
+              isInRange(searchCursor.from(), lineStart, lineEnd)) {
+          if (!global && lastPos && searchCursor.from().line == lastPos.line) {
+            continue;
+          }
+          cm.scrollIntoView(searchCursor.from(), 30);
+          cm.setSelection(searchCursor.from(), searchCursor.to());
+          lastPos = searchCursor.from();
+          done = false;
+          return;
+        }
+        done = true;
+      }
+      function stop(close) {
+        if (close) { close(); }
+        cm.focus();
+        if (lastPos) {
+          cm.setCursor(lastPos);
+          var vim = cm.state.vim;
+          vim.exMode = false;
+          vim.lastHPos = vim.lastHSPos = lastPos.ch;
+        }
+        if (callback) { callback(); }
+      }
+      function onPromptKeyDown(e, _value, close) {
+        CodeMirror.e_stop(e);
+        var keyName = CodeMirror.keyName(e);
+        switch (keyName) {
+          case 'Y':
+            replace(); next(); break;
+          case 'N':
+            next(); break;
+          case 'A':
+            var savedCallback = callback;
+            callback = undefined;
+            cm.operation(replaceAll);
+            callback = savedCallback;
+            break;
+          case 'L':
+            replace();
+          case 'Q':
+          case 'Esc':
+          case 'Ctrl-C':
+          case 'Ctrl-[':
+            stop(close);
+            break;
+        }
+        if (done) { stop(close); }
+        return true;
+      }
+      next();
+      if (done) {
+        showConfirm(cm, 'No matches for ' + query.source);
+        return;
+      }
+      if (!confirm) {
+        replaceAll();
+        if (callback) { callback(); }
+        return;
+      }
+      showPrompt(cm, {
+        prefix: 'replace with <strong>' + replaceWith + '</strong> (y/n/a/q/l)',
+        onKeyDown: onPromptKeyDown
+      });
+    }
+
+    CodeMirror.keyMap.vim = {
+      attach: attachVimMap,
+      detach: detachVimMap,
+      call: cmKey
+    };
+
+    function exitInsertMode(cm) {
+      var vim = cm.state.vim;
+      var macroModeState = vimGlobalState.macroModeState;
+      var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.');
+      var isPlaying = macroModeState.isPlaying;
+      var lastChange = macroModeState.lastInsertModeChanges;
+      if (!isPlaying) {
+        cm.off('change', onChange);
+        CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);
+      }
+      if (!isPlaying && vim.insertModeRepeat > 1) {
+        repeatLastEdit(cm, vim, vim.insertModeRepeat - 1,
+            true /** repeatForInsert */);
+        vim.lastEditInputState.repeatOverride = vim.insertModeRepeat;
+      }
+      delete vim.insertModeRepeat;
+      vim.insertMode = false;
+      cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1);
+      cm.setOption('keyMap', 'vim');
+      cm.setOption('disableInput', true);
+      cm.toggleOverwrite(false); // exit replace mode if we were in it.
+      insertModeChangeRegister.setText(lastChange.changes.join(''));
+      CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
+      if (macroModeState.isRecording) {
+        logInsertModeChange(macroModeState);
+      }
+    }
+
+    function _mapCommand(command) {
+      defaultKeymap.unshift(command);
+    }
+
+    function mapCommand(keys, type, name, args, extra) {
+      var command = {keys: keys, type: type};
+      command[type] = name;
+      command[type + "Args"] = args;
+      for (var key in extra)
+        command[key] = extra[key];
+      _mapCommand(command);
+    }
+    defineOption('insertModeEscKeysTimeout', 200, 'number');
+
+    CodeMirror.keyMap['vim-insert'] = {
+      fallthrough: ['default'],
+      attach: attachVimMap,
+      detach: detachVimMap,
+      call: cmKey
+    };
+
+    CodeMirror.keyMap['vim-replace'] = {
+      'Backspace': 'goCharLeft',
+      fallthrough: ['vim-insert'],
+      attach: attachVimMap,
+      detach: detachVimMap,
+      call: cmKey
+    };
+
+    function executeMacroRegister(cm, vim, macroModeState, registerName) {
+      var register = vimGlobalState.registerController.getRegister(registerName);
+      if (registerName == ':') {
+        if (register.keyBuffer[0]) {
+          exCommandDispatcher.processCommand(cm, register.keyBuffer[0]);
+        }
+        macroModeState.isPlaying = false;
+        return;
+      }
+      var keyBuffer = register.keyBuffer;
+      var imc = 0;
+      macroModeState.isPlaying = true;
+      macroModeState.replaySearchQueries = register.searchQueries.slice(0);
+      for (var i = 0; i < keyBuffer.length; i++) {
+        var text = keyBuffer[i];
+        var match, key;
+        while (text) {
+          match = (/<\w+-.+?>|<\w+>|./).exec(text);
+          key = match[0];
+          text = text.substring(match.index + key.length);
+          CodeMirror.Vim.handleKey(cm, key, 'macro');
+          if (vim.insertMode) {
+            var changes = register.insertModeChanges[imc++].changes;
+            vimGlobalState.macroModeState.lastInsertModeChanges.changes =
+                changes;
+            repeatInsertModeChanges(cm, changes, 1);
+            exitInsertMode(cm);
+          }
+        }
+      }
+      macroModeState.isPlaying = false;
+    }
+
+    function logKey(macroModeState, key) {
+      if (macroModeState.isPlaying) { return; }
+      var registerName = macroModeState.latestRegister;
+      var register = vimGlobalState.registerController.getRegister(registerName);
+      if (register) {
+        register.pushText(key);
+      }
+    }
+
+    function logInsertModeChange(macroModeState) {
+      if (macroModeState.isPlaying) { return; }
+      var registerName = macroModeState.latestRegister;
+      var register = vimGlobalState.registerController.getRegister(registerName);
+      if (register && register.pushInsertModeChanges) {
+        register.pushInsertModeChanges(macroModeState.lastInsertModeChanges);
+      }
+    }
+
+    function logSearchQuery(macroModeState, query) {
+      if (macroModeState.isPlaying) { return; }
+      var registerName = macroModeState.latestRegister;
+      var register = vimGlobalState.registerController.getRegister(registerName);
+      if (register && register.pushSearchQuery) {
+        register.pushSearchQuery(query);
+      }
+    }
+    function onChange(cm, changeObj) {
+      var macroModeState = vimGlobalState.macroModeState;
+      var lastChange = macroModeState.lastInsertModeChanges;
+      if (!macroModeState.isPlaying) {
+        while(changeObj) {
+          lastChange.expectCursorActivityForChange = true;
+          if (lastChange.ignoreCount > 1) {
+            lastChange.ignoreCount--;
+          } else if (changeObj.origin == '+input' || changeObj.origin == 'paste'
+              || changeObj.origin === undefined /* only in testing */) {
+            var selectionCount = cm.listSelections().length;
+            if (selectionCount > 1)
+              lastChange.ignoreCount = selectionCount;
+            var text = changeObj.text.join('\n');
+            if (lastChange.maybeReset) {
+              lastChange.changes = [];
+              lastChange.maybeReset = false;
+            }
+            if (text) {
+              if (cm.state.overwrite && !/\n/.test(text)) {
+                lastChange.changes.push([text]);
+              } else {
+                lastChange.changes.push(text);
+              }
+            }
+          }
+          changeObj = changeObj.next;
+        }
+      }
+    }
+    function onCursorActivity(cm) {
+      var vim = cm.state.vim;
+      if (vim.insertMode) {
+        var macroModeState = vimGlobalState.macroModeState;
+        if (macroModeState.isPlaying) { return; }
+        var lastChange = macroModeState.lastInsertModeChanges;
+        if (lastChange.expectCursorActivityForChange) {
+          lastChange.expectCursorActivityForChange = false;
+        } else {
+          lastChange.maybeReset = true;
+        }
+      } else if (!cm.curOp.isVimOp) {
+        handleExternalSelection(cm, vim);
+      }
+      if (vim.visualMode) {
+        updateFakeCursor(cm);
+      }
+    }
+    function updateFakeCursor(cm) {
+      var vim = cm.state.vim;
+      var from = clipCursorToContent(cm, copyCursor(vim.sel.head));
+      var to = offsetCursor(from, 0, 1);
+      if (vim.fakeCursor) {
+        vim.fakeCursor.clear();
+      }
+      vim.fakeCursor = cm.markText(from, to, {className: 'cm-animate-fat-cursor'});
+    }
+    function handleExternalSelection(cm, vim, keepHPos) {
+      var anchor = cm.getCursor('anchor');
+      var head = cm.getCursor('head');
+      if (vim.visualMode && !cm.somethingSelected()) {
+        exitVisualMode(cm, false);
+      } else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) {
+        vim.visualMode = true;
+        vim.visualLine = false;
+        CodeMirror.signal(cm, "vim-mode-change", {mode: "visual"});
+      }
+      if (vim.visualMode) {
+        var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0;
+        var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0;
+        head = offsetCursor(head, 0, headOffset);
+        anchor = offsetCursor(anchor, 0, anchorOffset);
+        vim.sel = {
+          anchor: anchor,
+          head: head
+        };
+        updateMark(cm, vim, '<', cursorMin(head, anchor));
+        updateMark(cm, vim, '>', cursorMax(head, anchor));
+      } else if (!vim.insertMode && !keepHPos) {
+        vim.lastHPos = cm.getCursor().ch;
+      }
+    }
+    function InsertModeKey(keyName) {
+      this.keyName = keyName;
+    }
+    function onKeyEventTargetKeyDown(e) {
+      var macroModeState = vimGlobalState.macroModeState;
+      var lastChange = macroModeState.lastInsertModeChanges;
+      var keyName = CodeMirror.keyName(e);
+      if (!keyName) { return; }
+      function onKeyFound() {
+        if (lastChange.maybeReset) {
+          lastChange.changes = [];
+          lastChange.maybeReset = false;
+        }
+        lastChange.changes.push(new InsertModeKey(keyName));
+        return true;
+      }
+      if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) {
+        CodeMirror.lookupKey(keyName, 'vim-insert', onKeyFound);
+      }
+    }
+    function repeatLastEdit(cm, vim, repeat, repeatForInsert) {
+      var macroModeState = vimGlobalState.macroModeState;
+      macroModeState.isPlaying = true;
+      var isAction = !!vim.lastEditActionCommand;
+      var cachedInputState = vim.inputState;
+      function repeatCommand() {
+        if (isAction) {
+          commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand);
+        } else {
+          commandDispatcher.evalInput(cm, vim);
+        }
+      }
+      function repeatInsert(repeat) {
+        if (macroModeState.lastInsertModeChanges.changes.length > 0) {
+          repeat = !vim.lastEditActionCommand ? 1 : repeat;
+          var changeObject = macroModeState.lastInsertModeChanges;
+          repeatInsertModeChanges(cm, changeObject.changes, repeat);
+        }
+      }
+      vim.inputState = vim.lastEditInputState;
+      if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) {
+        for (var i = 0; i < repeat; i++) {
+          repeatCommand();
+          repeatInsert(1);
+        }
+      } else {
+        if (!repeatForInsert) {
+          repeatCommand();
+        }
+        repeatInsert(repeat);
+      }
+      vim.inputState = cachedInputState;
+      if (vim.insertMode && !repeatForInsert) {
+        exitInsertMode(cm);
+      }
+      macroModeState.isPlaying = false;
+    }
+
+    function repeatInsertModeChanges(cm, changes, repeat) {
+      function keyHandler(binding) {
+        if (typeof binding == 'string') {
+          CodeMirror.commands[binding](cm);
+        } else {
+          binding(cm);
+        }
+        return true;
+      }
+      var head = cm.getCursor('head');
+      var visualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.visualBlock;
+      if (visualBlock) {
+        selectForInsert(cm, head, visualBlock + 1);
+        repeat = cm.listSelections().length;
+        cm.setCursor(head);
+      }
+      for (var i = 0; i < repeat; i++) {
+        if (visualBlock) {
+          cm.setCursor(offsetCursor(head, i, 0));
+        }
+        for (var j = 0; j < changes.length; j++) {
+          var change = changes[j];
+          if (change instanceof InsertModeKey) {
+            CodeMirror.lookupKey(change.keyName, 'vim-insert', keyHandler);
+          } else if (typeof change == "string") {
+            var cur = cm.getCursor();
+            cm.replaceRange(change, cur, cur);
+          } else {
+            var start = cm.getCursor();
+            var end = offsetCursor(start, 0, change[0].length);
+            cm.replaceRange(change[0], start, end);
+          }
+        }
+      }
+      if (visualBlock) {
+        cm.setCursor(offsetCursor(head, 0, 1));
+      }
+    }
+
+    resetVimGlobalState();
+  CodeMirror.Vim = Vim();
+
+  Vim = CodeMirror.Vim;
+
+  var specialKey = {'return':'CR',backspace:'BS','delete':'Del',esc:'Esc',
+    left:'Left',right:'Right',up:'Up',down:'Down',space: 'Space',
+    home:'Home',end:'End',pageup:'PageUp',pagedown:'PageDown', enter: 'CR'
+  };
+  function lookupKey(hashId, key, e) {
+    if (key.length > 1 && key[0] == "n") {
+      key = key.replace("numpad", "");
+    }
+    key = specialKey[key] || key;
+    var name = '';
+    if (e.ctrlKey) { name += 'C-'; }
+    if (e.altKey) { name += 'A-'; }
+    if ((name || key.length > 1) && e.shiftKey) { name += 'S-'; }
+
+    name += key;
+    if (name.length > 1) { name = '<' + name + '>'; }
+    return name;
+  }
+  var handleKey = Vim.handleKey.bind(Vim);
+  Vim.handleKey = function(cm, key, origin) {
+    return cm.operation(function() {
+      return handleKey(cm, key, origin);
+    }, true);
+  }
+  function cloneVimState(state) {
+    var n = new state.constructor();
+    Object.keys(state).forEach(function(key) {
+      var o = state[key];
+      if (Array.isArray(o))
+        o = o.slice();
+      else if (o && typeof o == "object" && o.constructor != Object)
+        o = cloneVimState(o);
+      n[key] = o;
+    });
+    if (state.sel) {
+      n.sel = {
+        head: state.sel.head && copyCursor(state.sel.head),
+        anchor: state.sel.anchor && copyCursor(state.sel.anchor)
+      };
+    }
+    return n;
+  }
+  function multiSelectHandleKey(cm, key, origin) {
+    var isHandled = false;
+    var vim = Vim.maybeInitVimState_(cm);
+    var visualBlock = vim.visualBlock || vim.wasInVisualBlock;
+
+    var wasMultiselect = cm.ace.inMultiSelectMode;
+    if (vim.wasInVisualBlock && !wasMultiselect) {
+      vim.wasInVisualBlock = false;
+    } else if (wasMultiselect && vim.visualBlock) {
+       vim.wasInVisualBlock = true;
+    }
+    
+    if (key == '<Esc>' && !vim.insertMode && !vim.visualMode && wasMultiselect) {
+      cm.ace.exitMultiSelectMode();
+    } else if (visualBlock || !wasMultiselect || cm.ace.inVirtualSelectionMode) {
+      isHandled = Vim.handleKey(cm, key, origin);
+    } else {
+      var old = cloneVimState(vim);
+      cm.operation(function() {
+        cm.ace.forEachSelection(function() {
+          var sel = cm.ace.selection;
+          cm.state.vim.lastHPos = sel.$desiredColumn == null ? sel.lead.column : sel.$desiredColumn;
+          var head = cm.getCursor("head");
+          var anchor = cm.getCursor("anchor");
+          var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0;
+          var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0;
+          head = offsetCursor(head, 0, headOffset);
+          anchor = offsetCursor(anchor, 0, anchorOffset);
+          cm.state.vim.sel.head = head;
+          cm.state.vim.sel.anchor = anchor;
+          
+          isHandled = handleKey(cm, key, origin);
+          sel.$desiredColumn = cm.state.vim.lastHPos == -1 ? null : cm.state.vim.lastHPos;
+          if (cm.virtualSelectionMode()) {
+            cm.state.vim = cloneVimState(old);
+          }
+        });
+        if (cm.curOp.cursorActivity && !isHandled)
+          cm.curOp.cursorActivity = false;
+      }, true);
+    }
+    if (isHandled && !vim.visualMode && !vim.insert && vim.visualMode != cm.somethingSelected()) {
+      handleExternalSelection(cm, vim, true);
+    }
+    return isHandled;
+  }
+  exports.CodeMirror = CodeMirror;
+  var getVim = Vim.maybeInitVimState_;
+  exports.handler = {
+    $id: "ace/keyboard/vim",
+    drawCursor: function(element, pixelPos, config, sel, session) {
+      var vim = this.state.vim || {};
+      var w = config.characterWidth;
+      var h = config.lineHeight;
+      var top = pixelPos.top;
+      var left = pixelPos.left;
+      if (!vim.insertMode) {
+        var isbackwards = !sel.cursor 
+            ? session.selection.isBackwards() || session.selection.isEmpty()
+            : Range.comparePoints(sel.cursor, sel.start) <= 0;
+        if (!isbackwards && left > w)
+          left -= w;
+      }     
+      if (!vim.insertMode && vim.status) {
+        h = h / 2;
+        top += h;
+      }
+      dom.translate(element, left, top);
+      dom.setStyle(element.style, "width", w + "px");
+      dom.setStyle(element.style, "height", h + "px");
+    },
+    handleKeyboard: function(data, hashId, key, keyCode, e) {
+      var editor = data.editor;
+      var cm = editor.state.cm;
+      var vim = getVim(cm);
+      if (keyCode == -1) return;
+      if (!vim.insertMode) {
+        if (hashId == -1) {
+          if (key.charCodeAt(0) > 0xFF) {
+            if (data.inputKey) {
+              key = data.inputKey;
+              if (key && data.inputHash == 4)
+                key = key.toUpperCase();
+            }
+          }
+          data.inputChar = key;
+        }
+        else if (hashId == 4 || hashId == 0) {
+          if (data.inputKey == key && data.inputHash == hashId && data.inputChar) {
+            key = data.inputChar;
+            hashId = -1
+          }
+          else {
+            data.inputChar = null;
+            data.inputKey = key;
+            data.inputHash = hashId;
+          }
+        }
+        else {
+          data.inputChar = data.inputKey = null;
+        }
+      }
+      if (key == "c" && hashId == 1) { // key == "ctrl-c"
+        if (!useragent.isMac && editor.getCopyText()) {
+          editor.once("copy", function() {
+            editor.selection.clearSelection();
+          });
+          return {command: "null", passEvent: true};
+        }
+      }
+      
+      if (key == "esc" && !vim.insertMode && !vim.visualMode && !cm.ace.inMultiSelectMode) {
+        var searchState = getSearchState(cm);
+        var overlay = searchState.getOverlay();
+        if (overlay) cm.removeOverlay(overlay);
+      }
+      
+      if (hashId == -1 || hashId & 1 || hashId === 0 && key.length > 1) {
+        var insertMode = vim.insertMode;
+        var name = lookupKey(hashId, key, e || {});
+        if (vim.status == null)
+          vim.status = "";
+        var isHandled = multiSelectHandleKey(cm, name, 'user');
+        vim = getVim(cm); // may be changed by multiSelectHandleKey
+        if (isHandled && vim.status != null)
+          vim.status += name;
+        else if (vim.status == null)
+          vim.status = "";
+        cm._signal("changeStatus");
+        if (!isHandled && (hashId != -1 || insertMode))
+          return;
+        return {command: "null", passEvent: !isHandled};
+      }
+    },
+    attach: function(editor) {
+      if (!editor.state) editor.state = {};
+      var cm = new CodeMirror(editor);
+      editor.state.cm = cm;
+      editor.$vimModeHandler = this;
+      CodeMirror.keyMap.vim.attach(cm);
+      getVim(cm).status = null;
+      cm.on('vim-command-done', function() {
+        if (cm.virtualSelectionMode()) return;
+        getVim(cm).status = null;
+        cm.ace._signal("changeStatus");
+        cm.ace.session.markUndoGroup();
+      });
+      cm.on("changeStatus", function() {
+        cm.ace.renderer.updateCursor();
+        cm.ace._signal("changeStatus");
+      });
+      cm.on("vim-mode-change", function() {
+        if (cm.virtualSelectionMode()) return;
+        updateInputMode();
+        cm._signal("changeStatus");
+      });
+      function updateInputMode() {
+        var isIntsert = getVim(cm).insertMode;
+        cm.ace.renderer.setStyle("normal-mode", !isIntsert);
+        editor.textInput.setCommandMode(!isIntsert);
+        editor.renderer.$keepTextAreaAtCursor = isIntsert;
+        editor.renderer.$blockCursor = !isIntsert;
+      }
+      updateInputMode();
+      editor.renderer.$cursorLayer.drawCursor = this.drawCursor.bind(cm);
+    },
+    detach: function(editor) {
+      var cm = editor.state.cm;
+      CodeMirror.keyMap.vim.detach(cm);
+      cm.destroy();
+      editor.state.cm = null;
+      editor.$vimModeHandler = null;
+      editor.renderer.$cursorLayer.drawCursor = null;
+      editor.renderer.setStyle("normal-mode", false);
+      editor.textInput.setCommandMode(false);
+      editor.renderer.$keepTextAreaAtCursor = true;
+    },
+    getStatusText: function(editor) {
+      var cm = editor.state.cm;
+      var vim = getVim(cm);
+      if (vim.insertMode)
+        return "INSERT";
+      var status = "";
+      if (vim.visualMode) {
+        status += "VISUAL";
+        if (vim.visualLine)
+          status += " LINE";
+        if (vim.visualBlock)
+          status += " BLOCK";
+      }
+      if (vim.status)
+        status += (status ? " " : "") + vim.status;
+      return status;
+    }
+  };
+  Vim.defineOption({
+    name: "wrap",
+    set: function(value, cm) {
+      if (cm) {cm.ace.setOption("wrap", value)}
+    },
+    type: "boolean"
+  }, false);
+  Vim.defineEx('write', 'w', function() {
+    console.log(':write is not implemented')
+  });
+  defaultKeymap.push(
+    { keys: 'zc', type: 'action', action: 'fold', actionArgs: { open: false } },
+    { keys: 'zC', type: 'action', action: 'fold', actionArgs: { open: false, all: true } },
+    { keys: 'zo', type: 'action', action: 'fold', actionArgs: { open: true } },
+    { keys: 'zO', type: 'action', action: 'fold', actionArgs: { open: true, all: true } },
+    { keys: 'za', type: 'action', action: 'fold', actionArgs: { toggle: true } },
+    { keys: 'zA', type: 'action', action: 'fold', actionArgs: { toggle: true, all: true } },
+    { keys: 'zf', type: 'action', action: 'fold', actionArgs: { open: true, all: true } },
+    { keys: 'zd', type: 'action', action: 'fold', actionArgs: { open: true, all: true } },
+    
+    { keys: '<C-A-k>', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorAbove" } },
+    { keys: '<C-A-j>', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorBelow" } },
+    { keys: '<C-A-S-k>', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorAboveSkipCurrent" } },
+    { keys: '<C-A-S-j>', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorBelowSkipCurrent" } },
+    { keys: '<C-A-h>', type: 'action', action: 'aceCommand', actionArgs: { name: "selectMoreBefore" } },
+    { keys: '<C-A-l>', type: 'action', action: 'aceCommand', actionArgs: { name: "selectMoreAfter" } },
+    { keys: '<C-A-S-h>', type: 'action', action: 'aceCommand', actionArgs: { name: "selectNextBefore" } },
+    { keys: '<C-A-S-l>', type: 'action', action: 'aceCommand', actionArgs: { name: "selectNextAfter" } }
+  );
+  actions.aceCommand = function(cm, actionArgs, vim) {
+    cm.vimCmd = actionArgs;
+    if (cm.ace.inVirtualSelectionMode)
+      cm.ace.on("beforeEndOperation", delayedExecAceCommand);
+    else
+      delayedExecAceCommand(null, cm.ace);
+  };
+  function delayedExecAceCommand(op, ace) {
+    ace.off("beforeEndOperation", delayedExecAceCommand);
+    var cmd = ace.state.cm.vimCmd;
+    if (cmd) {
+      ace.execCommand(cmd.exec ? cmd : cmd.name, cmd.args);
+    }
+    ace.curOp = ace.prevOp;
+  }
+  actions.fold = function(cm, actionArgs, vim) {
+    cm.ace.execCommand(['toggleFoldWidget', 'toggleFoldWidget', 'foldOther', 'unfoldall'
+      ][(actionArgs.all ? 2 : 0) + (actionArgs.open ? 1 : 0)]);
+  };
+
+  exports.handler.defaultKeymap = defaultKeymap;
+  exports.handler.actions = actions;
+  exports.Vim = Vim;
+});                (function() {
+                    ace.require(["ace/keyboard/vim"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 23 - 0
web/1295d4470d348d3ff8ea442b1dcef3d3.js

@@ -0,0 +1,23 @@
+ace.define("ace/snippets/maze",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+exports.snippetText = "snippet >\n\
+description assignment\n\
+scope maze\n\
+	-> ${1}= ${2}\n\
+\n\
+snippet >\n\
+description if\n\
+scope maze\n\
+	-> IF ${2:**} THEN %${3:L} ELSE %${4:R}\n\
+";
+exports.scope = "maze";
+
+});                (function() {
+                    ace.require(["ace/snippets/maze"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 257 - 0
web/1365ff3d277ebdab408e6aeec886cf08.js

@@ -0,0 +1,257 @@
+ace.define("ace/mode/rst_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var lang = require("../lib/lang");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var RSTHighlightRules = function() {
+
+  var tokens = {
+    title: "markup.heading",
+    list: "markup.heading",
+    table: "constant",
+    directive: "keyword.operator",
+    entity: "string",
+    link: "markup.underline.list",
+    bold: "markup.bold",
+    italic: "markup.italic",
+    literal: "support.function",
+    comment: "comment"
+  };
+
+  var startStringPrefix = "(^|\\s|[\"'(<\\[{\\-/:])";
+  var endStringSuffix = "(?:$|(?=\\s|[\\\\.,;!?\\-/:\"')>\\]}]))";
+
+  this.$rules = {
+    "start": [
+      {
+        token : tokens.title,
+        regex : "(^)([\\=\\-`:\\.'\"~\\^_\\*\\+#])(\\2{2,}\\s*$)"
+      },
+      {
+        token : ["text", tokens.directive, tokens.literal],
+        regex : "(^\\s*\\.\\. )([^: ]+::)(.*$)",
+        next  : "codeblock"
+      },
+      {
+        token : tokens.directive,
+        regex : "::$",
+        next  : "codeblock"
+      },
+      {
+        token : [tokens.entity, tokens.link],
+        regex : "(^\\.\\. _[^:]+:)(.*$)"
+      },
+      {
+        token : [tokens.entity, tokens.link],
+        regex : "(^__ )(https?://.*$)"
+      },
+      {
+        token : tokens.entity,
+        regex : "^\\.\\. \\[[^\\]]+\\] "
+      },
+      {
+        token : tokens.comment,
+        regex : "^\\.\\. .*$",
+        next  : "comment"
+      },
+      {
+        token : tokens.list,
+        regex : "^\\s*[\\*\\+-] "
+      },
+      {
+        token : tokens.list,
+        regex : "^\\s*(?:[A-Za-z]|[0-9]+|[ivxlcdmIVXLCDM]+)\\. "
+      },
+      {
+        token : tokens.list,
+        regex : "^\\s*\\(?(?:[A-Za-z]|[0-9]+|[ivxlcdmIVXLCDM]+)\\) "
+      },
+      {
+        token : tokens.table,
+        regex : "^={2,}(?: +={2,})+$"
+      },
+      {
+        token : tokens.table,
+        regex : "^\\+-{2,}(?:\\+-{2,})+\\+$"
+      },
+      {
+        token : tokens.table,
+        regex : "^\\+={2,}(?:\\+={2,})+\\+$"
+      },
+      {
+        token : ["text", tokens.literal],
+        regex : startStringPrefix + "(``)(?=\\S)",
+        next  : "code"
+      },
+      {
+        token : ["text", tokens.bold],
+        regex : startStringPrefix + "(\\*\\*)(?=\\S)",
+        next  : "bold"
+      },
+      {
+        token : ["text", tokens.italic],
+        regex : startStringPrefix + "(\\*)(?=\\S)",
+        next  : "italic"
+      },
+      {
+        token : tokens.entity,
+        regex : "\\|[\\w\\-]+?\\|"
+      },
+      {
+        token : tokens.entity,
+        regex : ":[\\w-:]+:`\\S",
+        next  : "entity"
+      },
+      {
+        token : ["text", tokens.entity],
+        regex : startStringPrefix + "(_`)(?=\\S)",
+        next  : "entity"
+      },
+      {
+        token : tokens.entity,
+        regex : "_[A-Za-z0-9\\-]+?"
+      },
+      {
+        token : ["text", tokens.link],
+        regex : startStringPrefix + "(`)(?=\\S)",
+        next  : "link"
+      },
+      {
+        token : tokens.link,
+        regex : "[A-Za-z0-9\\-]+?__?"
+      },
+      {
+        token : tokens.link,
+        regex : "\\[[^\\]]+?\\]_"
+      },
+      {
+        token : tokens.link,
+        regex : "https?://\\S+"
+      },
+      {
+        token : tokens.table,
+        regex : "\\|"
+      }
+    ],
+    "codeblock": [
+      {
+        token : tokens.literal,
+        regex : "^ +.+$",
+        next : "codeblock"
+      },
+      {
+        token : tokens.literal,
+        regex : '^$',
+        next: "codeblock"
+      },
+      {
+        token : "empty",
+        regex : "",
+        next : "start"
+      }
+    ],
+    "code": [
+      {
+        token : tokens.literal,
+        regex : "\\S``" + endStringSuffix,
+        next  : "start"
+      },
+      {
+        defaultToken: tokens.literal
+      }
+    ],
+    "bold": [
+      {
+        token : tokens.bold,
+        regex : "\\S\\*\\*" + endStringSuffix,
+        next  : "start"
+      },
+      {
+        defaultToken: tokens.bold
+      }
+    ],
+    "italic": [
+      {
+        token : tokens.italic,
+        regex : "\\S\\*" + endStringSuffix,
+        next  : "start"
+      },
+      {
+        defaultToken: tokens.italic
+      }
+    ],
+    "entity": [
+      {
+        token : tokens.entity,
+        regex : "\\S`" + endStringSuffix,
+        next  : "start"
+      },
+      {
+        defaultToken: tokens.entity
+      }
+    ],
+    "link": [
+      {
+        token : tokens.link,
+        regex : "\\S`__?" + endStringSuffix,
+        next  : "start"
+      },
+      {
+        defaultToken: tokens.link
+      }
+    ],
+    "comment": [
+      {
+        token : tokens.comment,
+        regex : "^ +.+$",
+        next : "comment"
+      },
+      {
+        token : tokens.comment,
+        regex : '^$',
+        next: "comment"
+      },
+      {
+        token : "empty",
+        regex : "",
+        next : "start"
+      }
+    ]
+  };
+};
+oop.inherits(RSTHighlightRules, TextHighlightRules);
+
+exports.RSTHighlightRules = RSTHighlightRules;
+});
+
+ace.define("ace/mode/rst",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/rst_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var RSTHighlightRules = require("./rst_highlight_rules").RSTHighlightRules;
+
+var Mode = function() {
+    this.HighlightRules = RSTHighlightRules;
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+    this.type = "text";
+
+    this.$id = "ace/mode/rst";
+    this.snippetFileId = "ace/snippets/rst";
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});                (function() {
+                    ace.require(["ace/mode/rst"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 40 - 0
web/144991c48dbba89bfe10e886aaaed32a.js

@@ -0,0 +1,40 @@
+ace.define("ace/snippets/sql",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+exports.snippetText = "snippet tbl\n\
+	create table ${1:table} (\n\
+		${2:columns}\n\
+	);\n\
+snippet col\n\
+	${1:name}	${2:type}	${3:default ''}	${4:not null}\n\
+snippet ccol\n\
+	${1:name}	varchar2(${2:size})	${3:default ''}	${4:not null}\n\
+snippet ncol\n\
+	${1:name}	number	${3:default 0}	${4:not null}\n\
+snippet dcol\n\
+	${1:name}	date	${3:default sysdate}	${4:not null}\n\
+snippet ind\n\
+	create index ${3:$1_$2} on ${1:table}(${2:column});\n\
+snippet uind\n\
+	create unique index ${1:name} on ${2:table}(${3:column});\n\
+snippet tblcom\n\
+	comment on table ${1:table} is '${2:comment}';\n\
+snippet colcom\n\
+	comment on column ${1:table}.${2:column} is '${3:comment}';\n\
+snippet addcol\n\
+	alter table ${1:table} add (${2:column} ${3:type});\n\
+snippet seq\n\
+	create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${4:1};\n\
+snippet s*\n\
+	select * from ${1:table}\n\
+";
+exports.scope = "sql";
+
+});                (function() {
+                    ace.require(["ace/snippets/sql"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 96 - 0
web/1570e695c448e6a4f3a6bdf0372b58f0.js

@@ -0,0 +1,96 @@
+ace.define("ace/snippets/haskell",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+exports.snippetText = "snippet lang\n\
+	{-# LANGUAGE ${1:OverloadedStrings} #-}\n\
+snippet info\n\
+	-- |\n\
+	-- Module      :  ${1:Module.Namespace}\n\
+	-- Copyright   :  ${2:Author} ${3:2011-2012}\n\
+	-- License     :  ${4:BSD3}\n\
+	--\n\
+	-- Maintainer  :  ${5:email@something.com}\n\
+	-- Stability   :  ${6:experimental}\n\
+	-- Portability :  ${7:unknown}\n\
+	--\n\
+	-- ${8:Description}\n\
+	--\n\
+snippet import\n\
+	import           ${1:Data.Text}\n\
+snippet import2\n\
+	import           ${1:Data.Text} (${2:head})\n\
+snippet importq\n\
+	import qualified ${1:Data.Text} as ${2:T}\n\
+snippet inst\n\
+	instance ${1:Monoid} ${2:Type} where\n\
+		${3}\n\
+snippet type\n\
+	type ${1:Type} = ${2:Type}\n\
+snippet data\n\
+	data ${1:Type} = ${2:$1} ${3:Int}\n\
+snippet newtype\n\
+	newtype ${1:Type} = ${2:$1} ${3:Int}\n\
+snippet class\n\
+	class ${1:Class} a where\n\
+		${2}\n\
+snippet module\n\
+	module `substitute(substitute(expand('%:r'), '[/\\\\]','.','g'),'^\\%(\\l*\\.\\)\\?','','')` (\n\
+	)	where\n\
+	`expand('%') =~ 'Main' ? \"\\n\\nmain = do\\n  print \\\"hello world\\\"\" : \"\"`\n\
+\n\
+snippet const\n\
+	${1:name} :: ${2:a}\n\
+	$1 = ${3:undefined}\n\
+snippet fn\n\
+	${1:fn} :: ${2:a} -> ${3:a}\n\
+	$1 ${4} = ${5:undefined}\n\
+snippet fn2\n\
+	${1:fn} :: ${2:a} -> ${3:a} -> ${4:a}\n\
+	$1 ${5} = ${6:undefined}\n\
+snippet ap\n\
+	${1:map} ${2:fn} ${3:list}\n\
+snippet do\n\
+	do\n\
+		\n\
+snippet λ\n\
+	\\${1:x} -> ${2}\n\
+snippet \\\n\
+	\\${1:x} -> ${2}\n\
+snippet <-\n\
+	${1:a} <- ${2:m a}\n\
+snippet ←\n\
+	${1:a} <- ${2:m a}\n\
+snippet ->\n\
+	${1:m a} -> ${2:a}\n\
+snippet →\n\
+	${1:m a} -> ${2:a}\n\
+snippet tup\n\
+	(${1:a}, ${2:b})\n\
+snippet tup2\n\
+	(${1:a}, ${2:b}, ${3:c})\n\
+snippet tup3\n\
+	(${1:a}, ${2:b}, ${3:c}, ${4:d})\n\
+snippet rec\n\
+	${1:Record} { ${2:recFieldA} = ${3:undefined}\n\
+				, ${4:recFieldB} = ${5:undefined}\n\
+				}\n\
+snippet case\n\
+	case ${1:something} of\n\
+		${2} -> ${3}\n\
+snippet let\n\
+	let ${1} = ${2}\n\
+	in ${3}\n\
+snippet where\n\
+	where\n\
+		${1:fn} = ${2:undefined}\n\
+";
+exports.scope = "haskell";
+
+});                (function() {
+                    ace.require(["ace/snippets/haskell"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 168 - 136
web/9405408bc4c1c18469c1eefd766f06b9.js → web/15abe309c5ecbc579dccc79beb041fd8.js

@@ -1,191 +1,222 @@
-ace.define("ace/mode/elm_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){// TODO check with https://github.com/deadfoxygrandpa/Elm.tmLanguage
+ace.define("ace/mode/elm_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var ElmHighlightRules = function () {
+
+var ElmHighlightRules = function() {
     var keywordMapper = this.createKeywordMapper({
-        "keyword": "as|case|class|data|default|deriving|do|else|export|foreign|" +
+       "keyword": "as|case|class|data|default|deriving|do|else|export|foreign|" +
             "hiding|jsevent|if|import|in|infix|infixl|infixr|instance|let|" +
             "module|newtype|of|open|then|type|where|_|port|\u03BB"
     }, "identifier");
+    
     var escapeRe = /\\(\d+|['"\\&trnbvf])/;
+    
     var smallRe = /[a-z_]/.source;
     var largeRe = /[A-Z]/.source;
     var idRe = /[a-z_A-Z0-9']/.source;
+
     this.$rules = {
         start: [{
-                token: "string.start",
-                regex: '"',
-                next: "string"
-            }, {
-                token: "string.character",
-                regex: "'(?:" + escapeRe.source + "|.)'?"
-            }, {
-                regex: /0(?:[xX][0-9A-Fa-f]+|[oO][0-7]+)|\d+(\.\d+)?([eE][-+]?\d*)?/,
-                token: "constant.numeric"
-            }, {
-                token: "comment",
-                regex: "--.*"
-            }, {
-                token: "keyword",
-                regex: /\.\.|\||:|=|\\|"|->|<-|\u2192/
-            }, {
-                token: "keyword.operator",
-                regex: /[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]+/
-            }, {
-                token: "operator.punctuation",
-                regex: /[,;`]/
-            }, {
-                regex: largeRe + idRe + "+\\.?",
-                token: function (value) {
-                    if (value[value.length - 1] == ".")
-                        return "entity.name.function";
-                    return "constant.language";
-                }
-            }, {
-                regex: "^" + smallRe + idRe + "+",
-                token: function (value) {
-                    return "constant.language";
-                }
-            }, {
-                token: keywordMapper,
-                regex: "[\\w\\xff-\\u218e\\u2455-\\uffff]+\\b"
-            }, {
-                regex: "{-#?",
-                token: "comment.start",
-                onMatch: function (value, currentState, stack) {
-                    this.next = value.length == 2 ? "blockComment" : "docComment";
-                    return this.token;
-                }
-            }, {
-                token: "variable.language",
-                regex: /\[markdown\|/,
-                next: "markdown"
-            }, {
-                token: "paren.lparen",
-                regex: /[\[({]/
-            }, {
-                token: "paren.rparen",
-                regex: /[\])}]/
-            }],
+            token: "string.start",
+            regex: '"',
+            next: "string"
+        }, {
+            token: "string.character",
+            regex: "'(?:" + escapeRe.source + "|.)'?"
+        }, {
+            regex: /0(?:[xX][0-9A-Fa-f]+|[oO][0-7]+)|\d+(\.\d+)?([eE][-+]?\d*)?/,
+            token: "constant.numeric"
+        }, {
+            token: "comment",
+            regex: "--.*"
+        }, {
+            token : "keyword",
+            regex : /\.\.|\||:|=|\\|"|->|<-|\u2192/
+        }, {
+            token : "keyword.operator",
+            regex : /[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]+/
+        }, {
+            token : "operator.punctuation",
+            regex : /[,;`]/
+        }, {
+            regex : largeRe + idRe + "+\\.?",
+            token : function(value) {
+                if (value[value.length - 1] == ".")
+                    return "entity.name.function"; 
+                return "constant.language"; 
+            }
+        }, {
+            regex : "^" + smallRe  + idRe + "+",
+            token : function(value) {
+                return "constant.language"; 
+            }
+        }, {
+            token : keywordMapper,
+            regex : "[\\w\\xff-\\u218e\\u2455-\\uffff]+\\b"
+        }, {
+            regex: "{-#?",
+            token: "comment.start",
+            onMatch: function(value, currentState, stack) {
+                this.next = value.length == 2 ? "blockComment" : "docComment";
+                return this.token;
+            }
+        }, {
+            token: "variable.language",
+            regex: /\[markdown\|/,
+            next: "markdown"
+        }, {
+            token: "paren.lparen",
+            regex: /[\[({]/ 
+        }, {
+            token: "paren.rparen",
+            regex: /[\])}]/
+        } ],
         markdown: [{
-                regex: /\|\]/,
-                next: "start"
-            }, {
-                defaultToken: "string"
-            }],
+            regex: /\|\]/,
+            next: "start"
+        }, {
+            defaultToken : "string"
+        }],
         blockComment: [{
-                regex: "{-",
-                token: "comment.start",
-                push: "blockComment"
-            }, {
-                regex: "-}",
-                token: "comment.end",
-                next: "pop"
-            }, {
-                defaultToken: "comment"
-            }],
+            regex: "{-",
+            token: "comment.start",
+            push: "blockComment"
+        }, {
+            regex: "-}",
+            token: "comment.end",
+            next: "pop"
+        }, {
+            defaultToken: "comment"
+        }],
         docComment: [{
-                regex: "{-",
-                token: "comment.start",
-                push: "docComment"
-            }, {
-                regex: "-}",
-                token: "comment.end",
-                next: "pop"
-            }, {
-                defaultToken: "doc.comment"
-            }],
+            regex: "{-",
+            token: "comment.start",
+            push: "docComment"
+        }, {
+            regex: "-}",
+            token: "comment.end",
+            next: "pop" 
+        }, {
+            defaultToken: "doc.comment"
+        }],
         string: [{
-                token: "constant.language.escape",
-                regex: escapeRe
-            }, {
-                token: "text",
-                regex: /\\(\s|$)/,
-                next: "stringGap"
-            }, {
-                token: "string.end",
-                regex: '"',
-                next: "start"
-            }, {
-                defaultToken: "string"
-            }],
+            token: "constant.language.escape",
+            regex: escapeRe
+        }, {
+            token: "text",
+            regex: /\\(\s|$)/,
+            next: "stringGap"
+        }, {
+            token: "string.end",
+            regex: '"',
+            next: "start"
+        }, {
+            defaultToken: "string"
+        }],
         stringGap: [{
-                token: "text",
-                regex: /\\/,
-                next: "string"
-            }, {
-                token: "error",
-                regex: "",
-                next: "start"
-            }]
+            token: "text",
+            regex: /\\/,
+            next: "string"
+        }, {
+            token: "error",
+            regex: "",
+            next: "start"
+        }]
     };
+    
     this.normalizeRules();
 };
+
 oop.inherits(ElmHighlightRules, TextHighlightRules);
-exports.ElmHighlightRules = ElmHighlightRules;
 
+exports.ElmHighlightRules = ElmHighlightRules;
 });
 
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var Range = require("../../range").Range;
 var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
     if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
     }
 };
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
+
+(function() {
+    
     this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
     this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
     this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
     this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
     this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
+    
         if (this.singleLineBlockCommentRe.test(line)) {
             if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
                 return "";
         }
+    
         var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
         if (!fw && this.startRegionRe.test(line))
             return "start"; // lineCommentRegionStart
+    
         return fw;
     };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
         var line = session.getLine(row);
+        
         if (this.startRegionRe.test(line))
             return this.getCommentRegionBlock(session, line, row);
+        
         var match = line.match(this.foldingStartMarker);
         if (match) {
             var i = match.index;
+
             if (match[1])
                 return this.openingBracketBlock(session, match[1], row, i);
+                
             var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
             if (range && !range.isMultiLine()) {
                 if (forceMultiline) {
                     range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
+                } else if (foldStyle != "all")
                     range = null;
             }
+            
             return range;
         }
+
         if (foldStyle === "markbegin")
             return;
+
         var match = line.match(this.foldingStopMarker);
         if (match) {
             var i = match.index + match[0].length;
+
             if (match[1])
                 return this.closingBracketBlock(session, match[1], row, i);
+
             return session.getCommentFoldRange(row, i, -1);
         }
     };
-    this.getSectionRange = function (session, row) {
+    
+    this.getSectionRange = function(session, row) {
         var line = session.getLine(row);
         var startIndent = line.search(/\S/);
         var startRow = row;
@@ -198,72 +229,73 @@ oop.inherits(FoldMode, BaseFoldMode);
             var indent = line.search(/\S/);
             if (indent === -1)
                 continue;
-            if (startIndent > indent)
+            if  (startIndent > indent)
                 break;
             var subRange = this.getFoldWidgetRange(session, "all", row);
+            
             if (subRange) {
                 if (subRange.start.row <= startRow) {
                     break;
-                }
-                else if (subRange.isMultiLine()) {
+                } else if (subRange.isMultiLine()) {
                     row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
+                } else if (startIndent == indent) {
                     break;
                 }
             }
             endRow = row;
         }
+        
         return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
     };
-    this.getCommentRegionBlock = function (session, line, row) {
+    this.getCommentRegionBlock = function(session, line, row) {
         var startColumn = line.search(/\s*$/);
         var maxRow = session.getLength();
         var startRow = row;
+        
         var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
         var depth = 1;
         while (++row < maxRow) {
             line = session.getLine(row);
             var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
         }
+
         var endRow = row;
         if (endRow > startRow) {
             return new Range(startRow, startColumn, endRow, line.length);
         }
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/elm",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elm_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
-*/
+ace.define("ace/mode/elm",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elm_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var HighlightRules = require("./elm_highlight_rules").ElmHighlightRules;
 var FoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
+
+var Mode = function() {
     this.HighlightRules = HighlightRules;
     this.foldingRules = new FoldMode();
     this.$behaviour = this.$defaultBehaviour;
 };
 oop.inherits(Mode, TextMode);
-(function () {
+
+(function() {
     this.lineCommentStart = "--";
-    this.blockComment = { start: "{-", end: "-}", nestable: true };
+    this.blockComment = {start: "{-", end: "-}", nestable: true};
     this.$id = "ace/mode/elm";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });                (function() {
                     ace.require(["ace/mode/elm"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 0 - 16
web/15bd2f4de9aefea698aea59ecd36327f.js

@@ -1,16 +0,0 @@
-ace.define("ace/snippets/diff.snippets",["require","exports","module"], function(require, exports, module){module.exports = "# DEP-3 (http://dep.debian.net/deps/dep3/) style patch header\nsnippet header DEP-3 style header\n\tDescription: ${1}\n\tOrigin: ${2:vendor|upstream|other}, ${3:url of the original patch}\n\tBug: ${4:url in upstream bugtracker}\n\tForwarded: ${5:no|not-needed|url}\n\tAuthor: ${6:`g:snips_author`}\n\tReviewed-by: ${7:name and email}\n\tLast-Update: ${8:`strftime(\"%Y-%m-%d\")`}\n\tApplied-Upstream: ${9:upstream version|url|commit}\n\n";
-
-});
-
-ace.define("ace/snippets/diff",["require","exports","module","ace/snippets/diff.snippets"], function(require, exports, module){"use strict";
-exports.snippetText = require("./diff.snippets");
-exports.scope = "diff";
-
-});                (function() {
-                    ace.require(["ace/snippets/diff"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 449 - 0
web/167a62ec377adafbeb4bbb1cef73250d.js

@@ -0,0 +1,449 @@
+ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var reservedKeywords = exports.reservedKeywords = (
+        '!|{|}|case|do|done|elif|else|'+
+        'esac|fi|for|if|in|then|until|while|'+
+        '&|;|export|local|read|typeset|unset|'+
+        'elif|select|set|function|declare|readonly'
+    );
+
+var languageConstructs = exports.languageConstructs = (
+    '[|]|alias|bg|bind|break|builtin|'+
+     'cd|command|compgen|complete|continue|'+
+     'dirs|disown|echo|enable|eval|exec|'+
+     'exit|fc|fg|getopts|hash|help|history|'+
+     'jobs|kill|let|logout|popd|printf|pushd|'+
+     'pwd|return|set|shift|shopt|source|'+
+     'suspend|test|times|trap|type|ulimit|'+
+     'umask|unalias|wait'
+);
+
+var ShHighlightRules = function() {
+    var keywordMapper = this.createKeywordMapper({
+        "keyword": reservedKeywords,
+        "support.function.builtin": languageConstructs,
+        "invalid.deprecated": "debugger"
+    }, "identifier");
+
+    var integer = "(?:(?:[1-9]\\d*)|(?:0))";
+
+    var fraction = "(?:\\.\\d+)";
+    var intPart = "(?:\\d+)";
+    var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
+    var exponentFloat = "(?:(?:" + pointFloat + "|" +  intPart + ")" + ")";
+    var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
+    var fileDescriptor = "(?:&" + intPart + ")";
+
+    var variableName = "[a-zA-Z_][a-zA-Z0-9_]*";
+    var variable = "(?:" + variableName + "(?==))";
+
+    var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
+
+    var func = "(?:" + variableName + "\\s*\\(\\))";
+
+    this.$rules = {
+        "start" : [{
+            token : "constant",
+            regex : /\\./
+        }, {
+            token : ["text", "comment"],
+            regex : /(^|\s)(#.*)$/
+        }, {
+            token : "string.start",
+            regex : '"',
+            push : [{
+                token : "constant.language.escape",
+                regex : /\\(?:[$`"\\]|$)/
+            }, {
+                include : "variables"
+            }, {
+                token : "keyword.operator",
+                regex : /`/ // TODO highlight `
+            }, {
+                token : "string.end",
+                regex : '"',
+                next: "pop"
+            }, {
+                defaultToken: "string"
+            }]
+        }, {
+            token : "string",
+            regex : "\\$'",
+            push : [{
+                token : "constant.language.escape",
+                regex : /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/
+            }, {
+                token : "string",
+                regex : "'",
+                next: "pop"
+            }, {
+                defaultToken: "string"
+            }]
+        }, {
+            regex : "<<<",
+            token : "keyword.operator"
+        }, {
+            stateName: "heredoc",
+            regex : "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",
+            onMatch : function(value, currentState, stack) {
+                var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
+                var tokens = value.split(this.splitRegex);
+                stack.push(next, tokens[4]);
+                return [
+                    {type:"constant", value: tokens[1]},
+                    {type:"text", value: tokens[2]},
+                    {type:"string", value: tokens[3]},
+                    {type:"support.class", value: tokens[4]},
+                    {type:"string", value: tokens[5]}
+                ];
+            },
+            rules: {
+                heredoc: [{
+                    onMatch:  function(value, currentState, stack) {
+                        if (value === stack[1]) {
+                            stack.shift();
+                            stack.shift();
+                            this.next = stack[0] || "start";
+                            return "support.class";
+                        }
+                        this.next = "";
+                        return "string";
+                    },
+                    regex: ".*$",
+                    next: "start"
+                }],
+                indentedHeredoc: [{
+                    token: "string",
+                    regex: "^\t+"
+                }, {
+                    onMatch:  function(value, currentState, stack) {
+                        if (value === stack[1]) {
+                            stack.shift();
+                            stack.shift();
+                            this.next = stack[0] || "start";
+                            return "support.class";
+                        }
+                        this.next = "";
+                        return "string";
+                    },
+                    regex: ".*$",
+                    next: "start"
+                }]
+            }
+        }, {
+            regex : "$",
+            token : "empty",
+            next : function(currentState, stack) {
+                if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
+                    return stack[0];
+                return currentState;
+            }
+        }, {
+            token : ["keyword", "text", "text", "text", "variable"],
+            regex : /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/
+        }, {
+            token : "variable.language",
+            regex : builtinVariable
+        }, {
+            token : "variable",
+            regex : variable
+        }, {
+            include : "variables"
+        }, {
+            token : "support.function",
+            regex : func
+        }, {
+            token : "support.function",
+            regex : fileDescriptor
+        }, {
+            token : "string",           // ' string
+            start : "'", end : "'"
+        }, {
+            token : "constant.numeric", // float
+            regex : floatNumber
+        }, {
+            token : "constant.numeric", // integer
+            regex : integer + "\\b"
+        }, {
+            token : keywordMapper,
+            regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b"
+        }, {
+            token : "keyword.operator",
+            regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"
+        }, {
+            token : "punctuation.operator",
+            regex : ";"
+        }, {
+            token : "paren.lparen",
+            regex : "[\\[\\(\\{]"
+        }, {
+            token : "paren.rparen",
+            regex : "[\\]]"
+        }, {
+            token : "paren.rparen",
+            regex : "[\\)\\}]",
+            next : "pop"
+        }],
+        variables: [{
+            token : "variable",
+            regex : /(\$)(\w+)/
+        }, {
+            token : ["variable", "paren.lparen"],
+            regex : /(\$)(\()/,
+            push : "start"
+        }, {
+            token : ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"],
+            regex : /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,
+            push : "start"
+        }, {
+            token : "variable",
+            regex : /\$[*@#?\-$!0_]/
+        }, {
+            token : ["variable", "paren.lparen"],
+            regex : /(\$)(\{)/,
+            push : "start"
+        }]
+    };
+    
+    this.normalizeRules();
+};
+
+oop.inherits(ShHighlightRules, TextHighlightRules);
+
+exports.ShHighlightRules = ShHighlightRules;
+});
+
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
+    if (commentRegex) {
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
+    }
+};
+oop.inherits(FoldMode, BaseFoldMode);
+
+(function() {
+    
+    this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
+    this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
+    this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
+    this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
+    this._getFoldWidgetBase = this.getFoldWidget;
+    this.getFoldWidget = function(session, foldStyle, row) {
+        var line = session.getLine(row);
+    
+        if (this.singleLineBlockCommentRe.test(line)) {
+            if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
+                return "";
+        }
+    
+        var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
+        if (!fw && this.startRegionRe.test(line))
+            return "start"; // lineCommentRegionStart
+    
+        return fw;
+    };
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
+        var line = session.getLine(row);
+        
+        if (this.startRegionRe.test(line))
+            return this.getCommentRegionBlock(session, line, row);
+        
+        var match = line.match(this.foldingStartMarker);
+        if (match) {
+            var i = match.index;
+
+            if (match[1])
+                return this.openingBracketBlock(session, match[1], row, i);
+                
+            var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
+            if (range && !range.isMultiLine()) {
+                if (forceMultiline) {
+                    range = this.getSectionRange(session, row);
+                } else if (foldStyle != "all")
+                    range = null;
+            }
+            
+            return range;
+        }
+
+        if (foldStyle === "markbegin")
+            return;
+
+        var match = line.match(this.foldingStopMarker);
+        if (match) {
+            var i = match.index + match[0].length;
+
+            if (match[1])
+                return this.closingBracketBlock(session, match[1], row, i);
+
+            return session.getCommentFoldRange(row, i, -1);
+        }
+    };
+    
+    this.getSectionRange = function(session, row) {
+        var line = session.getLine(row);
+        var startIndent = line.search(/\S/);
+        var startRow = row;
+        var startColumn = line.length;
+        row = row + 1;
+        var endRow = row;
+        var maxRow = session.getLength();
+        while (++row < maxRow) {
+            line = session.getLine(row);
+            var indent = line.search(/\S/);
+            if (indent === -1)
+                continue;
+            if  (startIndent > indent)
+                break;
+            var subRange = this.getFoldWidgetRange(session, "all", row);
+            
+            if (subRange) {
+                if (subRange.start.row <= startRow) {
+                    break;
+                } else if (subRange.isMultiLine()) {
+                    row = subRange.end.row;
+                } else if (startIndent == indent) {
+                    break;
+                }
+            }
+            endRow = row;
+        }
+        
+        return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
+    };
+    this.getCommentRegionBlock = function(session, line, row) {
+        var startColumn = line.search(/\s*$/);
+        var maxRow = session.getLength();
+        var startRow = row;
+        
+        var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
+        var depth = 1;
+        while (++row < maxRow) {
+            line = session.getLine(row);
+            var m = re.exec(line);
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
+        }
+
+        var endRow = row;
+        if (endRow > startRow) {
+            return new Range(startRow, startColumn, endRow, line.length);
+        }
+    };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
+var Range = require("../range").Range;
+var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
+
+var Mode = function() {
+    this.HighlightRules = ShHighlightRules;
+    this.foldingRules = new CStyleFoldMode();
+    this.$behaviour = new CstyleBehaviour();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+   
+    this.lineCommentStart = "#";
+
+    this.getNextLineIndent = function(state, line, tab) {
+        var indent = this.$getIndent(line);
+
+        var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
+        var tokens = tokenizedLine.tokens;
+
+        if (tokens.length && tokens[tokens.length-1].type == "comment") {
+            return indent;
+        }
+
+        if (state == "start") {
+            var match = line.match(/^.*[\{\(\[:]\s*$/);
+            if (match) {
+                indent += tab;
+            }
+        }
+
+        return indent;
+    };
+
+    var outdents = {
+        "pass": 1,
+        "return": 1,
+        "raise": 1,
+        "break": 1,
+        "continue": 1
+    };
+
+    this.checkOutdent = function(state, line, input) {
+        if (input !== "\r\n" && input !== "\r" && input !== "\n")
+            return false;
+
+        var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
+
+        if (!tokens)
+            return false;
+        do {
+            var last = tokens.pop();
+        } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
+
+        if (!last)
+            return false;
+
+        return (last.type == "keyword" && outdents[last.value]);
+    };
+
+    this.autoOutdent = function(state, doc, row) {
+
+        row += 1;
+        var indent = this.$getIndent(doc.getLine(row));
+        var tab = doc.getTabString();
+        if (indent.slice(-tab.length) == tab)
+            doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
+    };
+
+    this.$id = "ace/mode/sh";
+    this.snippetFileId = "ace/snippets/sh";
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});                (function() {
+                    ace.require(["ace/mode/sh"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 0 - 16
web/173ea2d9126a53f1d6cb61ef26219598.js

@@ -1,16 +0,0 @@
-ace.define("ace/snippets/dart.snippets",["require","exports","module"], function(require, exports, module){module.exports = "snippet lib\n\tlibrary ${1};\n\t${2}\nsnippet im\n\timport '${1}';\n\t${2}\nsnippet pa\n\tpart '${1}';\n\t${2}\nsnippet pao\n\tpart of ${1};\n\t${2}\nsnippet main\n\tvoid main() {\n\t  ${1:/* code */}\n\t}\nsnippet st\n\tstatic ${1}\nsnippet fi\n\tfinal ${1}\nsnippet re\n\treturn ${1}\nsnippet br\n\tbreak;\nsnippet th\n\tthrow ${1}\nsnippet cl\n\tclass ${1:`Filename(\"\", \"untitled\")`} ${2}\nsnippet imp\n\timplements ${1}\nsnippet ext\n\textends ${1}\nsnippet if\n\tif (${1:true}) {\n\t  ${2}\n\t}\nsnippet ife\n\tif (${1:true}) {\n\t  ${2}\n\t} else {\n\t  ${3}\n\t}\nsnippet el\n\telse\nsnippet sw\n\tswitch (${1}) {\n\t  ${2}\n\t}\nsnippet cs\n\tcase ${1}:\n\t  ${2}\nsnippet de\n\tdefault:\n\t  ${1}\nsnippet for\n\tfor (var ${2:i} = 0, len = ${1:things}.length; $2 < len; ${3:++}$2) {\n\t  ${4:$1[$2]}\n\t}\nsnippet fore\n\tfor (final ${2:item} in ${1:itemList}) {\n\t  ${3:/* code */}\n\t}\nsnippet wh\n\twhile (${1:/* condition */}) {\n\t  ${2:/* code */}\n\t}\nsnippet dowh\n\tdo {\n\t  ${2:/* code */}\n\t} while (${1:/* condition */});\nsnippet as\n\tassert(${1:/* condition */});\nsnippet try\n\ttry {\n\t  ${2}\n\t} catch (${1:Exception e}) {\n\t}\nsnippet tryf\n\ttry {\n\t  ${2}\n\t} catch (${1:Exception e}) {\n\t} finally {\n\t}\n";
-
-});
-
-ace.define("ace/snippets/dart",["require","exports","module","ace/snippets/dart.snippets"], function(require, exports, module){"use strict";
-exports.snippetText = require("./dart.snippets");
-exports.scope = "dart";
-
-});                (function() {
-                    ace.require(["ace/snippets/dart"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

文件差异内容过多而无法显示
+ 0 - 0
web/18b69bf761ab7d8645f68794096dcb46.js


+ 0 - 502
web/18b9a42de70da52144b223be58bb65c3.js

@@ -1,502 +0,0 @@
-ace.define("ace/mode/zeek_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var ZeekHighlightRules = function () {
-    this.$rules = {
-        "start": [
-            {
-                token: "comment.line",
-                regex: "#.*$"
-            },
-            {
-                token: "string.double",
-                regex: /"/,
-                next: "string-state"
-            },
-            {
-                token: "string.regexp",
-                regex: "(/)(?=.*/)",
-                next: "pattern-state"
-            },
-            {
-                token: ["keyword.other", "meta.preprocessor"],
-                regex: /(@(?:load-plugin|load-sigs|load|unload))(.*$)/
-            },
-            {
-                token: "keyword.other",
-                regex: /@(?:DEBUG|DIR|FILENAME|deprecated|if|ifdef|ifndef|else|endif)/
-            },
-            {
-                token: [
-                    "keyword.other",
-                    "meta.preprocessor",
-                    "keyword.operator",
-                    "meta.preprocessor"
-                ],
-                regex: /(@prefixes)(\s*)(\+?=)(.*$)/
-            },
-            {
-                token: "storage.modifier.attribute",
-                regex: /\&\b(?:redef|priority|log|optional|default|add_func|delete_func|expire_func|read_expire|write_expire|create_expire|synchronized|persistent|rotate_interval|rotate_size|encrypt|raw_output|mergeable|error_handler|type_column|deprecated)\b/
-            },
-            {
-                token: "constant.language",
-                regex: /\b(?:T|F)\b/
-            },
-            {
-                token: "constant.numeric.port",
-                regex: /\b\d{1,5}\/(?:udp|tcp|icmp|unknown)\b/
-            },
-            {
-                token: "constant.numeric.addr",
-                regex: /\b(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[0-9]{1,2})\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[0-9]{1,2})\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[0-9]{1,2})\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[0-9]{1,2})\b/,
-                comment: "IPv4 address"
-            },
-            {
-                token: "constant.numeric.addr",
-                regex: /\[(?:[0-9a-fA-F]{0,4}:){2,7}(?:[0-9a-fA-F]{0,4})?(?:(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[0-9]{1,2})\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[0-9]{1,2})\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[0-9]{1,2})\.(?:25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[0-9]{1,2}))?\]/,
-                comment: "IPv6 address"
-            },
-            {
-                token: "constant.numeric.float.decimal.interval",
-                regex: /(?:(?:\d*\.\d*(?:[eE][+-]?\d+)?|\d*[eE][+-]?\d+|\d*\.\d*)|\d+)\s*(?:day|hr|min|msec|usec|sec)s?/
-            },
-            {
-                token: "constant.numeric.float.decimal",
-                regex: /\d*\.\d*(?:[eE][+-]?\d+)?|\d*[eE][+-]?\d+|\d*\.\d*/
-            },
-            {
-                token: "constant.numeric.hostname",
-                regex: /\b[A-Za-z0-9][A-Za-z0-9\-]*(?:\.[A-Za-z0-9][A-Za-z0-9\-]*)+\b/
-            },
-            {
-                token: "constant.numeric.integer.hexadecimal",
-                regex: /\b0x[0-9a-fA-F]+\b/
-            },
-            {
-                token: "constant.numeric.integer.decimal",
-                regex: /\b\d+\b/
-            },
-            {
-                token: "keyword.operator",
-                regex: /==|!=|<=|<|>=|>/
-            },
-            {
-                token: "keyword.operator",
-                regex: /(&&)|(\|\|)|(!)/
-            },
-            {
-                token: "keyword.operator",
-                regex: /=|\+=|-=/
-            },
-            {
-                token: "keyword.operator",
-                regex: /\+\+|\+|--|-|\*|\/|%/
-            },
-            {
-                token: "keyword.operator",
-                regex: /&|\||\^|~/
-            },
-            {
-                token: "keyword.operator",
-                regex: /\b(?:in|as|is)\b/
-            },
-            {
-                token: "punctuation.terminator",
-                regex: /;/
-            },
-            {
-                token: "punctuation.accessor",
-                regex: /\??\$/
-            },
-            {
-                token: "punctuation.accessor",
-                regex: /::/
-            },
-            {
-                token: "keyword.operator",
-                regex: /\?/
-            },
-            {
-                token: "punctuation.separator",
-                regex: /:/
-            },
-            {
-                token: "punctuation.separator",
-                regex: /,/
-            },
-            {
-                token: [
-                    "keyword.other",
-                    "meta.namespace",
-                    "entity.name.namespace"
-                ],
-                regex: /(module)(\s+)([A-Za-z_][A-Za-z_0-9]*(?:::[A-Za-z_][A-Za-z_0-9]*)*)/
-            },
-            {
-                token: "keyword.other",
-                regex: /\bexport\b/
-            },
-            {
-                token: "keyword.control.conditional",
-                regex: /\b(?:if|else)\b/
-            },
-            {
-                token: "keyword.control",
-                regex: /\b(?:for|while)\b/
-            },
-            {
-                token: "keyword.control",
-                regex: /\b(?:return|break|next|continue|fallthrough)\b/
-            },
-            {
-                token: "keyword.control",
-                regex: /\b(?:switch|default|case)\b/
-            },
-            {
-                token: "keyword.other",
-                regex: /\b(?:add|delete)\b/
-            },
-            {
-                token: "keyword.other",
-                regex: /\bprint\b/
-            },
-            {
-                token: "keyword.control",
-                regex: /\b(?:when|timeout|schedule)\b/
-            },
-            {
-                token: [
-                    "keyword.other",
-                    "meta.struct.record",
-                    "entity.name.struct.record",
-                    "meta.struct.record",
-                    "punctuation.separator",
-                    "meta.struct.record",
-                    "storage.type.struct.record"
-                ],
-                regex: /\b(type)(\s+)([A-Za-z_][A-Za-z_0-9]*(?:::[A-Za-z_][A-Za-z_0-9]*)*)(\s*)(:)(\s*\b)(record)\b/
-            },
-            {
-                token: [
-                    "keyword.other",
-                    "meta.enum",
-                    "entity.name.enum",
-                    "meta.enum",
-                    "punctuation.separator",
-                    "meta.enum",
-                    "storage.type.enum"
-                ],
-                regex: /\b(type)(\s+)([A-Za-z_][A-Za-z_0-9]*(?:::[A-Za-z_][A-Za-z_0-9]*)*)(\s*)(:)(\s*\b)(enum)\b/
-            },
-            {
-                token: [
-                    "keyword.other",
-                    "meta.type",
-                    "entity.name.type",
-                    "meta.type",
-                    "punctuation.separator"
-                ],
-                regex: /\b(type)(\s+)([A-Za-z_][A-Za-z_0-9]*(?:::[A-Za-z_][A-Za-z_0-9]*)*)(\s*)(:)/
-            },
-            {
-                token: [
-                    "keyword.other",
-                    "meta.struct.record",
-                    "storage.type.struct.record",
-                    "meta.struct.record",
-                    "entity.name.struct.record"
-                ],
-                regex: /\b(redef)(\s+)(record)(\s+)([A-Za-z_][A-Za-z_0-9]*(?:::[A-Za-z_][A-Za-z_0-9]*)*)\b/
-            },
-            {
-                token: [
-                    "keyword.other",
-                    "meta.enum",
-                    "storage.type.enum",
-                    "meta.enum",
-                    "entity.name.enum"
-                ],
-                regex: /\b(redef)(\s+)(enum)(\s+)([A-Za-z_][A-Za-z_0-9]*(?:::[A-Za-z_][A-Za-z_0-9]*)*)\b/
-            },
-            {
-                token: [
-                    "storage.type",
-                    "text",
-                    "entity.name.function.event"
-                ],
-                regex: /\b(event)(\s+)([A-Za-z_][A-Za-z_0-9]*(?:::[A-Za-z_][A-Za-z_0-9]*)*)(?=s*\()/
-            },
-            {
-                token: [
-                    "storage.type",
-                    "text",
-                    "entity.name.function.hook"
-                ],
-                regex: /\b(hook)(\s+)([A-Za-z_][A-Za-z_0-9]*(?:::[A-Za-z_][A-Za-z_0-9]*)*)(?=s*\()/
-            },
-            {
-                token: [
-                    "storage.type",
-                    "text",
-                    "entity.name.function"
-                ],
-                regex: /\b(function)(\s+)([A-Za-z_][A-Za-z_0-9]*(?:::[A-Za-z_][A-Za-z_0-9]*)*)(?=s*\()/
-            },
-            {
-                token: "keyword.other",
-                regex: /\bredef\b/
-            },
-            {
-                token: "storage.type",
-                regex: /\bany\b/
-            },
-            {
-                token: "storage.type",
-                regex: /\b(?:enum|record|set|table|vector)\b/
-            },
-            {
-                token: [
-                    "storage.type",
-                    "text",
-                    "keyword.operator",
-                    "text",
-                    "storage.type"
-                ],
-                regex: /\b(opaque)(\s+)(of)(\s+)([A-Za-z_][A-Za-z_0-9]*(?:::[A-Za-z_][A-Za-z_0-9]*)*)\b/
-            },
-            {
-                token: "keyword.operator",
-                regex: /\bof\b/
-            },
-            {
-                token: "storage.type",
-                regex: /\b(?:addr|bool|count|double|file|int|interval|pattern|port|string|subnet|time)\b/
-            },
-            {
-                token: "storage.type",
-                regex: /\b(?:function|hook|event)\b/
-            },
-            {
-                token: "storage.modifier",
-                regex: /\b(?:global|local|const|option)\b/
-            },
-            {
-                token: "entity.name.function.call",
-                regex: /\b[A-Za-z_][A-Za-z_0-9]*(?:::[A-Za-z_][A-Za-z_0-9]*)*(?=s*\()/
-            },
-            {
-                token: "punctuation.section.block.begin",
-                regex: /\{/
-            },
-            {
-                token: "punctuation.section.block.end",
-                regex: /\}/
-            },
-            {
-                token: "punctuation.section.brackets.begin",
-                regex: /\[/
-            },
-            {
-                token: "punctuation.section.brackets.end",
-                regex: /\]/
-            },
-            {
-                token: "punctuation.section.parens.begin",
-                regex: /\(/
-            },
-            {
-                token: "punctuation.section.parens.end",
-                regex: /\)/
-            }
-        ],
-        "string-state": [
-            {
-                token: "constant.character.escape",
-                regex: /\\./
-            },
-            {
-                token: "string.double",
-                regex: /"/,
-                next: "start"
-            },
-            {
-                token: "constant.other.placeholder",
-                regex: /%-?[0-9]*(\.[0-9]+)?[DTdxsefg]/
-            },
-            {
-                token: "string.double",
-                regex: "."
-            }
-        ],
-        "pattern-state": [
-            {
-                token: "constant.character.escape",
-                regex: /\\./
-            },
-            {
-                token: "string.regexp",
-                regex: "/",
-                next: "start"
-            },
-            {
-                token: "string.regexp",
-                regex: "."
-            }
-        ] // state: pattern-state
-    };
-    this.normalizeRules();
-};
-ZeekHighlightRules.metaData = {
-    fileTypes: ["bro", "zeek"],
-    name: "Zeek",
-    scopeName: "source.zeek"
-};
-oop.inherits(ZeekHighlightRules, TextHighlightRules);
-exports.ZeekHighlightRules = ZeekHighlightRules;
-
-});
-
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
-    if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
-    }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
-    this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
-    this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
-    this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
-    this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
-        var line = session.getLine(row);
-        if (this.singleLineBlockCommentRe.test(line)) {
-            if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
-                return "";
-        }
-        var fw = this._getFoldWidgetBase(session, foldStyle, row);
-        if (!fw && this.startRegionRe.test(line))
-            return "start"; // lineCommentRegionStart
-        return fw;
-    };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
-        var line = session.getLine(row);
-        if (this.startRegionRe.test(line))
-            return this.getCommentRegionBlock(session, line, row);
-        var match = line.match(this.foldingStartMarker);
-        if (match) {
-            var i = match.index;
-            if (match[1])
-                return this.openingBracketBlock(session, match[1], row, i);
-            var range = session.getCommentFoldRange(row, i + match[0].length, 1);
-            if (range && !range.isMultiLine()) {
-                if (forceMultiline) {
-                    range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
-                    range = null;
-            }
-            return range;
-        }
-        if (foldStyle === "markbegin")
-            return;
-        var match = line.match(this.foldingStopMarker);
-        if (match) {
-            var i = match.index + match[0].length;
-            if (match[1])
-                return this.closingBracketBlock(session, match[1], row, i);
-            return session.getCommentFoldRange(row, i, -1);
-        }
-    };
-    this.getSectionRange = function (session, row) {
-        var line = session.getLine(row);
-        var startIndent = line.search(/\S/);
-        var startRow = row;
-        var startColumn = line.length;
-        row = row + 1;
-        var endRow = row;
-        var maxRow = session.getLength();
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var indent = line.search(/\S/);
-            if (indent === -1)
-                continue;
-            if (startIndent > indent)
-                break;
-            var subRange = this.getFoldWidgetRange(session, "all", row);
-            if (subRange) {
-                if (subRange.start.row <= startRow) {
-                    break;
-                }
-                else if (subRange.isMultiLine()) {
-                    row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
-                    break;
-                }
-            }
-            endRow = row;
-        }
-        return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
-    };
-    this.getCommentRegionBlock = function (session, line, row) {
-        var startColumn = line.search(/\s*$/);
-        var maxRow = session.getLength();
-        var startRow = row;
-        var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
-        var depth = 1;
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
-        }
-        var endRow = row;
-        if (endRow > startRow) {
-            return new Range(startRow, startColumn, endRow, line.length);
-        }
-    };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/zeek",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/zeek_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
-*/
-"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var ZeekHighlightRules = require("./zeek_highlight_rules").ZeekHighlightRules;
-var FoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
-    this.HighlightRules = ZeekHighlightRules;
-    this.foldingRules = new FoldMode();
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.lineCommentStart = "#";
-    this.$id = "ace/mode/zeek";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});                (function() {
-                    ace.require(["ace/mode/zeek"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 148 - 0
web/19573d26f286762809b86f935516c1ac.js

@@ -0,0 +1,148 @@
+ace.define("ace/theme/dreamweaver",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
+exports.isDark = false;
+exports.cssClass = "ace-dreamweaver";
+exports.cssText = ".ace-dreamweaver .ace_gutter {\
+background: #e8e8e8;\
+color: #333;\
+}\
+.ace-dreamweaver .ace_print-margin {\
+width: 1px;\
+background: #e8e8e8;\
+}\
+.ace-dreamweaver {\
+background-color: #FFFFFF;\
+color: black;\
+}\
+.ace-dreamweaver .ace_fold {\
+background-color: #757AD8;\
+}\
+.ace-dreamweaver .ace_cursor {\
+color: black;\
+}\
+.ace-dreamweaver .ace_invisible {\
+color: rgb(191, 191, 191);\
+}\
+.ace-dreamweaver .ace_storage,\
+.ace-dreamweaver .ace_keyword {\
+color: blue;\
+}\
+.ace-dreamweaver .ace_constant.ace_buildin {\
+color: rgb(88, 72, 246);\
+}\
+.ace-dreamweaver .ace_constant.ace_language {\
+color: rgb(88, 92, 246);\
+}\
+.ace-dreamweaver .ace_constant.ace_library {\
+color: rgb(6, 150, 14);\
+}\
+.ace-dreamweaver .ace_invalid {\
+background-color: rgb(153, 0, 0);\
+color: white;\
+}\
+.ace-dreamweaver .ace_support.ace_function {\
+color: rgb(60, 76, 114);\
+}\
+.ace-dreamweaver .ace_support.ace_constant {\
+color: rgb(6, 150, 14);\
+}\
+.ace-dreamweaver .ace_support.ace_type,\
+.ace-dreamweaver .ace_support.ace_class {\
+color: #009;\
+}\
+.ace-dreamweaver .ace_support.ace_php_tag {\
+color: #f00;\
+}\
+.ace-dreamweaver .ace_keyword.ace_operator {\
+color: rgb(104, 118, 135);\
+}\
+.ace-dreamweaver .ace_string {\
+color: #00F;\
+}\
+.ace-dreamweaver .ace_comment {\
+color: rgb(76, 136, 107);\
+}\
+.ace-dreamweaver .ace_comment.ace_doc {\
+color: rgb(0, 102, 255);\
+}\
+.ace-dreamweaver .ace_comment.ace_doc.ace_tag {\
+color: rgb(128, 159, 191);\
+}\
+.ace-dreamweaver .ace_constant.ace_numeric {\
+color: rgb(0, 0, 205);\
+}\
+.ace-dreamweaver .ace_variable {\
+color: #06F\
+}\
+.ace-dreamweaver .ace_xml-pe {\
+color: rgb(104, 104, 91);\
+}\
+.ace-dreamweaver .ace_entity.ace_name.ace_function {\
+color: #00F;\
+}\
+.ace-dreamweaver .ace_heading {\
+color: rgb(12, 7, 255);\
+}\
+.ace-dreamweaver .ace_list {\
+color:rgb(185, 6, 144);\
+}\
+.ace-dreamweaver .ace_marker-layer .ace_selection {\
+background: rgb(181, 213, 255);\
+}\
+.ace-dreamweaver .ace_marker-layer .ace_step {\
+background: rgb(252, 255, 0);\
+}\
+.ace-dreamweaver .ace_marker-layer .ace_stack {\
+background: rgb(164, 229, 101);\
+}\
+.ace-dreamweaver .ace_marker-layer .ace_bracket {\
+margin: -1px 0 0 -1px;\
+border: 1px solid rgb(192, 192, 192);\
+}\
+.ace-dreamweaver .ace_marker-layer .ace_active-line {\
+background: rgba(0, 0, 0, 0.07);\
+}\
+.ace-dreamweaver .ace_gutter-active-line {\
+background-color : #DCDCDC;\
+}\
+.ace-dreamweaver .ace_marker-layer .ace_selected-word {\
+background: rgb(250, 250, 255);\
+border: 1px solid rgb(200, 200, 250);\
+}\
+.ace-dreamweaver .ace_meta.ace_tag {\
+color:#009;\
+}\
+.ace-dreamweaver .ace_meta.ace_tag.ace_anchor {\
+color:#060;\
+}\
+.ace-dreamweaver .ace_meta.ace_tag.ace_form {\
+color:#F90;\
+}\
+.ace-dreamweaver .ace_meta.ace_tag.ace_image {\
+color:#909;\
+}\
+.ace-dreamweaver .ace_meta.ace_tag.ace_script {\
+color:#900;\
+}\
+.ace-dreamweaver .ace_meta.ace_tag.ace_style {\
+color:#909;\
+}\
+.ace-dreamweaver .ace_meta.ace_tag.ace_table {\
+color:#099;\
+}\
+.ace-dreamweaver .ace_string.ace_regex {\
+color: rgb(255, 0, 0)\
+}\
+.ace-dreamweaver .ace_indent-guide {\
+background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});                (function() {
+                    ace.require(["ace/theme/dreamweaver"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 16 - 8
web/0e13b643b6e88e8fd6328d50acabfda8.js → web/19a2b55271f405d0b97fad53c9d5ec2d.js

@@ -1,12 +1,14 @@
-ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"], function(require, exports, module){var Editor = require("../editor").Editor;
+ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) {
+
+var Editor = require("../editor").Editor;
+
 require("../config").defineOptions(Editor.prototype, "editor", {
     enableLinking: {
-        set: function (val) {
+        set: function(val) {
             if (val) {
                 this.on("click", onClick);
                 this.on("mousemove", onMouseMove);
-            }
-            else {
+            } else {
                 this.off("click", onClick);
                 this.off("mousemove", onMouseMove);
             }
@@ -14,35 +16,41 @@ require("../config").defineOptions(Editor.prototype, "editor", {
         value: false
     }
 });
+
 exports.previousLinkingHover = false;
+
 function onMouseMove(e) {
     var editor = e.editor;
     var ctrl = e.getAccelKey();
+
     if (ctrl) {
         var editor = e.editor;
         var docPos = e.getDocumentPosition();
         var session = editor.session;
         var token = session.getTokenAt(docPos.row, docPos.column);
+
         if (exports.previousLinkingHover && exports.previousLinkingHover != token) {
             editor._emit("linkHoverOut");
         }
-        editor._emit("linkHover", { position: docPos, token: token });
+        editor._emit("linkHover", {position: docPos, token: token});
         exports.previousLinkingHover = token;
-    }
-    else if (exports.previousLinkingHover) {
+    } else if (exports.previousLinkingHover) {
         editor._emit("linkHoverOut");
         exports.previousLinkingHover = false;
     }
 }
+
 function onClick(e) {
     var ctrl = e.getAccelKey();
     var button = e.getButton();
+
     if (button == 0 && ctrl) {
         var editor = e.editor;
         var docPos = e.getDocumentPosition();
         var session = editor.session;
         var token = session.getTokenAt(docPos.row, docPos.column);
-        editor._emit("linkClick", { position: docPos, token: token });
+
+        editor._emit("linkClick", {position: docPos, token: token});
     }
 }
 

+ 135 - 0
web/1afbeca385b131cfc3ae515b89e552c7.js

@@ -0,0 +1,135 @@
+ace.define("ace/theme/chrome",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
+
+exports.isDark = false;
+exports.cssClass = "ace-chrome";
+exports.cssText = ".ace-chrome .ace_gutter {\
+background: #ebebeb;\
+color: #333;\
+overflow : hidden;\
+}\
+.ace-chrome .ace_print-margin {\
+width: 1px;\
+background: #e8e8e8;\
+}\
+.ace-chrome {\
+background-color: #FFFFFF;\
+color: black;\
+}\
+.ace-chrome .ace_cursor {\
+color: black;\
+}\
+.ace-chrome .ace_invisible {\
+color: rgb(191, 191, 191);\
+}\
+.ace-chrome .ace_constant.ace_buildin {\
+color: rgb(88, 72, 246);\
+}\
+.ace-chrome .ace_constant.ace_language {\
+color: rgb(88, 92, 246);\
+}\
+.ace-chrome .ace_constant.ace_library {\
+color: rgb(6, 150, 14);\
+}\
+.ace-chrome .ace_invalid {\
+background-color: rgb(153, 0, 0);\
+color: white;\
+}\
+.ace-chrome .ace_fold {\
+}\
+.ace-chrome .ace_support.ace_function {\
+color: rgb(60, 76, 114);\
+}\
+.ace-chrome .ace_support.ace_constant {\
+color: rgb(6, 150, 14);\
+}\
+.ace-chrome .ace_support.ace_type,\
+.ace-chrome .ace_support.ace_class\
+.ace-chrome .ace_support.ace_other {\
+color: rgb(109, 121, 222);\
+}\
+.ace-chrome .ace_variable.ace_parameter {\
+font-style:italic;\
+color:#FD971F;\
+}\
+.ace-chrome .ace_keyword.ace_operator {\
+color: rgb(104, 118, 135);\
+}\
+.ace-chrome .ace_comment {\
+color: #236e24;\
+}\
+.ace-chrome .ace_comment.ace_doc {\
+color: #236e24;\
+}\
+.ace-chrome .ace_comment.ace_doc.ace_tag {\
+color: #236e24;\
+}\
+.ace-chrome .ace_constant.ace_numeric {\
+color: rgb(0, 0, 205);\
+}\
+.ace-chrome .ace_variable {\
+color: rgb(49, 132, 149);\
+}\
+.ace-chrome .ace_xml-pe {\
+color: rgb(104, 104, 91);\
+}\
+.ace-chrome .ace_entity.ace_name.ace_function {\
+color: #0000A2;\
+}\
+.ace-chrome .ace_heading {\
+color: rgb(12, 7, 255);\
+}\
+.ace-chrome .ace_list {\
+color:rgb(185, 6, 144);\
+}\
+.ace-chrome .ace_marker-layer .ace_selection {\
+background: rgb(181, 213, 255);\
+}\
+.ace-chrome .ace_marker-layer .ace_step {\
+background: rgb(252, 255, 0);\
+}\
+.ace-chrome .ace_marker-layer .ace_stack {\
+background: rgb(164, 229, 101);\
+}\
+.ace-chrome .ace_marker-layer .ace_bracket {\
+margin: -1px 0 0 -1px;\
+border: 1px solid rgb(192, 192, 192);\
+}\
+.ace-chrome .ace_marker-layer .ace_active-line {\
+background: rgba(0, 0, 0, 0.07);\
+}\
+.ace-chrome .ace_gutter-active-line {\
+background-color : #dcdcdc;\
+}\
+.ace-chrome .ace_marker-layer .ace_selected-word {\
+background: rgb(250, 250, 255);\
+border: 1px solid rgb(200, 200, 250);\
+}\
+.ace-chrome .ace_storage,\
+.ace-chrome .ace_keyword,\
+.ace-chrome .ace_meta.ace_tag {\
+color: rgb(147, 15, 128);\
+}\
+.ace-chrome .ace_string.ace_regex {\
+color: rgb(255, 0, 0)\
+}\
+.ace-chrome .ace_string {\
+color: #1A1AA6;\
+}\
+.ace-chrome .ace_entity.ace_other.ace_attribute-name {\
+color: #994409;\
+}\
+.ace-chrome .ace_indent-guide {\
+background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
+}\
+";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});                (function() {
+                    ace.require(["ace/theme/chrome"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 0 - 9
web/1c71dfe2ae40884baae78d14e2568eb1.js

@@ -1,9 +0,0 @@
-
-;                (function() {
-                    ace.require(["ace/snippets/partiql"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 0 - 16
web/1cac3566cdfb6be0f51c3f2ade7c1603.js

@@ -1,16 +0,0 @@
-ace.define("ace/snippets/textile.snippets",["require","exports","module"], function(require, exports, module){module.exports = "# Jekyll post header\nsnippet header\n\t---\n\ttitle: ${1:title}\n\tlayout: post\n\tdate: ${2:date} ${3:hour:minute:second} -05:00\n\t---\n\n# Image\nsnippet img\n\t!${1:url}(${2:title}):${3:link}!\n\n# Table\nsnippet |\n\t|${1}|${2}\n\n# Link\nsnippet link\n\t\"${1:link text}\":${2:url}\n\n# Acronym\nsnippet (\n\t(${1:Expand acronym})${2}\n\n# Footnote\nsnippet fn\n\t[${1:ref number}] ${3}\n\n\tfn$1. ${2:footnote}\n\t\n";
-
-});
-
-ace.define("ace/snippets/textile",["require","exports","module","ace/snippets/textile.snippets"], function(require, exports, module){"use strict";
-exports.snippetText = require("./textile.snippets");
-exports.scope = "textile";
-
-});                (function() {
-                    ace.require(["ace/snippets/textile"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 90 - 64
web/92917192eaffb1cf3cadaf985d3cc5d1.js → web/1d837e2c9de35cbb09a85208da4a0d8a.js

@@ -1,18 +1,15 @@
-ace.define("ace/mode/abap_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/*
- * based on
- * " Vim ABAP syntax file
- * "    Language: SAP - ABAP/R4
- * "    Revision: 2.1
- * "  Maintainer: Marius Piedallu van Wyk <lailoken@gmail.com>
- * " Last Change: 2012 Oct 23
- */
+ace.define("ace/mode/abap_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var AbapHighlightRules = function () {
+
+var AbapHighlightRules = function() {
+
     var keywordMapper = this.createKeywordMapper({
         "variable.language": "this",
-        "keyword": "ADD ALIAS ALIASES ASCENDING ASSERT ASSIGN ASSIGNING AT BACK" +
+        "keyword": 
+            "ADD ALIAS ALIASES ASCENDING ASSERT ASSIGN ASSIGNING AT BACK" +
             " CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY" +
             " DATA DEFINE DEFINITION DEFERRED DELETE DESCENDING DESCRIBE DETAIL DIVIDE DO" +
             " ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT" +
@@ -38,103 +35,121 @@ var AbapHighlightRules = function () {
             " APPENDING CORRESPONDING FIELDS OF TABLE" +
             " LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING" +
             " EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN",
-        "constant.language": "TRUE FALSE NULL SPACE",
-        "support.type": "c n i p f d t x string xstring decfloat16 decfloat34",
-        "keyword.operator": "abs sign ceil floor trunc frac acos asin atan cos sin tan" +
+        "constant.language": 
+            "TRUE FALSE NULL SPACE",
+        "support.type": 
+            "c n i p f d t x string xstring decfloat16 decfloat34",
+        "keyword.operator":
+            "abs sign ceil floor trunc frac acos asin atan cos sin tan" +
             " abapOperator cosh sinh tanh exp log log10 sqrt" +
-            " strlen xstrlen charlen numofchar dbmaxlen lines"
+            " strlen xstrlen charlen numofchar dbmaxlen lines" 
     }, "text", true, " ");
-    var compoundKeywords = "WITH\\W+(?:HEADER\\W+LINE|FRAME|KEY)|NO\\W+STANDARD\\W+PAGE\\W+HEADING|" +
-        "EXIT\\W+FROM\\W+STEP\\W+LOOP|BEGIN\\W+OF\\W+(?:BLOCK|LINE)|BEGIN\\W+OF|" +
-        "END\\W+OF\\W+(?:BLOCK|LINE)|END\\W+OF|NO\\W+INTERVALS|" +
-        "RESPECTING\\W+BLANKS|SEPARATED\\W+BY|USING\\W+(?:EDIT\\W+MASK)|" +
-        "WHERE\\W+(?:LINE)|RADIOBUTTON\\W+GROUP|REF\\W+TO|" +
-        "(?:PUBLIC|PRIVATE|PROTECTED)(?:\\W+SECTION)?|DELETING\\W+(?:TRAILING|LEADING)" +
-        "(?:ALL\\W+OCCURRENCES)|(?:FIRST|LAST)\\W+OCCURRENCE|INHERITING\\W+FROM|" +
-        "LINE-COUNT|ADD-CORRESPONDING|AUTHORITY-CHECK|BREAK-POINT|CLASS-DATA|CLASS-METHODS|" +
-        "CLASS-METHOD|DIVIDE-CORRESPONDING|EDITOR-CALL|END-OF-DEFINITION|END-OF-PAGE|END-OF-SELECTION|" +
-        "FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|" +
-        "NEW-PAGE|NEW-SECTION|PRINT-CONTROL|RP-PROVIDE-FROM-LAST|SELECT-OPTIONS|SELECTION-SCREEN|" +
-        "START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYNTAX-TRACE|TOP-OF-PAGE|TYPE-POOL|" +
-        "TYPE-POOLS|LINE-SIZE|LINE-COUNT|MESSAGE-ID|DISPLAY-MODE|READ(?:-ONLY)?|" +
+
+    var compoundKeywords = "WITH\\W+(?:HEADER\\W+LINE|FRAME|KEY)|NO\\W+STANDARD\\W+PAGE\\W+HEADING|"+
+        "EXIT\\W+FROM\\W+STEP\\W+LOOP|BEGIN\\W+OF\\W+(?:BLOCK|LINE)|BEGIN\\W+OF|"+
+        "END\\W+OF\\W+(?:BLOCK|LINE)|END\\W+OF|NO\\W+INTERVALS|"+
+        "RESPECTING\\W+BLANKS|SEPARATED\\W+BY|USING\\W+(?:EDIT\\W+MASK)|"+
+        "WHERE\\W+(?:LINE)|RADIOBUTTON\\W+GROUP|REF\\W+TO|"+
+        "(?:PUBLIC|PRIVATE|PROTECTED)(?:\\W+SECTION)?|DELETING\\W+(?:TRAILING|LEADING)"+
+        "(?:ALL\\W+OCCURRENCES)|(?:FIRST|LAST)\\W+OCCURRENCE|INHERITING\\W+FROM|"+
+        "LINE-COUNT|ADD-CORRESPONDING|AUTHORITY-CHECK|BREAK-POINT|CLASS-DATA|CLASS-METHODS|"+
+        "CLASS-METHOD|DIVIDE-CORRESPONDING|EDITOR-CALL|END-OF-DEFINITION|END-OF-PAGE|END-OF-SELECTION|"+
+        "FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|"+
+        "NEW-PAGE|NEW-SECTION|PRINT-CONTROL|RP-PROVIDE-FROM-LAST|SELECT-OPTIONS|SELECTION-SCREEN|"+
+        "START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYNTAX-TRACE|TOP-OF-PAGE|TYPE-POOL|"+
+        "TYPE-POOLS|LINE-SIZE|LINE-COUNT|MESSAGE-ID|DISPLAY-MODE|READ(?:-ONLY)?|"+
         "IS\\W+(?:NOT\\W+)?(?:ASSIGNED|BOUND|INITIAL|SUPPLIED)";
+     
     this.$rules = {
-        "start": [
-            { token: "string", regex: "`", next: "string" },
-            { token: "string", regex: "'", next: "qstring" },
-            { token: "doc.comment", regex: /^\*.+/ },
-            { token: "comment", regex: /".+$/ },
-            { token: "invalid", regex: "\\.{2,}" },
-            { token: "keyword.operator", regex: /\W[\-+%=<>*]\W|\*\*|[~:,\.&$]|->*?|=>/ },
-            { token: "paren.lparen", regex: "[\\[({]" },
-            { token: "paren.rparen", regex: "[\\])}]" },
-            { token: "constant.numeric", regex: "[+-]?\\d+\\b" },
-            { token: "variable.parameter", regex: /sy|pa?\d\d\d\d\|t\d\d\d\.|innnn/ },
-            { token: "keyword", regex: compoundKeywords },
-            { token: "variable.parameter", regex: /\w+-\w[\-\w]*/ },
-            { token: keywordMapper, regex: "\\b\\w+\\b" },
-            { caseInsensitive: true }
+        "start" : [
+            {token : "string", regex : "`", next  : "string"},
+            {token : "string", regex : "'", next  : "qstring"},
+            {token : "doc.comment", regex : /^\*.+/},
+            {token : "comment",  regex : /".+$/},
+            {token : "invalid", regex: "\\.{2,}"},
+            {token : "keyword.operator", regex: /\W[\-+%=<>*]\W|\*\*|[~:,\.&$]|->*?|=>/},
+            {token : "paren.lparen", regex : "[\\[({]"},
+            {token : "paren.rparen", regex : "[\\])}]"},
+            {token : "constant.numeric", regex: "[+-]?\\d+\\b"},
+            {token : "variable.parameter", regex : /sy|pa?\d\d\d\d\|t\d\d\d\.|innnn/}, 
+            {token : "keyword", regex : compoundKeywords}, 
+            {token : "variable.parameter", regex : /\w+-\w[\-\w]*/},
+            {token : keywordMapper, regex : "\\b\\w+\\b"},
+            {caseInsensitive: true}
         ],
-        "qstring": [
-            { token: "constant.language.escape", regex: "''" },
-            { token: "string", regex: "'", next: "start" },
-            { defaultToken: "string" }
+        "qstring" : [
+            {token : "constant.language.escape",   regex : "''"},
+            {token : "string", regex : "'",     next  : "start"},
+            {defaultToken : "string"}
         ],
-        "string": [
-            { token: "constant.language.escape", regex: "``" },
-            { token: "string", regex: "`", next: "start" },
-            { defaultToken: "string" }
+        "string" : [
+            {token : "constant.language.escape",   regex : "``"},
+            {token : "string", regex : "`",     next  : "start"},
+            {defaultToken : "string"}
         ]
     };
 };
 oop.inherits(AbapHighlightRules, TextHighlightRules);
-exports.AbapHighlightRules = AbapHighlightRules;
 
+exports.AbapHighlightRules = AbapHighlightRules;
 });
 
-ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var BaseFoldMode = require("./fold_mode").FoldMode;
 var Range = require("../../range").Range;
-var FoldMode = exports.FoldMode = function () { };
+
+var FoldMode = exports.FoldMode = function() {};
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.getFoldWidgetRange = function (session, foldStyle, row) {
+
+(function() {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row) {
         var range = this.indentationBlock(session, row);
         if (range)
             return range;
+
         var re = /\S/;
         var line = session.getLine(row);
         var startLevel = line.search(re);
         if (startLevel == -1 || line[startLevel] != "#")
             return;
+
         var startColumn = line.length;
         var maxRow = session.getLength();
         var startRow = row;
         var endRow = row;
+
         while (++row < maxRow) {
             line = session.getLine(row);
             var level = line.search(re);
+
             if (level == -1)
                 continue;
+
             if (line[level] != "#")
                 break;
+
             endRow = row;
         }
+
         if (endRow > startRow) {
             var endColumn = session.getLine(endRow).length;
             return new Range(startRow, startColumn, endRow, endColumn);
         }
     };
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
         var indent = line.search(/\S/);
         var next = session.getLine(row + 1);
         var prev = session.getLine(row - 1);
         var prevIndent = prev.search(/\S/);
         var nextIndent = next.search(/\S/);
+
         if (indent == -1) {
-            session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
+            session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
             return "";
         }
         if (prevIndent == -1) {
@@ -143,46 +158,57 @@ oop.inherits(FoldMode, BaseFoldMode);
                 session.foldWidgets[row + 1] = "";
                 return "start";
             }
-        }
-        else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
+        } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
             if (session.getLine(row - 2).search(/\S/) == -1) {
                 session.foldWidgets[row - 1] = "start";
                 session.foldWidgets[row + 1] = "";
                 return "";
             }
         }
-        if (prevIndent != -1 && prevIndent < indent)
+
+        if (prevIndent!= -1 && prevIndent < indent)
             session.foldWidgets[row - 1] = "start";
         else
             session.foldWidgets[row - 1] = "";
+
         if (indent < nextIndent)
             return "start";
         else
             return "";
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/abap",["require","exports","module","ace/mode/abap_highlight_rules","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/lib/oop"], function(require, exports, module){"use strict";
+ace.define("ace/mode/abap",["require","exports","module","ace/mode/abap_highlight_rules","ace/mode/folding/coffee","ace/range","ace/mode/text","ace/lib/oop"], function(require, exports, module) {
+"use strict";
+
 var Rules = require("./abap_highlight_rules").AbapHighlightRules;
 var FoldMode = require("./folding/coffee").FoldMode;
 var Range = require("../range").Range;
 var TextMode = require("./text").Mode;
 var oop = require("../lib/oop");
+
 function Mode() {
     this.HighlightRules = Rules;
     this.foldingRules = new FoldMode();
 }
+
 oop.inherits(Mode, TextMode);
-(function () {
+
+(function() {
+    
     this.lineCommentStart = '"';
-    this.getNextLineIndent = function (state, line, tab) {
+    
+    this.getNextLineIndent = function(state, line, tab) {
         var indent = this.$getIndent(line);
         return indent;
-    };
+    };    
+    
     this.$id = "ace/mode/abap";
 }).call(Mode.prototype);
+
 exports.Mode = Mode;
 
 });                (function() {

文件差异内容过多而无法显示
+ 0 - 0
web/1e0340d10d5cb579b144f73e631c7813.js


+ 279 - 0
web/1e33cb44dfab039b4a7e88a3ee1bbfe7.js

@@ -0,0 +1,279 @@
+ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
+"use strict";
+
+var Range = require("../range").Range;
+
+var MatchingBraceOutdent = function() {};
+
+(function() {
+
+    this.checkOutdent = function(line, input) {
+        if (! /^\s+$/.test(line))
+            return false;
+
+        return /^\s*\}/.test(input);
+    };
+
+    this.autoOutdent = function(doc, row) {
+        var line = doc.getLine(row);
+        var match = line.match(/^(\s*\})/);
+
+        if (!match) return 0;
+
+        var column = match[1].length;
+        var openBracePos = doc.findMatchingBracket({row: row, column: column});
+
+        if (!openBracePos || openBracePos.row == row) return 0;
+
+        var indent = this.$getIndent(doc.getLine(openBracePos.row));
+        doc.replace(new Range(row, 0, row, column-1), indent);
+    };
+
+    this.$getIndent = function(line) {
+        return line.match(/^\s*/)[0];
+    };
+
+}).call(MatchingBraceOutdent.prototype);
+
+exports.MatchingBraceOutdent = MatchingBraceOutdent;
+});
+
+ace.define("ace/mode/livescript",["require","exports","module","ace/tokenizer","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/text"], function(require, exports, module){
+  var identifier, LiveScriptMode, keywordend, stringfill;
+  identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*';
+  exports.Mode = LiveScriptMode = (function(superclass){
+    var indenter, prototype = extend$((import$(LiveScriptMode, superclass).displayName = 'LiveScriptMode', LiveScriptMode), superclass).prototype, constructor = LiveScriptMode;
+    function LiveScriptMode(){
+      var that;
+      this.$tokenizer = new (require('../tokenizer')).Tokenizer(LiveScriptMode.Rules);
+      if (that = require('../mode/matching_brace_outdent')) {
+        this.$outdent = new that.MatchingBraceOutdent;
+      }
+      this.$id = "ace/mode/livescript";
+      this.$behaviour = new (require("./behaviour/cstyle").CstyleBehaviour)();
+    }
+    indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$');
+    prototype.getNextLineIndent = function(state, line, tab){
+      var indent, tokens;
+      indent = this.$getIndent(line);
+      tokens = this.$tokenizer.getLineTokens(line, state).tokens;
+      if (!(tokens.length && tokens[tokens.length - 1].type === 'comment')) {
+        if (state === 'start' && indenter.test(line)) {
+          indent += tab;
+        }
+      }
+      return indent;
+    };
+    prototype.lineCommentStart = "#";
+    prototype.blockComment = {start: "###", end: "###"};
+    prototype.checkOutdent = function(state, line, input){
+      var ref$;
+      return (ref$ = this.$outdent) != null ? ref$.checkOutdent(line, input) : void 8;
+    };
+    prototype.autoOutdent = function(state, doc, row){
+      var ref$;
+      return (ref$ = this.$outdent) != null ? ref$.autoOutdent(doc, row) : void 8;
+    };
+    return LiveScriptMode;
+  }(require('../mode/text').Mode));
+  keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))';
+  stringfill = {
+    defaultToken: 'string'
+  };
+  LiveScriptMode.Rules = {
+    start: [
+      {
+        token: 'keyword',
+        regex: '(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)' + keywordend
+      }, {
+        token: 'constant.language',
+        regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend
+      }, {
+        token: 'invalid.illegal',
+        regex: '(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)' + keywordend
+      }, {
+        token: 'language.support.class',
+        regex: '(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)' + keywordend
+      }, {
+        token: 'language.support.function',
+        regex: '(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)' + keywordend
+      }, {
+        token: 'variable.language',
+        regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend
+      }, {
+        token: 'identifier',
+        regex: identifier + '\\s*:(?![:=])'
+      }, {
+        token: 'variable',
+        regex: identifier
+      }, {
+        token: 'keyword.operator',
+        regex: '(?:\\.{3}|\\s+\\?)'
+      }, {
+        token: 'keyword.variable',
+        regex: '(?:@+|::|\\.\\.)',
+        next: 'key'
+      }, {
+        token: 'keyword.operator',
+        regex: '\\.\\s*',
+        next: 'key'
+      }, {
+        token: 'string',
+        regex: '\\\\\\S[^\\s,;)}\\]]*'
+      }, {
+        token: 'string.doc',
+        regex: '\'\'\'',
+        next: 'qdoc'
+      }, {
+        token: 'string.doc',
+        regex: '"""',
+        next: 'qqdoc'
+      }, {
+        token: 'string',
+        regex: '\'',
+        next: 'qstring'
+      }, {
+        token: 'string',
+        regex: '"',
+        next: 'qqstring'
+      }, {
+        token: 'string',
+        regex: '`',
+        next: 'js'
+      }, {
+        token: 'string',
+        regex: '<\\[',
+        next: 'words'
+      }, {
+        token: 'string.regex',
+        regex: '//',
+        next: 'heregex'
+      }, {
+        token: 'comment.doc',
+        regex: '/\\*',
+        next: 'comment'
+      }, {
+        token: 'comment',
+        regex: '#.*'
+      }, {
+        token: 'string.regex',
+        regex: '\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}',
+        next: 'key'
+      }, {
+        token: 'constant.numeric',
+        regex: '(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)'
+      }, {
+        token: 'lparen',
+        regex: '[({[]'
+      }, {
+        token: 'rparen',
+        regex: '[)}\\]]',
+        next: 'key'
+      }, {
+        token: 'keyword.operator',
+        regex: '[\\^!|&%+\\-]+'
+      }, {
+        token: 'text',
+        regex: '\\s+'
+      }
+    ],
+    heregex: [
+      {
+        token: 'string.regex',
+        regex: '.*?//[gimy$?]{0,4}',
+        next: 'start'
+      }, {
+        token: 'string.regex',
+        regex: '\\s*#{'
+      }, {
+        token: 'comment.regex',
+        regex: '\\s+(?:#.*)?'
+      }, {
+        defaultToken: 'string.regex'
+      }
+    ],
+    key: [
+      {
+        token: 'keyword.operator',
+        regex: '[.?@!]+'
+      }, {
+        token: 'identifier',
+        regex: identifier,
+        next: 'start'
+      }, {
+        token: 'text',
+        regex: '',
+        next: 'start'
+      }
+    ],
+    comment: [
+      {
+        token: 'comment.doc',
+        regex: '.*?\\*/',
+        next: 'start'
+      }, {
+        defaultToken: 'comment.doc'
+      }
+    ],
+    qdoc: [
+      {
+        token: 'string',
+        regex: ".*?'''",
+        next: 'key'
+      }, stringfill
+    ],
+    qqdoc: [
+      {
+        token: 'string',
+        regex: '.*?"""',
+        next: 'key'
+      }, stringfill
+    ],
+    qstring: [
+      {
+        token: 'string',
+        regex: '[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'',
+        next: 'key'
+      }, stringfill
+    ],
+    qqstring: [
+      {
+        token: 'string',
+        regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
+        next: 'key'
+      }, stringfill
+    ],
+    js: [
+      {
+        token: 'string',
+        regex: '[^\\\\`]*(?:\\\\.[^\\\\`]*)*`',
+        next: 'key'
+      }, stringfill
+    ],
+    words: [
+      {
+        token: 'string',
+        regex: '.*?\\]>',
+        next: 'key'
+      }, stringfill
+    ]
+  };
+function extend$(sub, sup){
+  function fun(){} fun.prototype = (sub.superclass = sup).prototype;
+  (sub.prototype = new fun).constructor = sub;
+  if (typeof sup.extended == 'function') sup.extended(sub);
+  return sub;
+}
+function import$(obj, src){
+  var own = {}.hasOwnProperty;
+  for (var key in src) if (own.call(src, key)) obj[key] = src[key];
+  return obj;
+}
+});                (function() {
+                    ace.require(["ace/mode/livescript"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

文件差异内容过多而无法显示
+ 0 - 0
web/1ea9cb4eff3a4f4c27ff63263151eba2.js


+ 78 - 27
web/6cefda3bcdee592d400b012c61c93ef6.js → web/1f03c9a69a8b9f79bcb7a338963f80c8.js

@@ -1,18 +1,20 @@
-ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"], function(require, exports, module){"use strict";
-var ElasticTabstopsLite = function (editor) {
+ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"], function(require, exports, module) {
+"use strict";
+
+var ElasticTabstopsLite = function(editor) {
     this.$editor = editor;
     var self = this;
     var changedRows = [];
     var recordChanges = false;
-    this.onAfterExec = function () {
+    this.onAfterExec = function() {
         recordChanges = false;
         self.processRows(changedRows);
         changedRows = [];
     };
-    this.onExec = function () {
+    this.onExec = function() {
         recordChanges = true;
     };
-    this.onChange = function (delta) {
+    this.onChange = function(delta) {
         if (recordChanges) {
             if (changedRows.indexOf(delta.start.row) == -1)
                 changedRows.push(delta.start.row);
@@ -21,17 +23,22 @@ var ElasticTabstopsLite = function (editor) {
         }
     };
 };
-(function () {
-    this.processRows = function (rows) {
+
+(function() {
+    this.processRows = function(rows) {
         this.$inChange = true;
         var checkedRows = [];
+
         for (var r = 0, rowCount = rows.length; r < rowCount; r++) {
             var row = rows[r];
+
             if (checkedRows.indexOf(row) > -1)
                 continue;
+
             var cellWidthObj = this.$findCellWidthsForBlock(row);
             var cellWidths = this.$setBlockCellWidthsToMax(cellWidthObj.cellWidths);
             var rowIndex = cellWidthObj.firstRow;
+
             for (var w = 0, l = cellWidths.length; w < l; w++) {
                 var widths = cellWidths[w];
                 checkedRows.push(rowIndex);
@@ -41,53 +48,68 @@ var ElasticTabstopsLite = function (editor) {
         }
         this.$inChange = false;
     };
-    this.$findCellWidthsForBlock = function (row) {
+
+    this.$findCellWidthsForBlock = function(row) {
         var cellWidths = [], widths;
         var rowIter = row;
         while (rowIter >= 0) {
             widths = this.$cellWidthsForRow(rowIter);
             if (widths.length == 0)
                 break;
+
             cellWidths.unshift(widths);
             rowIter--;
         }
         var firstRow = rowIter + 1;
         rowIter = row;
         var numRows = this.$editor.session.getLength();
+
         while (rowIter < numRows - 1) {
             rowIter++;
+
             widths = this.$cellWidthsForRow(rowIter);
             if (widths.length == 0)
                 break;
+
             cellWidths.push(widths);
         }
+
         return { cellWidths: cellWidths, firstRow: firstRow };
     };
-    this.$cellWidthsForRow = function (row) {
+
+    this.$cellWidthsForRow = function(row) {
         var selectionColumns = this.$selectionColumnsForRow(row);
+
         var tabs = [-1].concat(this.$tabsForRow(row));
-        var widths = tabs.map(function (el) { return 0; }).slice(1);
+        var widths = tabs.map(function(el) { return 0; } ).slice(1);
         var line = this.$editor.session.getLine(row);
+
         for (var i = 0, len = tabs.length - 1; i < len; i++) {
-            var leftEdge = tabs[i] + 1;
-            var rightEdge = tabs[i + 1];
+            var leftEdge = tabs[i]+1;
+            var rightEdge = tabs[i+1];
+
             var rightmostSelection = this.$rightmostSelectionInCell(selectionColumns, rightEdge);
             var cell = line.substring(leftEdge, rightEdge);
-            widths[i] = Math.max(cell.replace(/\s+$/g, '').length, rightmostSelection - leftEdge);
+            widths[i] = Math.max(cell.replace(/\s+$/g,'').length, rightmostSelection - leftEdge);
         }
+
         return widths;
     };
-    this.$selectionColumnsForRow = function (row) {
+
+    this.$selectionColumnsForRow = function(row) {
         var selections = [], cursor = this.$editor.getCursorPosition();
         if (this.$editor.session.getSelection().isEmpty()) {
             if (row == cursor.row)
                 selections.push(cursor.column);
         }
+
         return selections;
     };
-    this.$setBlockCellWidthsToMax = function (cellWidths) {
+
+    this.$setBlockCellWidthsToMax = function(cellWidths) {
         var startingNewBlock = true, blockStartRow, blockEndRow, maxWidth;
         var columnInfo = this.$izip_longest(cellWidths);
+
         for (var c = 0, l = columnInfo.length; c < l; c++) {
             var column = columnInfo[c];
             if (!column.push) {
@@ -95,6 +117,7 @@ var ElasticTabstopsLite = function (editor) {
                 continue;
             }
             column.push(NaN);
+
             for (var r = 0, s = column.length; r < s; r++) {
                 var width = column[r];
                 if (startingNewBlock) {
@@ -104,18 +127,23 @@ var ElasticTabstopsLite = function (editor) {
                 }
                 if (isNaN(width)) {
                     blockEndRow = r;
+
                     for (var j = blockStartRow; j < blockEndRow; j++) {
                         cellWidths[j][c] = maxWidth;
                     }
                     startingNewBlock = true;
                 }
+
                 maxWidth = Math.max(maxWidth, width);
             }
         }
+
         return cellWidths;
     };
-    this.$rightmostSelectionInCell = function (selectionColumns, cellRightEdge) {
+
+    this.$rightmostSelectionInCell = function(selectionColumns, cellRightEdge) {
         var rightmost = 0;
+
         if (selectionColumns.length) {
             var lengths = [];
             for (var s = 0, length = selectionColumns.length; s < length; s++) {
@@ -126,53 +154,70 @@ var ElasticTabstopsLite = function (editor) {
             }
             rightmost = Math.max.apply(Math, lengths);
         }
+
         return rightmost;
     };
-    this.$tabsForRow = function (row) {
-        var rowTabs = [], line = this.$editor.session.getLine(row), re = /\t/g, match;
+
+    this.$tabsForRow = function(row) {
+        var rowTabs = [], line = this.$editor.session.getLine(row),
+            re = /\t/g, match;
+
         while ((match = re.exec(line)) != null) {
             rowTabs.push(match.index);
         }
+
         return rowTabs;
     };
-    this.$adjustRow = function (row, widths) {
+
+    this.$adjustRow = function(row, widths) {
         var rowTabs = this.$tabsForRow(row);
+
         if (rowTabs.length == 0)
             return;
+
         var bias = 0, location = -1;
         var expandedSet = this.$izip(widths, rowTabs);
+
         for (var i = 0, l = expandedSet.length; i < l; i++) {
             var w = expandedSet[i][0], it = expandedSet[i][1];
             location += 1 + w;
             it += bias;
             var difference = location - it;
+
             if (difference == 0)
                 continue;
-            var partialLine = this.$editor.session.getLine(row).substr(0, it);
+
+            var partialLine = this.$editor.session.getLine(row).substr(0, it );
             var strippedPartialLine = partialLine.replace(/\s*$/g, "");
             var ispaces = partialLine.length - strippedPartialLine.length;
+
             if (difference > 0) {
-                this.$editor.session.getDocument().insertInLine({ row: row, column: it + 1 }, Array(difference + 1).join(" ") + "\t");
+                this.$editor.session.getDocument().insertInLine({row: row, column: it + 1}, Array(difference + 1).join(" ") + "\t");
                 this.$editor.session.getDocument().removeInLine(row, it, it + 1);
+
                 bias += difference;
             }
+
             if (difference < 0 && ispaces >= -difference) {
                 this.$editor.session.getDocument().removeInLine(row, it + difference, it);
                 bias += difference;
             }
         }
     };
-    this.$izip_longest = function (iterables) {
+    this.$izip_longest = function(iterables) {
         if (!iterables[0])
             return [];
         var longest = iterables[0].length;
         var iterablesLength = iterables.length;
+
         for (var i = 1; i < iterablesLength; i++) {
             var iLength = iterables[i].length;
             if (iLength > longest)
                 longest = iLength;
         }
+
         var expandedSet = [];
+
         for (var l = 0; l < longest; l++) {
             var set = [];
             for (var i = 0; i < iterablesLength; i++) {
@@ -181,33 +226,39 @@ var ElasticTabstopsLite = function (editor) {
                 else
                     set.push(iterables[i][l]);
             }
+
             expandedSet.push(set);
         }
+
+
         return expandedSet;
     };
-    this.$izip = function (widths, tabs) {
+    this.$izip = function(widths, tabs) {
         var size = widths.length >= tabs.length ? tabs.length : widths.length;
+
         var expandedSet = [];
         for (var i = 0; i < size; i++) {
-            var set = [widths[i], tabs[i]];
+            var set = [ widths[i], tabs[i] ];
             expandedSet.push(set);
         }
         return expandedSet;
     };
+
 }).call(ElasticTabstopsLite.prototype);
+
 exports.ElasticTabstopsLite = ElasticTabstopsLite;
+
 var Editor = require("../editor").Editor;
 require("../config").defineOptions(Editor.prototype, "editor", {
     useElasticTabstops: {
-        set: function (val) {
+        set: function(val) {
             if (val) {
                 if (!this.elasticTabstops)
                     this.elasticTabstops = new ElasticTabstopsLite(this);
                 this.commands.on("afterExec", this.elasticTabstops.onAfterExec);
                 this.commands.on("exec", this.elasticTabstops.onExec);
                 this.on("change", this.elasticTabstops.onChange);
-            }
-            else if (this.elasticTabstops) {
+            } else if (this.elasticTabstops) {
                 this.commands.removeListener("afterExec", this.elasticTabstops.onAfterExec);
                 this.commands.removeListener("exec", this.elasticTabstops.onExec);
                 this.removeListener("change", this.elasticTabstops.onChange);

+ 0 - 836
web/1f33899bba9efc8a9dc527f39ce8fe9a.js

@@ -1,836 +0,0 @@
-ace.define("ace/mode/erlang_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from tm bundles\erlang.tmbundle\Syntaxes\Erlang.plist (uuid: ) */
-"use strict";
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var ErlangHighlightRules = function () {
-    this.$rules = { start: [{ include: '#module-directive' },
-            { include: '#import-export-directive' },
-            { include: '#behaviour-directive' },
-            { include: '#record-directive' },
-            { include: '#define-directive' },
-            { include: '#macro-directive' },
-            { include: '#directive' },
-            { include: '#function' },
-            { include: '#everything-else' }],
-        '#atom': [{ token: 'punctuation.definition.symbol.begin.erlang',
-                regex: '\'',
-                push: [{ token: 'punctuation.definition.symbol.end.erlang',
-                        regex: '\'',
-                        next: 'pop' },
-                    { token: ['punctuation.definition.escape.erlang',
-                            'constant.other.symbol.escape.erlang',
-                            'punctuation.definition.escape.erlang',
-                            'constant.other.symbol.escape.erlang',
-                            'constant.other.symbol.escape.erlang'],
-                        regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' },
-                    { token: 'invalid.illegal.atom.erlang', regex: '\\\\\\^?.?' },
-                    { defaultToken: 'constant.other.symbol.quoted.single.erlang' }] },
-            { token: 'constant.other.symbol.unquoted.erlang',
-                regex: '[a-z][a-zA-Z\\d@_]*' }],
-        '#behaviour-directive': [{ token: ['meta.directive.behaviour.erlang',
-                    'punctuation.section.directive.begin.erlang',
-                    'meta.directive.behaviour.erlang',
-                    'keyword.control.directive.behaviour.erlang',
-                    'meta.directive.behaviour.erlang',
-                    'punctuation.definition.parameters.begin.erlang',
-                    'meta.directive.behaviour.erlang',
-                    'entity.name.type.class.behaviour.definition.erlang',
-                    'meta.directive.behaviour.erlang',
-                    'punctuation.definition.parameters.end.erlang',
-                    'meta.directive.behaviour.erlang',
-                    'punctuation.section.directive.end.erlang'],
-                regex: '^(\\s*)(-)(\\s*)(behaviour)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\))(\\s*)(\\.)' }],
-        '#binary': [{ token: 'punctuation.definition.binary.begin.erlang',
-                regex: '<<',
-                push: [{ token: 'punctuation.definition.binary.end.erlang',
-                        regex: '>>',
-                        next: 'pop' },
-                    { token: ['punctuation.separator.binary.erlang',
-                            'punctuation.separator.value-size.erlang'],
-                        regex: '(,)|(:)' },
-                    { include: '#internal-type-specifiers' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.structure.binary.erlang' }] }],
-        '#character': [{ token: ['punctuation.definition.character.erlang',
-                    'punctuation.definition.escape.erlang',
-                    'constant.character.escape.erlang',
-                    'punctuation.definition.escape.erlang',
-                    'constant.character.escape.erlang',
-                    'constant.character.escape.erlang'],
-                regex: '(\\$)(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' },
-            { token: 'invalid.illegal.character.erlang',
-                regex: '\\$\\\\\\^?.?' },
-            { token: ['punctuation.definition.character.erlang',
-                    'constant.character.erlang'],
-                regex: '(\\$)(\\S)' },
-            { token: 'invalid.illegal.character.erlang', regex: '\\$.?' }],
-        '#comment': [{ token: 'punctuation.definition.comment.erlang',
-                regex: '%.*$',
-                push_: [{ token: 'comment.line.percentage.erlang',
-                        regex: '$',
-                        next: 'pop' },
-                    { defaultToken: 'comment.line.percentage.erlang' }] }],
-        '#define-directive': [{ token: ['meta.directive.define.erlang',
-                    'punctuation.section.directive.begin.erlang',
-                    'meta.directive.define.erlang',
-                    'keyword.control.directive.define.erlang',
-                    'meta.directive.define.erlang',
-                    'punctuation.definition.parameters.begin.erlang',
-                    'meta.directive.define.erlang',
-                    'entity.name.function.macro.definition.erlang',
-                    'meta.directive.define.erlang',
-                    'punctuation.separator.parameters.erlang'],
-                regex: '^(\\s*)(-)(\\s*)(define)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(,)',
-                push: [{ token: ['punctuation.definition.parameters.end.erlang',
-                            'meta.directive.define.erlang',
-                            'punctuation.section.directive.end.erlang'],
-                        regex: '(\\))(\\s*)(\\.)',
-                        next: 'pop' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.directive.define.erlang' }] },
-            { token: 'meta.directive.define.erlang',
-                regex: '(?=^\\s*-\\s*define\\s*\\(\\s*[a-zA-Z\\d@_]+\\s*\\()',
-                push: [{ token: ['punctuation.definition.parameters.end.erlang',
-                            'meta.directive.define.erlang',
-                            'punctuation.section.directive.end.erlang'],
-                        regex: '(\\))(\\s*)(\\.)',
-                        next: 'pop' },
-                    { token: ['text',
-                            'punctuation.section.directive.begin.erlang',
-                            'text',
-                            'keyword.control.directive.define.erlang',
-                            'text',
-                            'punctuation.definition.parameters.begin.erlang',
-                            'text',
-                            'entity.name.function.macro.definition.erlang',
-                            'text',
-                            'punctuation.definition.parameters.begin.erlang'],
-                        regex: '^(\\s*)(-)(\\s*)(define)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\()',
-                        push: [{ token: ['punctuation.definition.parameters.end.erlang',
-                                    'text',
-                                    'punctuation.separator.parameters.erlang'],
-                                regex: '(\\))(\\s*)(,)',
-                                next: 'pop' },
-                            { token: 'punctuation.separator.parameters.erlang', regex: ',' },
-                            { include: '#everything-else' }] },
-                    { token: 'punctuation.separator.define.erlang',
-                        regex: '\\|\\||\\||:|;|,|\\.|->' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.directive.define.erlang' }] }],
-        '#directive': [{ token: ['meta.directive.erlang',
-                    'punctuation.section.directive.begin.erlang',
-                    'meta.directive.erlang',
-                    'keyword.control.directive.erlang',
-                    'meta.directive.erlang',
-                    'punctuation.definition.parameters.begin.erlang'],
-                regex: '^(\\s*)(-)(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\(?)',
-                push: [{ token: ['punctuation.definition.parameters.end.erlang',
-                            'meta.directive.erlang',
-                            'punctuation.section.directive.end.erlang'],
-                        regex: '(\\)?)(\\s*)(\\.)',
-                        next: 'pop' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.directive.erlang' }] },
-            { token: ['meta.directive.erlang',
-                    'punctuation.section.directive.begin.erlang',
-                    'meta.directive.erlang',
-                    'keyword.control.directive.erlang',
-                    'meta.directive.erlang',
-                    'punctuation.section.directive.end.erlang'],
-                regex: '^(\\s*)(-)(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\.)' }],
-        '#everything-else': [{ include: '#comment' },
-            { include: '#record-usage' },
-            { include: '#macro-usage' },
-            { include: '#expression' },
-            { include: '#keyword' },
-            { include: '#textual-operator' },
-            { include: '#function-call' },
-            { include: '#tuple' },
-            { include: '#list' },
-            { include: '#binary' },
-            { include: '#parenthesized-expression' },
-            { include: '#character' },
-            { include: '#number' },
-            { include: '#atom' },
-            { include: '#string' },
-            { include: '#symbolic-operator' },
-            { include: '#variable' }],
-        '#expression': [{ token: 'keyword.control.if.erlang',
-                regex: '\\bif\\b',
-                push: [{ token: 'keyword.control.end.erlang',
-                        regex: '\\bend\\b',
-                        next: 'pop' },
-                    { include: '#internal-expression-punctuation' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.expression.if.erlang' }] },
-            { token: 'keyword.control.case.erlang',
-                regex: '\\bcase\\b',
-                push: [{ token: 'keyword.control.end.erlang',
-                        regex: '\\bend\\b',
-                        next: 'pop' },
-                    { include: '#internal-expression-punctuation' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.expression.case.erlang' }] },
-            { token: 'keyword.control.receive.erlang',
-                regex: '\\breceive\\b',
-                push: [{ token: 'keyword.control.end.erlang',
-                        regex: '\\bend\\b',
-                        next: 'pop' },
-                    { include: '#internal-expression-punctuation' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.expression.receive.erlang' }] },
-            { token: ['keyword.control.fun.erlang',
-                    'text',
-                    'entity.name.type.class.module.erlang',
-                    'text',
-                    'punctuation.separator.module-function.erlang',
-                    'text',
-                    'entity.name.function.erlang',
-                    'text',
-                    'punctuation.separator.function-arity.erlang'],
-                regex: '\\b(fun)(\\s*)(?:([a-z][a-zA-Z\\d@_]*)(\\s*)(:)(\\s*))?([a-z][a-zA-Z\\d@_]*)(\\s*)(/)' },
-            { token: 'keyword.control.fun.erlang',
-                regex: '\\bfun\\b',
-                push: [{ token: 'keyword.control.end.erlang',
-                        regex: '\\bend\\b',
-                        next: 'pop' },
-                    { token: 'text',
-                        regex: '(?=\\()',
-                        push: [{ token: 'punctuation.separator.clauses.erlang',
-                                regex: ';|(?=\\bend\\b)',
-                                next: 'pop' },
-                            { include: '#internal-function-parts' }] },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.expression.fun.erlang' }] },
-            { token: 'keyword.control.try.erlang',
-                regex: '\\btry\\b',
-                push: [{ token: 'keyword.control.end.erlang',
-                        regex: '\\bend\\b',
-                        next: 'pop' },
-                    { include: '#internal-expression-punctuation' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.expression.try.erlang' }] },
-            { token: 'keyword.control.begin.erlang',
-                regex: '\\bbegin\\b',
-                push: [{ token: 'keyword.control.end.erlang',
-                        regex: '\\bend\\b',
-                        next: 'pop' },
-                    { include: '#internal-expression-punctuation' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.expression.begin.erlang' }] },
-            { token: 'keyword.control.query.erlang',
-                regex: '\\bquery\\b',
-                push: [{ token: 'keyword.control.end.erlang',
-                        regex: '\\bend\\b',
-                        next: 'pop' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.expression.query.erlang' }] }],
-        '#function': [{ token: ['meta.function.erlang',
-                    'entity.name.function.definition.erlang',
-                    'meta.function.erlang'],
-                regex: '^(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(?=\\()',
-                push: [{ token: 'punctuation.terminator.function.erlang',
-                        regex: '\\.',
-                        next: 'pop' },
-                    { token: ['text', 'entity.name.function.erlang', 'text'],
-                        regex: '^(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(?=\\()' },
-                    { token: 'text',
-                        regex: '(?=\\()',
-                        push: [{ token: 'punctuation.separator.clauses.erlang',
-                                regex: ';|(?=\\.)',
-                                next: 'pop' },
-                            { include: '#parenthesized-expression' },
-                            { include: '#internal-function-parts' }] },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.function.erlang' }] }],
-        '#function-call': [{ token: 'meta.function-call.erlang',
-                regex: '(?=(?:[a-z][a-zA-Z\\d@_]*|\'[^\']*\')\\s*(?:\\(|:\\s*(?:[a-z][a-zA-Z\\d@_]*|\'[^\']*\')\\s*\\())',
-                push: [{ token: 'punctuation.definition.parameters.end.erlang',
-                        regex: '\\)',
-                        next: 'pop' },
-                    { token: ['entity.name.type.class.module.erlang',
-                            'text',
-                            'punctuation.separator.module-function.erlang',
-                            'text',
-                            'entity.name.function.guard.erlang',
-                            'text',
-                            'punctuation.definition.parameters.begin.erlang'],
-                        regex: '(?:(erlang)(\\s*)(:)(\\s*))?(is_atom|is_binary|is_constant|is_float|is_function|is_integer|is_list|is_number|is_pid|is_port|is_reference|is_tuple|is_record|abs|element|hd|length|node|round|self|size|tl|trunc)(\\s*)(\\()',
-                        push: [{ token: 'text', regex: '(?=\\))', next: 'pop' },
-                            { token: 'punctuation.separator.parameters.erlang', regex: ',' },
-                            { include: '#everything-else' }] },
-                    { token: ['entity.name.type.class.module.erlang',
-                            'text',
-                            'punctuation.separator.module-function.erlang',
-                            'text',
-                            'entity.name.function.erlang',
-                            'text',
-                            'punctuation.definition.parameters.begin.erlang'],
-                        regex: '(?:([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(:)(\\s*))?([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(\\()',
-                        push: [{ token: 'text', regex: '(?=\\))', next: 'pop' },
-                            { token: 'punctuation.separator.parameters.erlang', regex: ',' },
-                            { include: '#everything-else' }] },
-                    { defaultToken: 'meta.function-call.erlang' }] }],
-        '#import-export-directive': [{ token: ['meta.directive.import.erlang',
-                    'punctuation.section.directive.begin.erlang',
-                    'meta.directive.import.erlang',
-                    'keyword.control.directive.import.erlang',
-                    'meta.directive.import.erlang',
-                    'punctuation.definition.parameters.begin.erlang',
-                    'meta.directive.import.erlang',
-                    'entity.name.type.class.module.erlang',
-                    'meta.directive.import.erlang',
-                    'punctuation.separator.parameters.erlang'],
-                regex: '^(\\s*)(-)(\\s*)(import)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(,)',
-                push: [{ token: ['punctuation.definition.parameters.end.erlang',
-                            'meta.directive.import.erlang',
-                            'punctuation.section.directive.end.erlang'],
-                        regex: '(\\))(\\s*)(\\.)',
-                        next: 'pop' },
-                    { include: '#internal-function-list' },
-                    { defaultToken: 'meta.directive.import.erlang' }] },
-            { token: ['meta.directive.export.erlang',
-                    'punctuation.section.directive.begin.erlang',
-                    'meta.directive.export.erlang',
-                    'keyword.control.directive.export.erlang',
-                    'meta.directive.export.erlang',
-                    'punctuation.definition.parameters.begin.erlang'],
-                regex: '^(\\s*)(-)(\\s*)(export)(\\s*)(\\()',
-                push: [{ token: ['punctuation.definition.parameters.end.erlang',
-                            'meta.directive.export.erlang',
-                            'punctuation.section.directive.end.erlang'],
-                        regex: '(\\))(\\s*)(\\.)',
-                        next: 'pop' },
-                    { include: '#internal-function-list' },
-                    { defaultToken: 'meta.directive.export.erlang' }] }],
-        '#internal-expression-punctuation': [{ token: ['punctuation.separator.clause-head-body.erlang',
-                    'punctuation.separator.clauses.erlang',
-                    'punctuation.separator.expressions.erlang'],
-                regex: '(->)|(;)|(,)' }],
-        '#internal-function-list': [{ token: 'punctuation.definition.list.begin.erlang',
-                regex: '\\[',
-                push: [{ token: 'punctuation.definition.list.end.erlang',
-                        regex: '\\]',
-                        next: 'pop' },
-                    { token: ['entity.name.function.erlang',
-                            'text',
-                            'punctuation.separator.function-arity.erlang'],
-                        regex: '([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(/)',
-                        push: [{ token: 'punctuation.separator.list.erlang',
-                                regex: ',|(?=\\])',
-                                next: 'pop' },
-                            { include: '#everything-else' }] },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.structure.list.function.erlang' }] }],
-        '#internal-function-parts': [{ token: 'text',
-                regex: '(?=\\()',
-                push: [{ token: 'punctuation.separator.clause-head-body.erlang',
-                        regex: '->',
-                        next: 'pop' },
-                    { token: 'punctuation.definition.parameters.begin.erlang',
-                        regex: '\\(',
-                        push: [{ token: 'punctuation.definition.parameters.end.erlang',
-                                regex: '\\)',
-                                next: 'pop' },
-                            { token: 'punctuation.separator.parameters.erlang', regex: ',' },
-                            { include: '#everything-else' }] },
-                    { token: 'punctuation.separator.guards.erlang', regex: ',|;' },
-                    { include: '#everything-else' }] },
-            { token: 'punctuation.separator.expressions.erlang',
-                regex: ',' },
-            { include: '#everything-else' }],
-        '#internal-record-body': [{ token: 'punctuation.definition.class.record.begin.erlang',
-                regex: '\\{',
-                push: [{ token: 'meta.structure.record.erlang',
-                        regex: '(?=\\})',
-                        next: 'pop' },
-                    { token: ['variable.other.field.erlang',
-                            'variable.language.omitted.field.erlang',
-                            'text',
-                            'keyword.operator.assignment.erlang'],
-                        regex: '(?:([a-z][a-zA-Z\\d@_]*|\'[^\']*\')|(_))(\\s*)(=|::)',
-                        push: [{ token: 'punctuation.separator.class.record.erlang',
-                                regex: ',|(?=\\})',
-                                next: 'pop' },
-                            { include: '#everything-else' }] },
-                    { token: ['variable.other.field.erlang',
-                            'text',
-                            'punctuation.separator.class.record.erlang'],
-                        regex: '([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)((?:,)?)' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.structure.record.erlang' }] }],
-        '#internal-type-specifiers': [{ token: 'punctuation.separator.value-type.erlang',
-                regex: '/',
-                push: [{ token: 'text', regex: '(?=,|:|>>)', next: 'pop' },
-                    { token: ['storage.type.erlang',
-                            'storage.modifier.signedness.erlang',
-                            'storage.modifier.endianness.erlang',
-                            'storage.modifier.unit.erlang',
-                            'punctuation.separator.type-specifiers.erlang'],
-                        regex: '(integer|float|binary|bytes|bitstring|bits)|(signed|unsigned)|(big|little|native)|(unit)|(-)' }] }],
-        '#keyword': [{ token: 'keyword.control.erlang',
-                regex: '\\b(?:after|begin|case|catch|cond|end|fun|if|let|of|query|try|receive|when)\\b' }],
-        '#list': [{ token: 'punctuation.definition.list.begin.erlang',
-                regex: '\\[',
-                push: [{ token: 'punctuation.definition.list.end.erlang',
-                        regex: '\\]',
-                        next: 'pop' },
-                    { token: 'punctuation.separator.list.erlang',
-                        regex: '\\||\\|\\||,' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.structure.list.erlang' }] }],
-        '#macro-directive': [{ token: ['meta.directive.ifdef.erlang',
-                    'punctuation.section.directive.begin.erlang',
-                    'meta.directive.ifdef.erlang',
-                    'keyword.control.directive.ifdef.erlang',
-                    'meta.directive.ifdef.erlang',
-                    'punctuation.definition.parameters.begin.erlang',
-                    'meta.directive.ifdef.erlang',
-                    'entity.name.function.macro.erlang',
-                    'meta.directive.ifdef.erlang',
-                    'punctuation.definition.parameters.end.erlang',
-                    'meta.directive.ifdef.erlang',
-                    'punctuation.section.directive.end.erlang'],
-                regex: '^(\\s*)(-)(\\s*)(ifdef)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' },
-            { token: ['meta.directive.ifndef.erlang',
-                    'punctuation.section.directive.begin.erlang',
-                    'meta.directive.ifndef.erlang',
-                    'keyword.control.directive.ifndef.erlang',
-                    'meta.directive.ifndef.erlang',
-                    'punctuation.definition.parameters.begin.erlang',
-                    'meta.directive.ifndef.erlang',
-                    'entity.name.function.macro.erlang',
-                    'meta.directive.ifndef.erlang',
-                    'punctuation.definition.parameters.end.erlang',
-                    'meta.directive.ifndef.erlang',
-                    'punctuation.section.directive.end.erlang'],
-                regex: '^(\\s*)(-)(\\s*)(ifndef)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' },
-            { token: ['meta.directive.undef.erlang',
-                    'punctuation.section.directive.begin.erlang',
-                    'meta.directive.undef.erlang',
-                    'keyword.control.directive.undef.erlang',
-                    'meta.directive.undef.erlang',
-                    'punctuation.definition.parameters.begin.erlang',
-                    'meta.directive.undef.erlang',
-                    'entity.name.function.macro.erlang',
-                    'meta.directive.undef.erlang',
-                    'punctuation.definition.parameters.end.erlang',
-                    'meta.directive.undef.erlang',
-                    'punctuation.section.directive.end.erlang'],
-                regex: '^(\\s*)(-)(\\s*)(undef)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' }],
-        '#macro-usage': [{ token: ['keyword.operator.macro.erlang',
-                    'meta.macro-usage.erlang',
-                    'entity.name.function.macro.erlang'],
-                regex: '(\\?\\??)(\\s*)([a-zA-Z\\d@_]+)' }],
-        '#module-directive': [{ token: ['meta.directive.module.erlang',
-                    'punctuation.section.directive.begin.erlang',
-                    'meta.directive.module.erlang',
-                    'keyword.control.directive.module.erlang',
-                    'meta.directive.module.erlang',
-                    'punctuation.definition.parameters.begin.erlang',
-                    'meta.directive.module.erlang',
-                    'entity.name.type.class.module.definition.erlang',
-                    'meta.directive.module.erlang',
-                    'punctuation.definition.parameters.end.erlang',
-                    'meta.directive.module.erlang',
-                    'punctuation.section.directive.end.erlang'],
-                regex: '^(\\s*)(-)(\\s*)(module)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\))(\\s*)(\\.)' }],
-        '#number': [{ token: 'text',
-                regex: '(?=\\d)',
-                push: [{ token: 'text', regex: '(?!\\d)', next: 'pop' },
-                    { token: ['constant.numeric.float.erlang',
-                            'punctuation.separator.integer-float.erlang',
-                            'constant.numeric.float.erlang',
-                            'punctuation.separator.float-exponent.erlang'],
-                        regex: '(\\d+)(\\.)(\\d+)((?:[eE][\\+\\-]?\\d+)?)' },
-                    { token: ['constant.numeric.integer.binary.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.binary.erlang'],
-                        regex: '(2)(#)([0-1]+)' },
-                    { token: ['constant.numeric.integer.base-3.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-3.erlang'],
-                        regex: '(3)(#)([0-2]+)' },
-                    { token: ['constant.numeric.integer.base-4.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-4.erlang'],
-                        regex: '(4)(#)([0-3]+)' },
-                    { token: ['constant.numeric.integer.base-5.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-5.erlang'],
-                        regex: '(5)(#)([0-4]+)' },
-                    { token: ['constant.numeric.integer.base-6.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-6.erlang'],
-                        regex: '(6)(#)([0-5]+)' },
-                    { token: ['constant.numeric.integer.base-7.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-7.erlang'],
-                        regex: '(7)(#)([0-6]+)' },
-                    { token: ['constant.numeric.integer.octal.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.octal.erlang'],
-                        regex: '(8)(#)([0-7]+)' },
-                    { token: ['constant.numeric.integer.base-9.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-9.erlang'],
-                        regex: '(9)(#)([0-8]+)' },
-                    { token: ['constant.numeric.integer.decimal.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.decimal.erlang'],
-                        regex: '(10)(#)(\\d+)' },
-                    { token: ['constant.numeric.integer.base-11.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-11.erlang'],
-                        regex: '(11)(#)([\\daA]+)' },
-                    { token: ['constant.numeric.integer.base-12.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-12.erlang'],
-                        regex: '(12)(#)([\\da-bA-B]+)' },
-                    { token: ['constant.numeric.integer.base-13.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-13.erlang'],
-                        regex: '(13)(#)([\\da-cA-C]+)' },
-                    { token: ['constant.numeric.integer.base-14.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-14.erlang'],
-                        regex: '(14)(#)([\\da-dA-D]+)' },
-                    { token: ['constant.numeric.integer.base-15.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-15.erlang'],
-                        regex: '(15)(#)([\\da-eA-E]+)' },
-                    { token: ['constant.numeric.integer.hexadecimal.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.hexadecimal.erlang'],
-                        regex: '(16)(#)([\\da-fA-F]+)' },
-                    { token: ['constant.numeric.integer.base-17.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-17.erlang'],
-                        regex: '(17)(#)([\\da-gA-G]+)' },
-                    { token: ['constant.numeric.integer.base-18.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-18.erlang'],
-                        regex: '(18)(#)([\\da-hA-H]+)' },
-                    { token: ['constant.numeric.integer.base-19.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-19.erlang'],
-                        regex: '(19)(#)([\\da-iA-I]+)' },
-                    { token: ['constant.numeric.integer.base-20.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-20.erlang'],
-                        regex: '(20)(#)([\\da-jA-J]+)' },
-                    { token: ['constant.numeric.integer.base-21.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-21.erlang'],
-                        regex: '(21)(#)([\\da-kA-K]+)' },
-                    { token: ['constant.numeric.integer.base-22.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-22.erlang'],
-                        regex: '(22)(#)([\\da-lA-L]+)' },
-                    { token: ['constant.numeric.integer.base-23.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-23.erlang'],
-                        regex: '(23)(#)([\\da-mA-M]+)' },
-                    { token: ['constant.numeric.integer.base-24.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-24.erlang'],
-                        regex: '(24)(#)([\\da-nA-N]+)' },
-                    { token: ['constant.numeric.integer.base-25.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-25.erlang'],
-                        regex: '(25)(#)([\\da-oA-O]+)' },
-                    { token: ['constant.numeric.integer.base-26.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-26.erlang'],
-                        regex: '(26)(#)([\\da-pA-P]+)' },
-                    { token: ['constant.numeric.integer.base-27.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-27.erlang'],
-                        regex: '(27)(#)([\\da-qA-Q]+)' },
-                    { token: ['constant.numeric.integer.base-28.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-28.erlang'],
-                        regex: '(28)(#)([\\da-rA-R]+)' },
-                    { token: ['constant.numeric.integer.base-29.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-29.erlang'],
-                        regex: '(29)(#)([\\da-sA-S]+)' },
-                    { token: ['constant.numeric.integer.base-30.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-30.erlang'],
-                        regex: '(30)(#)([\\da-tA-T]+)' },
-                    { token: ['constant.numeric.integer.base-31.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-31.erlang'],
-                        regex: '(31)(#)([\\da-uA-U]+)' },
-                    { token: ['constant.numeric.integer.base-32.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-32.erlang'],
-                        regex: '(32)(#)([\\da-vA-V]+)' },
-                    { token: ['constant.numeric.integer.base-33.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-33.erlang'],
-                        regex: '(33)(#)([\\da-wA-W]+)' },
-                    { token: ['constant.numeric.integer.base-34.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-34.erlang'],
-                        regex: '(34)(#)([\\da-xA-X]+)' },
-                    { token: ['constant.numeric.integer.base-35.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-35.erlang'],
-                        regex: '(35)(#)([\\da-yA-Y]+)' },
-                    { token: ['constant.numeric.integer.base-36.erlang',
-                            'punctuation.separator.base-integer.erlang',
-                            'constant.numeric.integer.base-36.erlang'],
-                        regex: '(36)(#)([\\da-zA-Z]+)' },
-                    { token: 'invalid.illegal.integer.erlang',
-                        regex: '\\d+#[\\da-zA-Z]+' },
-                    { token: 'constant.numeric.integer.decimal.erlang',
-                        regex: '\\d+' }] }],
-        '#parenthesized-expression': [{ token: 'punctuation.section.expression.begin.erlang',
-                regex: '\\(',
-                push: [{ token: 'punctuation.section.expression.end.erlang',
-                        regex: '\\)',
-                        next: 'pop' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.expression.parenthesized' }] }],
-        '#record-directive': [{ token: ['meta.directive.record.erlang',
-                    'punctuation.section.directive.begin.erlang',
-                    'meta.directive.record.erlang',
-                    'keyword.control.directive.import.erlang',
-                    'meta.directive.record.erlang',
-                    'punctuation.definition.parameters.begin.erlang',
-                    'meta.directive.record.erlang',
-                    'entity.name.type.class.record.definition.erlang',
-                    'meta.directive.record.erlang',
-                    'punctuation.separator.parameters.erlang'],
-                regex: '^(\\s*)(-)(\\s*)(record)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(,)',
-                push: [{ token: ['punctuation.definition.class.record.end.erlang',
-                            'meta.directive.record.erlang',
-                            'punctuation.definition.parameters.end.erlang',
-                            'meta.directive.record.erlang',
-                            'punctuation.section.directive.end.erlang'],
-                        regex: '(\\})(\\s*)(\\))(\\s*)(\\.)',
-                        next: 'pop' },
-                    { include: '#internal-record-body' },
-                    { defaultToken: 'meta.directive.record.erlang' }] }],
-        '#record-usage': [{ token: ['keyword.operator.record.erlang',
-                    'meta.record-usage.erlang',
-                    'entity.name.type.class.record.erlang',
-                    'meta.record-usage.erlang',
-                    'punctuation.separator.record-field.erlang',
-                    'meta.record-usage.erlang',
-                    'variable.other.field.erlang'],
-                regex: '(#)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(\\.)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')' },
-            { token: ['keyword.operator.record.erlang',
-                    'meta.record-usage.erlang',
-                    'entity.name.type.class.record.erlang'],
-                regex: '(#)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')',
-                push: [{ token: 'punctuation.definition.class.record.end.erlang',
-                        regex: '\\}',
-                        next: 'pop' },
-                    { include: '#internal-record-body' },
-                    { defaultToken: 'meta.record-usage.erlang' }] }],
-        '#string': [{ token: 'punctuation.definition.string.begin.erlang',
-                regex: '"',
-                push: [{ token: 'punctuation.definition.string.end.erlang',
-                        regex: '"',
-                        next: 'pop' },
-                    { token: ['punctuation.definition.escape.erlang',
-                            'constant.character.escape.erlang',
-                            'punctuation.definition.escape.erlang',
-                            'constant.character.escape.erlang',
-                            'constant.character.escape.erlang'],
-                        regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' },
-                    { token: 'invalid.illegal.string.erlang', regex: '\\\\\\^?.?' },
-                    { token: ['punctuation.definition.placeholder.erlang',
-                            'punctuation.separator.placeholder-parts.erlang',
-                            'constant.other.placeholder.erlang',
-                            'punctuation.separator.placeholder-parts.erlang',
-                            'punctuation.separator.placeholder-parts.erlang',
-                            'constant.other.placeholder.erlang',
-                            'punctuation.separator.placeholder-parts.erlang',
-                            'punctuation.separator.placeholder-parts.erlang',
-                            'punctuation.separator.placeholder-parts.erlang',
-                            'constant.other.placeholder.erlang',
-                            'constant.other.placeholder.erlang'],
-                        regex: '(~)(?:((?:\\-)?)(\\d+)|(\\*))?(?:(\\.)(?:(\\d+)|(\\*)))?(?:(\\.)(?:(\\*)|(.)))?([~cfegswpWPBX#bx\\+ni])' },
-                    { token: ['punctuation.definition.placeholder.erlang',
-                            'punctuation.separator.placeholder-parts.erlang',
-                            'constant.other.placeholder.erlang',
-                            'constant.other.placeholder.erlang'],
-                        regex: '(~)((?:\\*)?)((?:\\d+)?)([~du\\-#fsacl])' },
-                    { token: 'invalid.illegal.string.erlang', regex: '~.?' },
-                    { defaultToken: 'string.quoted.double.erlang' }] }],
-        '#symbolic-operator': [{ token: 'keyword.operator.symbolic.erlang',
-                regex: '\\+\\+|\\+|--|-|\\*|/=|/|=/=|=:=|==|=<|=|<-|<|>=|>|!|::' }],
-        '#textual-operator': [{ token: 'keyword.operator.textual.erlang',
-                regex: '\\b(?:andalso|band|and|bxor|xor|bor|orelse|or|bnot|not|bsl|bsr|div|rem)\\b' }],
-        '#tuple': [{ token: 'punctuation.definition.tuple.begin.erlang',
-                regex: '\\{',
-                push: [{ token: 'punctuation.definition.tuple.end.erlang',
-                        regex: '\\}',
-                        next: 'pop' },
-                    { token: 'punctuation.separator.tuple.erlang', regex: ',' },
-                    { include: '#everything-else' },
-                    { defaultToken: 'meta.structure.tuple.erlang' }] }],
-        '#variable': [{ token: ['variable.other.erlang', 'variable.language.omitted.erlang'],
-                regex: '(_[a-zA-Z\\d@_]+|[A-Z][a-zA-Z\\d@_]*)|(_)' }] };
-    this.normalizeRules();
-};
-ErlangHighlightRules.metaData = { comment: 'The recognition of function definitions and compiler directives (such as module, record and macro definitions) requires that each of the aforementioned constructs must be the first string inside a line (except for whitespace).  Also, the function/module/record/macro names must be given unquoted.  -- desp',
-    fileTypes: ['erl', 'hrl'],
-    keyEquivalent: '^~E',
-    name: 'Erlang',
-    scopeName: 'source.erlang' };
-oop.inherits(ErlangHighlightRules, TextHighlightRules);
-exports.ErlangHighlightRules = ErlangHighlightRules;
-
-});
-
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
-    if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
-    }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
-    this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
-    this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
-    this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
-    this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
-        var line = session.getLine(row);
-        if (this.singleLineBlockCommentRe.test(line)) {
-            if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
-                return "";
-        }
-        var fw = this._getFoldWidgetBase(session, foldStyle, row);
-        if (!fw && this.startRegionRe.test(line))
-            return "start"; // lineCommentRegionStart
-        return fw;
-    };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
-        var line = session.getLine(row);
-        if (this.startRegionRe.test(line))
-            return this.getCommentRegionBlock(session, line, row);
-        var match = line.match(this.foldingStartMarker);
-        if (match) {
-            var i = match.index;
-            if (match[1])
-                return this.openingBracketBlock(session, match[1], row, i);
-            var range = session.getCommentFoldRange(row, i + match[0].length, 1);
-            if (range && !range.isMultiLine()) {
-                if (forceMultiline) {
-                    range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
-                    range = null;
-            }
-            return range;
-        }
-        if (foldStyle === "markbegin")
-            return;
-        var match = line.match(this.foldingStopMarker);
-        if (match) {
-            var i = match.index + match[0].length;
-            if (match[1])
-                return this.closingBracketBlock(session, match[1], row, i);
-            return session.getCommentFoldRange(row, i, -1);
-        }
-    };
-    this.getSectionRange = function (session, row) {
-        var line = session.getLine(row);
-        var startIndent = line.search(/\S/);
-        var startRow = row;
-        var startColumn = line.length;
-        row = row + 1;
-        var endRow = row;
-        var maxRow = session.getLength();
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var indent = line.search(/\S/);
-            if (indent === -1)
-                continue;
-            if (startIndent > indent)
-                break;
-            var subRange = this.getFoldWidgetRange(session, "all", row);
-            if (subRange) {
-                if (subRange.start.row <= startRow) {
-                    break;
-                }
-                else if (subRange.isMultiLine()) {
-                    row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
-                    break;
-                }
-            }
-            endRow = row;
-        }
-        return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
-    };
-    this.getCommentRegionBlock = function (session, line, row) {
-        var startColumn = line.search(/\s*$/);
-        var maxRow = session.getLength();
-        var startRow = row;
-        var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
-        var depth = 1;
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
-        }
-        var endRow = row;
-        if (endRow > startRow) {
-            return new Range(startRow, startColumn, endRow, line.length);
-        }
-    };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/erlang",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/erlang_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
-*/
-"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var ErlangHighlightRules = require("./erlang_highlight_rules").ErlangHighlightRules;
-var FoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
-    this.HighlightRules = ErlangHighlightRules;
-    this.foldingRules = new FoldMode();
-    this.$behaviour = this.$defaultBehaviour;
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.lineCommentStart = "%";
-    this.blockComment = null;
-    this.$id = "ace/mode/erlang";
-    this.snippetFileId = "ace/snippets/erlang";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});                (function() {
-                    ace.require(["ace/mode/erlang"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 0 - 70
web/1facfcf9af0b5a679a66dc7f26080afe.js

@@ -1,70 +0,0 @@
-ace.define("ace/ext/themelist",["require","exports","module"], function(require, exports, module){/**
- * Generates a list of themes available when ace was built.
- * @fileOverview Generates a list of themes available when ace was built.
- * @author <a href="mailto:matthewkastor@gmail.com">
- *  Matthew Christopher Kastor-Inare III </a><br />
- *  ☭ Hial Atropa!! ☭
- */
-"use strict";
-var themeData = [
-    ["Chrome"],
-    ["Clouds"],
-    ["Crimson Editor"],
-    ["Dawn"],
-    ["Dreamweaver"],
-    ["Eclipse"],
-    ["GitHub"],
-    ["IPlastic"],
-    ["Solarized Light"],
-    ["TextMate"],
-    ["Tomorrow"],
-    ["XCode"],
-    ["Kuroir"],
-    ["KatzenMilch"],
-    ["SQL Server", "sqlserver", "light"],
-    ["Ambiance", "ambiance", "dark"],
-    ["Chaos", "chaos", "dark"],
-    ["Clouds Midnight", "clouds_midnight", "dark"],
-    ["Dracula", "", "dark"],
-    ["Cobalt", "cobalt", "dark"],
-    ["Gruvbox", "gruvbox", "dark"],
-    ["Green on Black", "gob", "dark"],
-    ["idle Fingers", "idle_fingers", "dark"],
-    ["krTheme", "kr_theme", "dark"],
-    ["Merbivore", "merbivore", "dark"],
-    ["Merbivore Soft", "merbivore_soft", "dark"],
-    ["Mono Industrial", "mono_industrial", "dark"],
-    ["Monokai", "monokai", "dark"],
-    ["Nord Dark", "nord_dark", "dark"],
-    ["One Dark", "one_dark", "dark"],
-    ["Pastel on dark", "pastel_on_dark", "dark"],
-    ["Solarized Dark", "solarized_dark", "dark"],
-    ["Terminal", "terminal", "dark"],
-    ["Tomorrow Night", "tomorrow_night", "dark"],
-    ["Tomorrow Night Blue", "tomorrow_night_blue", "dark"],
-    ["Tomorrow Night Bright", "tomorrow_night_bright", "dark"],
-    ["Tomorrow Night 80s", "tomorrow_night_eighties", "dark"],
-    ["Twilight", "twilight", "dark"],
-    ["Vibrant Ink", "vibrant_ink", "dark"]
-];
-exports.themesByName = {};
-exports.themes = themeData.map(function (data) {
-    var name = data[1] || data[0].replace(/ /g, "_").toLowerCase();
-    var theme = {
-        caption: data[0],
-        theme: "ace/theme/" + name,
-        isDark: data[2] == "dark",
-        name: name
-    };
-    exports.themesByName[name] = theme;
-    return theme;
-});
-
-});                (function() {
-                    ace.require(["ace/ext/themelist"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 0 - 9
web/1fd353d022bf5027ba193d0b0b9995ed.js

@@ -1,9 +0,0 @@
-
-;                (function() {
-                    ace.require(["ace/snippets/ion"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

文件差异内容过多而无法显示
+ 167 - 0
web/20642f73792092d3c71a4f1f4290430b.js


+ 1 - 1
web/22ddca0f2cac653ae8eebd716e965aa7.js → web/21fab653998af15bced8d4890e41bebc.js

@@ -1,6 +1,6 @@
 
 ;                (function() {
-                    ace.require(["ace/snippets/latte"], function(m) {
+                    ace.require(["ace/snippets/perl6"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {
                             module.exports = m;
                         }

+ 113 - 0
web/2208705283adad817bb4a5af647f77ab.js

@@ -0,0 +1,113 @@
+ace.define("ace/theme/tomorrow_night_blue",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-tomorrow-night-blue";
+exports.cssText = ".ace-tomorrow-night-blue .ace_gutter {\
+background: #00204b;\
+color: #7388b5\
+}\
+.ace-tomorrow-night-blue .ace_print-margin {\
+width: 1px;\
+background: #00204b\
+}\
+.ace-tomorrow-night-blue {\
+background-color: #002451;\
+color: #FFFFFF\
+}\
+.ace-tomorrow-night-blue .ace_constant.ace_other,\
+.ace-tomorrow-night-blue .ace_cursor {\
+color: #FFFFFF\
+}\
+.ace-tomorrow-night-blue .ace_marker-layer .ace_selection {\
+background: #003F8E\
+}\
+.ace-tomorrow-night-blue.ace_multiselect .ace_selection.ace_start {\
+box-shadow: 0 0 3px 0px #002451;\
+}\
+.ace-tomorrow-night-blue .ace_marker-layer .ace_step {\
+background: rgb(127, 111, 19)\
+}\
+.ace-tomorrow-night-blue .ace_marker-layer .ace_bracket {\
+margin: -1px 0 0 -1px;\
+border: 1px solid #404F7D\
+}\
+.ace-tomorrow-night-blue .ace_marker-layer .ace_active-line {\
+background: #00346E\
+}\
+.ace-tomorrow-night-blue .ace_gutter-active-line {\
+background-color: #022040\
+}\
+.ace-tomorrow-night-blue .ace_marker-layer .ace_selected-word {\
+border: 1px solid #003F8E\
+}\
+.ace-tomorrow-night-blue .ace_invisible {\
+color: #404F7D\
+}\
+.ace-tomorrow-night-blue .ace_keyword,\
+.ace-tomorrow-night-blue .ace_meta,\
+.ace-tomorrow-night-blue .ace_storage,\
+.ace-tomorrow-night-blue .ace_storage.ace_type,\
+.ace-tomorrow-night-blue .ace_support.ace_type {\
+color: #EBBBFF\
+}\
+.ace-tomorrow-night-blue .ace_keyword.ace_operator {\
+color: #99FFFF\
+}\
+.ace-tomorrow-night-blue .ace_constant.ace_character,\
+.ace-tomorrow-night-blue .ace_constant.ace_language,\
+.ace-tomorrow-night-blue .ace_constant.ace_numeric,\
+.ace-tomorrow-night-blue .ace_keyword.ace_other.ace_unit,\
+.ace-tomorrow-night-blue .ace_support.ace_constant,\
+.ace-tomorrow-night-blue .ace_variable.ace_parameter {\
+color: #FFC58F\
+}\
+.ace-tomorrow-night-blue .ace_invalid {\
+color: #FFFFFF;\
+background-color: #F99DA5\
+}\
+.ace-tomorrow-night-blue .ace_invalid.ace_deprecated {\
+color: #FFFFFF;\
+background-color: #EBBBFF\
+}\
+.ace-tomorrow-night-blue .ace_fold {\
+background-color: #BBDAFF;\
+border-color: #FFFFFF\
+}\
+.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function,\
+.ace-tomorrow-night-blue .ace_support.ace_function,\
+.ace-tomorrow-night-blue .ace_variable {\
+color: #BBDAFF\
+}\
+.ace-tomorrow-night-blue .ace_support.ace_class,\
+.ace-tomorrow-night-blue .ace_support.ace_type {\
+color: #FFEEAD\
+}\
+.ace-tomorrow-night-blue .ace_heading,\
+.ace-tomorrow-night-blue .ace_markup.ace_heading,\
+.ace-tomorrow-night-blue .ace_string {\
+color: #D1F1A9\
+}\
+.ace-tomorrow-night-blue .ace_entity.ace_name.ace_tag,\
+.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name,\
+.ace-tomorrow-night-blue .ace_meta.ace_tag,\
+.ace-tomorrow-night-blue .ace_string.ace_regexp,\
+.ace-tomorrow-night-blue .ace_variable {\
+color: #FF9DA4\
+}\
+.ace-tomorrow-night-blue .ace_comment {\
+color: #7285B7\
+}\
+.ace-tomorrow-night-blue .ace_indent-guide {\
+background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYJDzqfwPAANXAeNsiA+ZAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});                (function() {
+                    ace.require(["ace/theme/tomorrow_night_blue"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 0 - 428
web/2218ddba12711e7e7f6aea96015bafa2.js

@@ -1,428 +0,0 @@
-ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var reservedKeywords = exports.reservedKeywords = ('!|{|}|case|do|done|elif|else|' +
-    'esac|fi|for|if|in|then|until|while|' +
-    '&|;|export|local|read|typeset|unset|' +
-    'elif|select|set|function|declare|readonly');
-var languageConstructs = exports.languageConstructs = ('[|]|alias|bg|bind|break|builtin|' +
-    'cd|command|compgen|complete|continue|' +
-    'dirs|disown|echo|enable|eval|exec|' +
-    'exit|fc|fg|getopts|hash|help|history|' +
-    'jobs|kill|let|logout|popd|printf|pushd|' +
-    'pwd|return|set|shift|shopt|source|' +
-    'suspend|test|times|trap|type|ulimit|' +
-    'umask|unalias|wait');
-var ShHighlightRules = function () {
-    var keywordMapper = this.createKeywordMapper({
-        "keyword": reservedKeywords,
-        "support.function.builtin": languageConstructs,
-        "invalid.deprecated": "debugger"
-    }, "identifier");
-    var integer = "(?:(?:[1-9]\\d*)|(?:0))";
-    var fraction = "(?:\\.\\d+)";
-    var intPart = "(?:\\d+)";
-    var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
-    var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")";
-    var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
-    var fileDescriptor = "(?:&" + intPart + ")";
-    var variableName = "[a-zA-Z_][a-zA-Z0-9_]*";
-    var variable = "(?:" + variableName + "(?==))";
-    var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
-    var func = "(?:" + variableName + "\\s*\\(\\))";
-    this.$rules = {
-        "start": [{
-                token: "constant",
-                regex: /\\./
-            }, {
-                token: ["text", "comment"],
-                regex: /(^|\s)(#.*)$/
-            }, {
-                token: "string.start",
-                regex: '"',
-                push: [{
-                        token: "constant.language.escape",
-                        regex: /\\(?:[$`"\\]|$)/
-                    }, {
-                        include: "variables"
-                    }, {
-                        token: "keyword.operator",
-                        regex: /`/ // TODO highlight `
-                    }, {
-                        token: "string.end",
-                        regex: '"',
-                        next: "pop"
-                    }, {
-                        defaultToken: "string"
-                    }]
-            }, {
-                token: "string",
-                regex: "\\$'",
-                push: [{
-                        token: "constant.language.escape",
-                        regex: /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/
-                    }, {
-                        token: "string",
-                        regex: "'",
-                        next: "pop"
-                    }, {
-                        defaultToken: "string"
-                    }]
-            }, {
-                regex: "<<<",
-                token: "keyword.operator"
-            }, {
-                stateName: "heredoc",
-                regex: "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",
-                onMatch: function (value, currentState, stack) {
-                    var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
-                    var tokens = value.split(this.splitRegex);
-                    stack.push(next, tokens[4]);
-                    return [
-                        { type: "constant", value: tokens[1] },
-                        { type: "text", value: tokens[2] },
-                        { type: "string", value: tokens[3] },
-                        { type: "support.class", value: tokens[4] },
-                        { type: "string", value: tokens[5] }
-                    ];
-                },
-                rules: {
-                    heredoc: [{
-                            onMatch: function (value, currentState, stack) {
-                                if (value === stack[1]) {
-                                    stack.shift();
-                                    stack.shift();
-                                    this.next = stack[0] || "start";
-                                    return "support.class";
-                                }
-                                this.next = "";
-                                return "string";
-                            },
-                            regex: ".*$",
-                            next: "start"
-                        }],
-                    indentedHeredoc: [{
-                            token: "string",
-                            regex: "^\t+"
-                        }, {
-                            onMatch: function (value, currentState, stack) {
-                                if (value === stack[1]) {
-                                    stack.shift();
-                                    stack.shift();
-                                    this.next = stack[0] || "start";
-                                    return "support.class";
-                                }
-                                this.next = "";
-                                return "string";
-                            },
-                            regex: ".*$",
-                            next: "start"
-                        }]
-                }
-            }, {
-                regex: "$",
-                token: "empty",
-                next: function (currentState, stack) {
-                    if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
-                        return stack[0];
-                    return currentState;
-                }
-            }, {
-                token: ["keyword", "text", "text", "text", "variable"],
-                regex: /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/
-            }, {
-                token: "variable.language",
-                regex: builtinVariable
-            }, {
-                token: "variable",
-                regex: variable
-            }, {
-                include: "variables"
-            }, {
-                token: "support.function",
-                regex: func
-            }, {
-                token: "support.function",
-                regex: fileDescriptor
-            }, {
-                token: "string",
-                start: "'", end: "'"
-            }, {
-                token: "constant.numeric",
-                regex: floatNumber
-            }, {
-                token: "constant.numeric",
-                regex: integer + "\\b"
-            }, {
-                token: keywordMapper,
-                regex: "[a-zA-Z_][a-zA-Z0-9_]*\\b"
-            }, {
-                token: "keyword.operator",
-                regex: "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"
-            }, {
-                token: "punctuation.operator",
-                regex: ";"
-            }, {
-                token: "paren.lparen",
-                regex: "[\\[\\(\\{]"
-            }, {
-                token: "paren.rparen",
-                regex: "[\\]]"
-            }, {
-                token: "paren.rparen",
-                regex: "[\\)\\}]",
-                next: "pop"
-            }],
-        variables: [{
-                token: "variable",
-                regex: /(\$)(\w+)/
-            }, {
-                token: ["variable", "paren.lparen"],
-                regex: /(\$)(\()/,
-                push: "start"
-            }, {
-                token: ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"],
-                regex: /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,
-                push: "start"
-            }, {
-                token: "variable",
-                regex: /\$[*@#?\-$!0_]/
-            }, {
-                token: ["variable", "paren.lparen"],
-                regex: /(\$)(\{)/,
-                push: "start"
-            }]
-    };
-    this.normalizeRules();
-};
-oop.inherits(ShHighlightRules, TextHighlightRules);
-exports.ShHighlightRules = ShHighlightRules;
-
-});
-
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
-    if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
-    }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
-    this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
-    this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
-    this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
-    this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
-        var line = session.getLine(row);
-        if (this.singleLineBlockCommentRe.test(line)) {
-            if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
-                return "";
-        }
-        var fw = this._getFoldWidgetBase(session, foldStyle, row);
-        if (!fw && this.startRegionRe.test(line))
-            return "start"; // lineCommentRegionStart
-        return fw;
-    };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
-        var line = session.getLine(row);
-        if (this.startRegionRe.test(line))
-            return this.getCommentRegionBlock(session, line, row);
-        var match = line.match(this.foldingStartMarker);
-        if (match) {
-            var i = match.index;
-            if (match[1])
-                return this.openingBracketBlock(session, match[1], row, i);
-            var range = session.getCommentFoldRange(row, i + match[0].length, 1);
-            if (range && !range.isMultiLine()) {
-                if (forceMultiline) {
-                    range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
-                    range = null;
-            }
-            return range;
-        }
-        if (foldStyle === "markbegin")
-            return;
-        var match = line.match(this.foldingStopMarker);
-        if (match) {
-            var i = match.index + match[0].length;
-            if (match[1])
-                return this.closingBracketBlock(session, match[1], row, i);
-            return session.getCommentFoldRange(row, i, -1);
-        }
-    };
-    this.getSectionRange = function (session, row) {
-        var line = session.getLine(row);
-        var startIndent = line.search(/\S/);
-        var startRow = row;
-        var startColumn = line.length;
-        row = row + 1;
-        var endRow = row;
-        var maxRow = session.getLength();
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var indent = line.search(/\S/);
-            if (indent === -1)
-                continue;
-            if (startIndent > indent)
-                break;
-            var subRange = this.getFoldWidgetRange(session, "all", row);
-            if (subRange) {
-                if (subRange.start.row <= startRow) {
-                    break;
-                }
-                else if (subRange.isMultiLine()) {
-                    row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
-                    break;
-                }
-            }
-            endRow = row;
-        }
-        return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
-    };
-    this.getCommentRegionBlock = function (session, line, row) {
-        var startColumn = line.search(/\s*$/);
-        var maxRow = session.getLength();
-        var startRow = row;
-        var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
-        var depth = 1;
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
-        }
-        var endRow = row;
-        if (endRow > startRow) {
-            return new Range(startRow, startColumn, endRow, line.length);
-        }
-    };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
-var Range = require("../range").Range;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var Mode = function () {
-    this.HighlightRules = ShHighlightRules;
-    this.foldingRules = new CStyleFoldMode();
-    this.$behaviour = new CstyleBehaviour();
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.lineCommentStart = "#";
-    this.getNextLineIndent = function (state, line, tab) {
-        var indent = this.$getIndent(line);
-        var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
-        var tokens = tokenizedLine.tokens;
-        if (tokens.length && tokens[tokens.length - 1].type == "comment") {
-            return indent;
-        }
-        if (state == "start") {
-            var match = line.match(/^.*[\{\(\[:]\s*$/);
-            if (match) {
-                indent += tab;
-            }
-        }
-        return indent;
-    };
-    var outdents = {
-        "pass": 1,
-        "return": 1,
-        "raise": 1,
-        "break": 1,
-        "continue": 1
-    };
-    this.checkOutdent = function (state, line, input) {
-        if (input !== "\r\n" && input !== "\r" && input !== "\n")
-            return false;
-        var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
-        if (!tokens)
-            return false;
-        do {
-            var last = tokens.pop();
-        } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
-        if (!last)
-            return false;
-        return (last.type == "keyword" && outdents[last.value]);
-    };
-    this.autoOutdent = function (state, doc, row) {
-        row += 1;
-        var indent = this.$getIndent(doc.getLine(row));
-        var tab = doc.getTabString();
-        if (indent.slice(-tab.length) == tab)
-            doc.remove(new Range(row, indent.length - tab.length, row, indent.length));
-    };
-    this.$id = "ace/mode/sh";
-    this.snippetFileId = "ace/snippets/sh";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});
-
-ace.define("ace/mode/dockerfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/sh_highlight_rules"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
-var DockerfileHighlightRules = function () {
-    ShHighlightRules.call(this);
-    var startRules = this.$rules.start;
-    for (var i = 0; i < startRules.length; i++) {
-        if (startRules[i].token == "variable.language") {
-            startRules.splice(i, 0, {
-                token: "constant.language",
-                regex: "(?:^(?:FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD|COPY|LABEL)\\b)",
-                caseInsensitive: true
-            });
-            break;
-        }
-    }
-};
-oop.inherits(DockerfileHighlightRules, ShHighlightRules);
-exports.DockerfileHighlightRules = DockerfileHighlightRules;
-
-});
-
-ace.define("ace/mode/dockerfile",["require","exports","module","ace/lib/oop","ace/mode/sh","ace/mode/dockerfile_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var ShMode = require("./sh").Mode;
-var DockerfileHighlightRules = require("./dockerfile_highlight_rules").DockerfileHighlightRules;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
-    ShMode.call(this);
-    this.HighlightRules = DockerfileHighlightRules;
-    this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, ShMode);
-(function () {
-    this.$id = "ace/mode/dockerfile";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});                (function() {
-                    ace.require(["ace/mode/dockerfile"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 105 - 74
web/2836e58974a8e2730a9b6bec1921dd3d.js → web/223593fe8dd78b83f22808f9aad86ae9.js

@@ -1,116 +1,146 @@
-ace.define("ace/mode/batchfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from C:\Users\LED\AppData\Roaming\Sublime Text 2\Packages\Batch File\Batch File.tmLanguage (uuid: ) */
+ace.define("ace/mode/batchfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var BatchFileHighlightRules = function () {
-    this.$rules = { start: [{ token: 'keyword.command.dosbatch',
-                regex: '\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b',
-                caseInsensitive: true },
-            { token: 'keyword.control.statement.dosbatch',
-                regex: '\\b(?:goto|call|exit)\\b',
-                caseInsensitive: true },
-            { token: 'keyword.control.conditional.if.dosbatch',
-                regex: '\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b',
-                caseInsensitive: true },
-            { token: 'keyword.control.conditional.dosbatch',
-                regex: '\\b(?:if|else)\\b',
-                caseInsensitive: true },
-            { token: 'keyword.control.repeat.dosbatch',
-                regex: '\\bfor\\b',
-                caseInsensitive: true },
-            { token: 'keyword.operator.dosbatch',
-                regex: '\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b' },
-            { token: ['doc.comment', 'comment'],
-                regex: '(?:^|\\b)(rem)($|\\s.*$)',
-                caseInsensitive: true },
-            { token: 'comment.line.colons.dosbatch',
-                regex: '::.*$' },
-            { include: 'variable' },
-            { token: 'punctuation.definition.string.begin.shell',
-                regex: '"',
-                push: [
-                    { token: 'punctuation.definition.string.end.shell', regex: '"', next: 'pop' },
-                    { include: 'variable' },
-                    { defaultToken: 'string.quoted.double.dosbatch' }
-                ] },
-            { token: 'keyword.operator.pipe.dosbatch', regex: '[|]' },
-            { token: 'keyword.operator.redirect.shell',
-                regex: '&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>' }],
+
+var BatchFileHighlightRules = function() {
+
+    this.$rules = { start: 
+       [ { token: 'keyword.command.dosbatch',
+           regex: '\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b',
+           caseInsensitive: true },
+         { token: 'keyword.control.statement.dosbatch',
+           regex: '\\b(?:goto|call|exit)\\b',
+           caseInsensitive: true },
+         { token: 'keyword.control.conditional.if.dosbatch',
+           regex: '\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b',
+           caseInsensitive: true },
+         { token: 'keyword.control.conditional.dosbatch',
+           regex: '\\b(?:if|else)\\b',
+           caseInsensitive: true },
+         { token: 'keyword.control.repeat.dosbatch',
+           regex: '\\bfor\\b',
+           caseInsensitive: true },
+         { token: 'keyword.operator.dosbatch',
+           regex: '\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b' },
+         { token: ['doc.comment', 'comment'],
+           regex: '(?:^|\\b)(rem)($|\\s.*$)',
+           caseInsensitive: true },
+         { token: 'comment.line.colons.dosbatch',
+           regex: '::.*$' },
+         { include: 'variable' },
+         { token: 'punctuation.definition.string.begin.shell',
+           regex: '"',
+           push: [ 
+              { token: 'punctuation.definition.string.end.shell', regex: '"', next: 'pop' },
+              { include: 'variable' },
+              { defaultToken: 'string.quoted.double.dosbatch' } ] },
+         { token: 'keyword.operator.pipe.dosbatch', regex: '[|]' },
+         { token: 'keyword.operator.redirect.shell',
+           regex: '&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>' } ],
         variable: [
-            { token: 'constant.numeric', regex: '%%\\w+|%[*\\d]|%\\w+%' },
-            { token: 'constant.numeric', regex: '%~\\d+' },
-            { token: ['markup.list', 'constant.other', 'markup.list'],
-                regex: '(%)(\\w+)(%?)' }
-        ] };
+         { token: 'constant.numeric', regex: '%%\\w+|%[*\\d]|%\\w+%'},
+         { token: 'constant.numeric', regex: '%~\\d+'},
+         { token: ['markup.list', 'constant.other', 'markup.list'],
+            regex: '(%)(\\w+)(%?)' }]};
+    
     this.normalizeRules();
 };
+
 BatchFileHighlightRules.metaData = { name: 'Batch File',
-    scopeName: 'source.dosbatch',
-    fileTypes: ['bat'] };
+      scopeName: 'source.dosbatch',
+      fileTypes: [ 'bat' ] };
+
+
 oop.inherits(BatchFileHighlightRules, TextHighlightRules);
-exports.BatchFileHighlightRules = BatchFileHighlightRules;
 
+exports.BatchFileHighlightRules = BatchFileHighlightRules;
 });
 
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var Range = require("../../range").Range;
 var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
     if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
     }
 };
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
+
+(function() {
+    
     this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
     this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
     this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
     this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
     this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
+    
         if (this.singleLineBlockCommentRe.test(line)) {
             if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
                 return "";
         }
+    
         var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
         if (!fw && this.startRegionRe.test(line))
             return "start"; // lineCommentRegionStart
+    
         return fw;
     };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
         var line = session.getLine(row);
+        
         if (this.startRegionRe.test(line))
             return this.getCommentRegionBlock(session, line, row);
+        
         var match = line.match(this.foldingStartMarker);
         if (match) {
             var i = match.index;
+
             if (match[1])
                 return this.openingBracketBlock(session, match[1], row, i);
+                
             var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
             if (range && !range.isMultiLine()) {
                 if (forceMultiline) {
                     range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
+                } else if (foldStyle != "all")
                     range = null;
             }
+            
             return range;
         }
+
         if (foldStyle === "markbegin")
             return;
+
         var match = line.match(this.foldingStopMarker);
         if (match) {
             var i = match.index + match[0].length;
+
             if (match[1])
                 return this.closingBracketBlock(session, match[1], row, i);
+
             return session.getCommentFoldRange(row, i, -1);
         }
     };
-    this.getSectionRange = function (session, row) {
+    
+    this.getSectionRange = function(session, row) {
         var line = session.getLine(row);
         var startIndent = line.search(/\S/);
         var startRow = row;
@@ -123,72 +153,73 @@ oop.inherits(FoldMode, BaseFoldMode);
             var indent = line.search(/\S/);
             if (indent === -1)
                 continue;
-            if (startIndent > indent)
+            if  (startIndent > indent)
                 break;
             var subRange = this.getFoldWidgetRange(session, "all", row);
+            
             if (subRange) {
                 if (subRange.start.row <= startRow) {
                     break;
-                }
-                else if (subRange.isMultiLine()) {
+                } else if (subRange.isMultiLine()) {
                     row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
+                } else if (startIndent == indent) {
                     break;
                 }
             }
             endRow = row;
         }
+        
         return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
     };
-    this.getCommentRegionBlock = function (session, line, row) {
+    this.getCommentRegionBlock = function(session, line, row) {
         var startColumn = line.search(/\s*$/);
         var maxRow = session.getLength();
         var startRow = row;
+        
         var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
         var depth = 1;
         while (++row < maxRow) {
             line = session.getLine(row);
             var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
         }
+
         var endRow = row;
         if (endRow > startRow) {
             return new Range(startRow, startColumn, endRow, line.length);
         }
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/batchfile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/batchfile_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
-*/
+ace.define("ace/mode/batchfile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/batchfile_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var BatchFileHighlightRules = require("./batchfile_highlight_rules").BatchFileHighlightRules;
 var FoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
+
+var Mode = function() {
     this.HighlightRules = BatchFileHighlightRules;
     this.foldingRules = new FoldMode();
     this.$behaviour = this.$defaultBehaviour;
 };
 oop.inherits(Mode, TextMode);
-(function () {
+
+(function() {
     this.lineCommentStart = "::";
     this.blockComment = "";
     this.$id = "ace/mode/batchfile";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });                (function() {
                     ace.require(["ace/mode/batchfile"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 110 - 56
web/81246b2b17fe13310d0eb40a0a0f50ed.js → web/22812e27a1f54c0a4ff744a444a32d6c.js

@@ -2085,15 +2085,20 @@ exports.Lexer = function(Tokenizer, Rules) {
 
 });
 
-ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module){"use strict";
+ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var Behaviour = require("../behaviour").Behaviour;
 var TokenIterator = require("../../token_iterator").TokenIterator;
 var lang = require("../../lib/lang");
+
 function is(token, type) {
     return token && token.type.lastIndexOf(type + ".xml") > -1;
 }
+
 var XmlBehaviour = function () {
+
     this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
         if (text == '"' || text == "'") {
             var quote = text;
@@ -2104,21 +2109,26 @@ var XmlBehaviour = function () {
                     selection: false
                 };
             }
+
             var cursor = editor.getCursorPosition();
             var line = session.doc.getLine(cursor.row);
             var rightChar = line.substring(cursor.column, cursor.column + 1);
             var iterator = new TokenIterator(session, cursor.row, cursor.column);
             var token = iterator.getCurrentToken();
+
             if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
                 return {
                     text: "",
                     selection: [1, 1]
                 };
             }
+
             if (!token)
                 token = iterator.stepBackward();
+
             if (!token)
                 return;
+
             while (is(token, "tag-whitespace") || is(token, "whitespace")) {
                 token = iterator.stepBackward();
             }
@@ -2131,7 +2141,8 @@ var XmlBehaviour = function () {
             }
         }
     });
-    this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
+
+    this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
         var selected = session.doc.getTextRange(range);
         if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
             var line = session.doc.getLine(range.start.row);
@@ -2142,6 +2153,7 @@ var XmlBehaviour = function () {
             }
         }
     });
+
     this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
         if (text == '>') {
             var position = editor.getSelectionRange().start;
@@ -2162,6 +2174,7 @@ var XmlBehaviour = function () {
                     iterator.stepBackward();
                 }
             }
+            
             if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
                 return;
             while (!is(token, "tag-name")) {
@@ -2171,54 +2184,63 @@ var XmlBehaviour = function () {
                     break;
                 }
             }
+
             var tokenRow = iterator.getCurrentTokenRow();
             var tokenColumn = iterator.getCurrentTokenColumn();
             if (is(iterator.stepBackward(), "end-tag-open"))
                 return;
+
             var element = token.value;
             if (tokenRow == position.row)
                 element = element.substring(0, position.column - tokenColumn);
+
             if (this.voidElements.hasOwnProperty(element.toLowerCase()))
-                return;
+                 return;
+
             return {
-                text: ">" + "</" + element + ">",
-                selection: [1, 1]
+               text: ">" + "</" + element + ">",
+               selection: [1, 1]
             };
         }
     });
+
     this.add("autoindent", "insertion", function (state, action, editor, session, text) {
         if (text == "\n") {
             var cursor = editor.getCursorPosition();
             var line = session.getLine(cursor.row);
             var iterator = new TokenIterator(session, cursor.row, cursor.column);
             var token = iterator.getCurrentToken();
+
             if (token && token.type.indexOf("tag-close") !== -1) {
                 if (token.value == "/>")
                     return;
                 while (token && token.type.indexOf("tag-name") === -1) {
                     token = iterator.stepBackward();
                 }
+
                 if (!token) {
                     return;
                 }
+
                 var tag = token.value;
                 var row = iterator.getCurrentTokenRow();
                 token = iterator.stepBackward();
                 if (!token || token.type.indexOf("end-tag") !== -1) {
                     return;
                 }
+
                 if (this.voidElements && !this.voidElements[tag]) {
-                    var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
+                    var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
                     var line = session.getLine(row);
                     var nextIndent = this.$getIndent(line);
                     var indent = nextIndent + session.getTabString();
+
                     if (nextToken && nextToken.value === "</") {
                         return {
                             text: "\n" + indent + "\n" + nextIndent,
                             selection: [1, indent.length, 1, indent.length]
                         };
-                    }
-                    else {
+                    } else {
                         return {
                             text: "\n" + indent
                         };
@@ -2227,23 +2249,28 @@ var XmlBehaviour = function () {
             }
         }
     });
+
 };
+
 oop.inherits(XmlBehaviour, Behaviour);
-exports.XmlBehaviour = XmlBehaviour;
 
+exports.XmlBehaviour = XmlBehaviour;
 });
 
-ace.define("ace/mode/behaviour/xquery",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml","ace/token_iterator"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Behaviour = require('../behaviour').Behaviour;
-var CstyleBehaviour = require('./cstyle').CstyleBehaviour;
-var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
-var TokenIterator = require("../../token_iterator").TokenIterator;
+ace.define("ace/mode/behaviour/xquery",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/mode/behaviour/xml","ace/token_iterator"], function(require, exports, module) {
+"use strict";
+
+  var oop = require("../../lib/oop");
+  var Behaviour = require('../behaviour').Behaviour;
+  var CstyleBehaviour = require('./cstyle').CstyleBehaviour;
+  var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
+  var TokenIterator = require("../../token_iterator").TokenIterator;
+
 function hasType(token, type) {
     var hasType = true;
     var typeList = token.type.split('.');
     var needleList = type.split('.');
-    needleList.forEach(function (needle) {
+    needleList.forEach(function(needle){
         if (typeList.indexOf(needle) == -1) {
             hasType = false;
             return false;
@@ -2251,24 +2278,25 @@ function hasType(token, type) {
     });
     return hasType;
 }
-var XQueryBehaviour = function () {
-    this.inherit(CstyleBehaviour, ["braces", "parens", "string_dquotes"]); // Get string behaviour
-    this.inherit(XmlBehaviour); // Get xml behaviour
-    this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
+ 
+  var XQueryBehaviour = function () {
+      
+      this.inherit(CstyleBehaviour, ["braces", "parens", "string_dquotes"]); // Get string behaviour
+      this.inherit(XmlBehaviour); // Get xml behaviour
+      
+      this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
         if (text == '>') {
             var position = editor.getCursorPosition();
             var iterator = new TokenIterator(session, position.row, position.column);
             var token = iterator.getCurrentToken();
             var atCursor = false;
             var state = JSON.parse(state).pop();
-            if ((token && token.value === '>') || state !== "StartTag")
-                return;
-            if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))) {
+            if ((token && token.value === '>') || state !== "StartTag") return;
+            if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
                 do {
                     token = iterator.stepBackward();
                 } while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
-            }
-            else {
+            } else {
                 atCursor = true;
             }
             var previous = iterator.stepBackward();
@@ -2276,80 +2304,106 @@ var XQueryBehaviour = function () {
                 return;
             }
             var tag = token.value.substring(1);
-            if (atCursor) {
+            if (atCursor){
                 var tag = tag.substring(0, position.column - token.start);
             }
+
             return {
-                text: '>' + '</' + tag + '>',
-                selection: [1, 1]
+               text: '>' + '</' + tag + '>',
+               selection: [1, 1]
             };
         }
     });
-};
-oop.inherits(XQueryBehaviour, Behaviour);
-exports.XQueryBehaviour = XQueryBehaviour;
 
+  };
+  oop.inherits(XQueryBehaviour, Behaviour);
+
+  exports.XQueryBehaviour = XQueryBehaviour;
 });
 
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var Range = require("../../range").Range;
 var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
     if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
     }
 };
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
+
+(function() {
+    
     this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
     this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
     this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
     this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
     this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
+    
         if (this.singleLineBlockCommentRe.test(line)) {
             if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
                 return "";
         }
+    
         var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
         if (!fw && this.startRegionRe.test(line))
             return "start"; // lineCommentRegionStart
+    
         return fw;
     };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
         var line = session.getLine(row);
+        
         if (this.startRegionRe.test(line))
             return this.getCommentRegionBlock(session, line, row);
+        
         var match = line.match(this.foldingStartMarker);
         if (match) {
             var i = match.index;
+
             if (match[1])
                 return this.openingBracketBlock(session, match[1], row, i);
+                
             var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
             if (range && !range.isMultiLine()) {
                 if (forceMultiline) {
                     range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
+                } else if (foldStyle != "all")
                     range = null;
             }
+            
             return range;
         }
+
         if (foldStyle === "markbegin")
             return;
+
         var match = line.match(this.foldingStopMarker);
         if (match) {
             var i = match.index + match[0].length;
+
             if (match[1])
                 return this.closingBracketBlock(session, match[1], row, i);
+
             return session.getCommentFoldRange(row, i, -1);
         }
     };
-    this.getSectionRange = function (session, row) {
+    
+    this.getSectionRange = function(session, row) {
         var line = session.getLine(row);
         var startIndent = line.search(/\S/);
         var startRow = row;
@@ -2362,47 +2416,47 @@ oop.inherits(FoldMode, BaseFoldMode);
             var indent = line.search(/\S/);
             if (indent === -1)
                 continue;
-            if (startIndent > indent)
+            if  (startIndent > indent)
                 break;
             var subRange = this.getFoldWidgetRange(session, "all", row);
+            
             if (subRange) {
                 if (subRange.start.row <= startRow) {
                     break;
-                }
-                else if (subRange.isMultiLine()) {
+                } else if (subRange.isMultiLine()) {
                     row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
+                } else if (startIndent == indent) {
                     break;
                 }
             }
             endRow = row;
         }
+        
         return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
     };
-    this.getCommentRegionBlock = function (session, line, row) {
+    this.getCommentRegionBlock = function(session, line, row) {
         var startColumn = line.search(/\s*$/);
         var maxRow = session.getLength();
         var startRow = row;
+        
         var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
         var depth = 1;
         while (++row < maxRow) {
             line = session.getLine(row);
             var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
         }
+
         var endRow = row;
         if (endRow > startRow) {
             return new Range(startRow, startColumn, endRow, line.length);
         }
     };
+
 }).call(FoldMode.prototype);
 
 });

+ 310 - 0
web/22b1c8bf4c2bdd7e438f832b888c75e4.js

@@ -0,0 +1,310 @@
+ace.define("ace/mode/pig_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var PigHighlightRules = function() {
+
+    this.$rules = {
+        start: [{
+            token: "comment.block.pig",
+            regex: /\/\*/,
+            push: [{
+                token: "comment.block.pig",
+                regex: /\*\//,
+                next: "pop"
+            }, {
+                defaultToken: "comment.block.pig"
+            }]
+        }, {
+            token: "comment.line.double-dash.asciidoc",
+            regex: /--.*$/
+        }, {
+            token: "keyword.control.pig",
+            regex: /\b(?:ASSERT|LOAD|STORE|DUMP|FILTER|DISTINCT|FOREACH|GENERATE|STREAM|JOIN|COGROUP|GROUP|CROSS|ORDER|LIMIT|UNION|SPLIT|DESCRIBE|EXPLAIN|ILLUSTRATE|AS|BY|INTO|USING|LIMIT|PARALLEL|OUTER|INNER|DEFAULT|LEFT|SAMPLE|RANK|CUBE|ALL|KILL|QUIT|MAPREDUCE|ASC|DESC|THROUGH|SHIP|CACHE|DECLARE|CASE|WHEN|THEN|END|IN|PARTITION|FULL|IMPORT|IF|ONSCHEMA|INPUT|OUTPUT)\b/,
+            caseInsensitive: true
+        }, {
+            token: "storage.datatypes.pig",
+            regex: /\b(?:int|long|float|double|chararray|bytearray|boolean|datetime|biginteger|bigdecimal|tuple|bag|map)\b/,
+            caseInsensitive: true
+        }, {
+            token: "support.function.storage.pig",
+            regex: /\b(?:PigStorage|BinStorage|BinaryStorage|PigDump|HBaseStorage|JsonLoader|JsonStorage|AvroStorage|TextLoader|PigStreaming|TrevniStorage|AccumuloStorage)\b/
+        }, {
+            token: "support.function.udf.pig",
+            regex: /\b(?:DIFF|TOBAG|TOMAP|TOP|TOTUPLE|RANDOM|FLATTEN|flatten|CUBE|ROLLUP|IsEmpty|ARITY|PluckTuple|SUBTRACT|BagToString)\b/
+        }, {
+            token: "support.function.udf.math.pig",
+            regex: /\b(?:ABS|ACOS|ASIN|ATAN|CBRT|CEIL|COS|COSH|EXP|FLOOR|LOG|LOG10|ROUND|ROUND_TO|SIN|SINH|SQRT|TAN|TANH|AVG|COUNT|COUNT_STAR|MAX|MIN|SUM|COR|COV)\b/
+        }, {
+            token: "support.function.udf.string.pig",
+            regex: /\b(?:CONCAT|INDEXOF|LAST_INDEX_OF|LCFIRST|LOWER|REGEX_EXTRACT|REGEX_EXTRACT_ALL|REPLACE|SIZE|STRSPLIT|SUBSTRING|TOKENIZE|TRIM|UCFIRST|UPPER|LTRIM|RTRIM|ENDSWITH|STARTSWITH|TRIM)\b/
+        }, {
+            token: "support.function.udf.datetime.pig",
+            regex: /\b(?:AddDuration|CurrentTime|DaysBetween|GetDay|GetHour|GetMilliSecond|GetMinute|GetMonth|GetSecond|GetWeek|GetWeekYear|GetYear|HoursBetween|MilliSecondsBetween|MinutesBetween|MonthsBetween|SecondsBetween|SubtractDuration|ToDate|WeeksBetween|YearsBetween|ToMilliSeconds|ToString|ToUnixTime)\b/
+        }, {
+            token: "support.function.command.pig",
+            regex: /\b(?:cat|cd|copyFromLocal|copyToLocal|cp|ls|mkdir|mv|pwd|rm)\b/
+        }, {
+            token: "variable.pig",
+            regex: /\$[a_zA-Z0-9_]+/
+        }, {
+            token: "constant.language.pig",
+            regex: /\b(?:NULL|true|false|stdin|stdout|stderr)\b/,
+            caseInsensitive: true
+        }, {
+            token: "constant.numeric.pig",
+            regex: /\b\d+(?:\.\d+)?\b/
+        }, {
+            token: "keyword.operator.comparison.pig",
+            regex: /!=|==|<|>|<=|>=|\b(?:MATCHES|IS|OR|AND|NOT)\b/,
+            caseInsensitive: true
+        }, {
+            token: "keyword.operator.arithmetic.pig",
+            regex: /\+|\-|\*|\/|\%|\?|:|::|\.\.|#/
+        }, {
+            token: "string.quoted.double.pig",
+            regex: /"/,
+            push: [{
+                token: "string.quoted.double.pig",
+                regex: /"/,
+                next: "pop"
+            }, {
+                token: "constant.character.escape.pig",
+                regex: /\\./
+            }, {
+                defaultToken: "string.quoted.double.pig"
+            }]
+        }, {
+            token: "string.quoted.single.pig",
+            regex: /'/,
+            push: [{
+                token: "string.quoted.single.pig",
+                regex: /'/,
+                next: "pop"
+            }, {
+                token: "constant.character.escape.pig",
+                regex: /\\./
+            }, {
+                defaultToken: "string.quoted.single.pig"
+            }]
+        }, {
+            todo: {
+                token: [
+                    "text",
+                    "keyword.parameter.pig",
+                    "text",
+                    "storage.type.parameter.pig"
+                ],
+                regex: /^(\s*)(set)(\s+)(\S+)/,
+                caseInsensitive: true,
+                push: [{
+                    token: "text",
+                    regex: /$/,
+                    next: "pop"
+                }, {
+                    include: "$self"
+                }]
+            }
+        }, {
+            token: [
+                "text",
+                "keyword.alias.pig",
+                "text",
+                "storage.type.alias.pig"
+            ],
+            regex: /(\s*)(DEFINE|DECLARE|REGISTER)(\s+)(\S+)/,
+            caseInsensitive: true,
+            push: [{
+                token: "text",
+                regex: /;?$/,
+                next: "pop"
+            }]
+        }]
+    };
+    
+    this.normalizeRules();
+};
+
+PigHighlightRules.metaData = {
+    fileTypes: ["pig"],
+    name: "Pig",
+    scopeName: "source.pig"
+};
+
+
+oop.inherits(PigHighlightRules, TextHighlightRules);
+
+exports.PigHighlightRules = PigHighlightRules;
+});
+
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../../lib/oop");
+var Range = require("../../range").Range;
+var BaseFoldMode = require("./fold_mode").FoldMode;
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
+    if (commentRegex) {
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
+    }
+};
+oop.inherits(FoldMode, BaseFoldMode);
+
+(function() {
+    
+    this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
+    this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
+    this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
+    this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
+    this._getFoldWidgetBase = this.getFoldWidget;
+    this.getFoldWidget = function(session, foldStyle, row) {
+        var line = session.getLine(row);
+    
+        if (this.singleLineBlockCommentRe.test(line)) {
+            if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
+                return "";
+        }
+    
+        var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
+        if (!fw && this.startRegionRe.test(line))
+            return "start"; // lineCommentRegionStart
+    
+        return fw;
+    };
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
+        var line = session.getLine(row);
+        
+        if (this.startRegionRe.test(line))
+            return this.getCommentRegionBlock(session, line, row);
+        
+        var match = line.match(this.foldingStartMarker);
+        if (match) {
+            var i = match.index;
+
+            if (match[1])
+                return this.openingBracketBlock(session, match[1], row, i);
+                
+            var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
+            if (range && !range.isMultiLine()) {
+                if (forceMultiline) {
+                    range = this.getSectionRange(session, row);
+                } else if (foldStyle != "all")
+                    range = null;
+            }
+            
+            return range;
+        }
+
+        if (foldStyle === "markbegin")
+            return;
+
+        var match = line.match(this.foldingStopMarker);
+        if (match) {
+            var i = match.index + match[0].length;
+
+            if (match[1])
+                return this.closingBracketBlock(session, match[1], row, i);
+
+            return session.getCommentFoldRange(row, i, -1);
+        }
+    };
+    
+    this.getSectionRange = function(session, row) {
+        var line = session.getLine(row);
+        var startIndent = line.search(/\S/);
+        var startRow = row;
+        var startColumn = line.length;
+        row = row + 1;
+        var endRow = row;
+        var maxRow = session.getLength();
+        while (++row < maxRow) {
+            line = session.getLine(row);
+            var indent = line.search(/\S/);
+            if (indent === -1)
+                continue;
+            if  (startIndent > indent)
+                break;
+            var subRange = this.getFoldWidgetRange(session, "all", row);
+            
+            if (subRange) {
+                if (subRange.start.row <= startRow) {
+                    break;
+                } else if (subRange.isMultiLine()) {
+                    row = subRange.end.row;
+                } else if (startIndent == indent) {
+                    break;
+                }
+            }
+            endRow = row;
+        }
+        
+        return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
+    };
+    this.getCommentRegionBlock = function(session, line, row) {
+        var startColumn = line.search(/\s*$/);
+        var maxRow = session.getLength();
+        var startRow = row;
+        
+        var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
+        var depth = 1;
+        while (++row < maxRow) {
+            line = session.getLine(row);
+            var m = re.exec(line);
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
+        }
+
+        var endRow = row;
+        if (endRow > startRow) {
+            return new Range(startRow, startColumn, endRow, line.length);
+        }
+    };
+
+}).call(FoldMode.prototype);
+
+});
+
+ace.define("ace/mode/pig",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/pig_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var PigHighlightRules = require("./pig_highlight_rules").PigHighlightRules;
+var FoldMode = require("./folding/cstyle").FoldMode;
+
+var Mode = function() {
+    this.HighlightRules = PigHighlightRules;
+    this.foldingRules = new FoldMode();
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+    this.lineCommentStart = "--";
+    this.blockComment = {start: "/*", end: "*/"};
+    this.$id = "ace/mode/pig";
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});                (function() {
+                    ace.require(["ace/mode/pig"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 0 - 6448
web/22b3d72765b6ec7c787f375e68324531.js

@@ -1,6448 +0,0 @@
-ace.define("ace/ext/hardwrap",["require","exports","module","ace/range","ace/editor","ace/config"], function(require, exports, module){"use strict";
-var Range = require("../range").Range;
-function hardWrap(editor, options) {
-    var max = options.column || editor.getOption("printMarginColumn");
-    var allowMerge = options.allowMerge != false;
-    var row = Math.min(options.startRow, options.endRow);
-    var endRow = Math.max(options.startRow, options.endRow);
-    var session = editor.session;
-    while (row <= endRow) {
-        var line = session.getLine(row);
-        if (line.length > max) {
-            var space = findSpace(line, max, 5);
-            if (space) {
-                var indentation = /^\s*/.exec(line)[0];
-                session.replace(new Range(row, space.start, row, space.end), "\n" + indentation);
-            }
-            endRow++;
-        }
-        else if (allowMerge && /\S/.test(line) && row != endRow) {
-            var nextLine = session.getLine(row + 1);
-            if (nextLine && /\S/.test(nextLine)) {
-                var trimmedLine = line.replace(/\s+$/, "");
-                var trimmedNextLine = nextLine.replace(/^\s+/, "");
-                var mergedLine = trimmedLine + " " + trimmedNextLine;
-                var space = findSpace(mergedLine, max, 5);
-                if (space && space.start > trimmedLine.length || mergedLine.length < max) {
-                    var replaceRange = new Range(row, trimmedLine.length, row + 1, nextLine.length - trimmedNextLine.length);
-                    session.replace(replaceRange, " ");
-                    row--;
-                    endRow--;
-                }
-                else if (trimmedLine.length < line.length) {
-                    session.remove(new Range(row, trimmedLine.length, row, line.length));
-                }
-            }
-        }
-        row++;
-    }
-    function findSpace(line, max, min) {
-        if (line.length < max)
-            return;
-        var before = line.slice(0, max);
-        var after = line.slice(max);
-        var spaceAfter = /^(?:(\s+)|(\S+)(\s+))/.exec(after);
-        var spaceBefore = /(?:(\s+)|(\s+)(\S+))$/.exec(before);
-        var start = 0;
-        var end = 0;
-        if (spaceBefore && !spaceBefore[2]) {
-            start = max - spaceBefore[1].length;
-            end = max;
-        }
-        if (spaceAfter && !spaceAfter[2]) {
-            if (!start)
-                start = max;
-            end = max + spaceAfter[1].length;
-        }
-        if (start) {
-            return {
-                start: start,
-                end: end
-            };
-        }
-        if (spaceBefore && spaceBefore[2] && spaceBefore.index > min) {
-            return {
-                start: spaceBefore.index,
-                end: spaceBefore.index + spaceBefore[2].length
-            };
-        }
-        if (spaceAfter && spaceAfter[2]) {
-            start = max + spaceAfter[2].length;
-            return {
-                start: start,
-                end: start + spaceAfter[3].length
-            };
-        }
-    }
-}
-function wrapAfterInput(e) {
-    if (e.command.name == "insertstring" && /\S/.test(e.args)) {
-        var editor = e.editor;
-        var cursor = editor.selection.cursor;
-        if (cursor.column <= editor.renderer.$printMarginColumn)
-            return;
-        var lastDelta = editor.session.$undoManager.$lastDelta;
-        hardWrap(editor, {
-            startRow: cursor.row, endRow: cursor.row,
-            allowMerge: false
-        });
-        if (lastDelta != editor.session.$undoManager.$lastDelta)
-            editor.session.markUndoGroup();
-    }
-}
-var Editor = require("../editor").Editor;
-require("../config").defineOptions(Editor.prototype, "editor", {
-    hardWrap: {
-        set: function (val) {
-            if (val) {
-                this.commands.on("afterExec", wrapAfterInput);
-            }
-            else {
-                this.commands.off("afterExec", wrapAfterInput);
-            }
-        },
-        value: false
-    }
-});
-exports.hardWrap = hardWrap;
-
-});
-
-ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/dom","ace/lib/oop","ace/lib/keys","ace/lib/event","ace/search","ace/lib/useragent","ace/search_highlight","ace/commands/multi_select_commands","ace/mode/text","ace/ext/hardwrap","ace/multi_select"], function(require, exports, module){// CodeMirror, copyright (c) by Marijn Haverbeke and others
-'use strict';
-function log() {
-    var d = "";
-    function format(p) {
-        if (typeof p != "object")
-            return p + "";
-        if ("line" in p) {
-            return p.line + ":" + p.ch;
-        }
-        if ("anchor" in p) {
-            return format(p.anchor) + "->" + format(p.head);
-        }
-        if (Array.isArray(p))
-            return "[" + p.map(function (x) {
-                return format(x);
-            }) + "]";
-        return JSON.stringify(p);
-    }
-    for (var i = 0; i < arguments.length; i++) {
-        var p = arguments[i];
-        var f = format(p);
-        d += f + "  ";
-    }
-    console.log(d);
-}
-var Range = require("../range").Range;
-var EventEmitter = require("../lib/event_emitter").EventEmitter;
-var dom = require("../lib/dom");
-var oop = require("../lib/oop");
-var KEYS = require("../lib/keys");
-var event = require("../lib/event");
-var Search = require("../search").Search;
-var useragent = require("../lib/useragent");
-var SearchHighlight = require("../search_highlight").SearchHighlight;
-var multiSelectCommands = require("../commands/multi_select_commands");
-var TextModeTokenRe = require("../mode/text").Mode.prototype.tokenRe;
-var hardWrap = require("../ext/hardwrap").hardWrap;
-require("../multi_select");
-var CodeMirror = function (ace) {
-    this.ace = ace;
-    this.state = {};
-    this.marks = {};
-    this.options = {};
-    this.$uid = 0;
-    this.onChange = this.onChange.bind(this);
-    this.onSelectionChange = this.onSelectionChange.bind(this);
-    this.onBeforeEndOperation = this.onBeforeEndOperation.bind(this);
-    this.ace.on('change', this.onChange);
-    this.ace.on('changeSelection', this.onSelectionChange);
-    this.ace.on('beforeEndOperation', this.onBeforeEndOperation);
-};
-CodeMirror.Pos = function (line, ch) {
-    if (!(this instanceof Pos))
-        return new Pos(line, ch);
-    this.line = line;
-    this.ch = ch;
-};
-CodeMirror.defineOption = function (name, val, setter) { };
-CodeMirror.commands = {
-    redo: function (cm) { cm.ace.redo(); },
-    undo: function (cm) { cm.ace.undo(); },
-    newlineAndIndent: function (cm) { cm.ace.insert("\n"); },
-    goLineLeft: function (cm) { cm.ace.selection.moveCursorLineStart(); },
-    goLineRight: function (cm) { cm.ace.selection.moveCursorLineEnd(); }
-};
-CodeMirror.keyMap = {};
-CodeMirror.addClass = CodeMirror.rmClass = function () { };
-CodeMirror.e_stop = CodeMirror.e_preventDefault = event.stopEvent;
-CodeMirror.keyName = function (e) {
-    var key = (KEYS[e.keyCode] || e.key || "");
-    if (key.length == 1)
-        key = key.toUpperCase();
-    key = event.getModifierString(e).replace(/(^|-)\w/g, function (m) {
-        return m.toUpperCase();
-    }) + key;
-    return key;
-};
-CodeMirror.keyMap['default'] = function (key) {
-    return function (cm) {
-        var cmd = cm.ace.commands.commandKeyBinding[key.toLowerCase()];
-        return cmd && cm.ace.execCommand(cmd) !== false;
-    };
-};
-CodeMirror.lookupKey = function lookupKey(key, map, handle) {
-    if (!map)
-        map = "default";
-    if (typeof map == "string")
-        map = CodeMirror.keyMap[map];
-    var found = typeof map == "function" ? map(key) : map[key];
-    if (found === false)
-        return "nothing";
-    if (found === "...")
-        return "multi";
-    if (found != null && handle(found))
-        return "handled";
-    if (map.fallthrough) {
-        if (!Array.isArray(map.fallthrough))
-            return lookupKey(key, map.fallthrough, handle);
-        for (var i = 0; i < map.fallthrough.length; i++) {
-            var result = lookupKey(key, map.fallthrough[i], handle);
-            if (result)
-                return result;
-        }
-    }
-};
-CodeMirror.findMatchingTag = function (cm, head) {
-};
-CodeMirror.signal = function (o, name, e) { return o._signal(name, e); };
-CodeMirror.on = event.addListener;
-CodeMirror.off = event.removeListener;
-CodeMirror.isWordChar = function (ch) {
-    if (ch < "\x7f")
-        return /^\w$/.test(ch);
-    TextModeTokenRe.lastIndex = 0;
-    return TextModeTokenRe.test(ch);
-};
-(function () {
-    oop.implement(CodeMirror.prototype, EventEmitter);
-    this.destroy = function () {
-        this.ace.off('change', this.onChange);
-        this.ace.off('changeSelection', this.onSelectionChange);
-        this.ace.off('beforeEndOperation', this.onBeforeEndOperation);
-        this.removeOverlay();
-    };
-    this.virtualSelectionMode = function () {
-        return this.ace.inVirtualSelectionMode && this.ace.selection.index;
-    };
-    this.onChange = function (delta) {
-        var change = { text: delta.action[0] == 'i' ? delta.lines : [] };
-        var curOp = this.curOp = this.curOp || {};
-        if (!curOp.changeHandlers)
-            curOp.changeHandlers = this._eventRegistry["change"] && this._eventRegistry["change"].slice();
-        if (!curOp.lastChange) {
-            curOp.lastChange = curOp.change = change;
-        }
-        else {
-            curOp.lastChange.next = curOp.lastChange = change;
-        }
-        this.$updateMarkers(delta);
-    };
-    this.onSelectionChange = function () {
-        var curOp = this.curOp = this.curOp || {};
-        if (!curOp.cursorActivityHandlers)
-            curOp.cursorActivityHandlers = this._eventRegistry["cursorActivity"] && this._eventRegistry["cursorActivity"].slice();
-        this.curOp.cursorActivity = true;
-        if (this.ace.inMultiSelectMode) {
-            this.ace.keyBinding.removeKeyboardHandler(multiSelectCommands.keyboardHandler);
-        }
-    };
-    this.operation = function (fn, force) {
-        if (!force && this.curOp || force && this.curOp && this.curOp.force) {
-            return fn();
-        }
-        if (force || !this.ace.curOp) {
-            if (this.curOp)
-                this.onBeforeEndOperation();
-        }
-        if (!this.ace.curOp) {
-            var prevOp = this.ace.prevOp;
-            this.ace.startOperation({
-                command: { name: "vim", scrollIntoView: "cursor" }
-            });
-        }
-        var curOp = this.curOp = this.curOp || {};
-        this.curOp.force = force;
-        var result = fn();
-        if (this.ace.curOp && this.ace.curOp.command.name == "vim") {
-            if (this.state.dialog)
-                this.ace.curOp.command.scrollIntoView = false;
-            this.ace.endOperation();
-            if (!curOp.cursorActivity && !curOp.lastChange && prevOp)
-                this.ace.prevOp = prevOp;
-        }
-        if (force || !this.ace.curOp) {
-            if (this.curOp)
-                this.onBeforeEndOperation();
-        }
-        return result;
-    };
-    this.onBeforeEndOperation = function () {
-        var op = this.curOp;
-        if (op) {
-            if (op.change) {
-                this.signal("change", op.change, op);
-            }
-            if (op && op.cursorActivity) {
-                this.signal("cursorActivity", null, op);
-            }
-            this.curOp = null;
-        }
-    };
-    this.signal = function (eventName, e, handlers) {
-        var listeners = handlers ? handlers[eventName + "Handlers"]
-            : (this._eventRegistry || {})[eventName];
-        if (!listeners)
-            return;
-        listeners = listeners.slice();
-        for (var i = 0; i < listeners.length; i++)
-            listeners[i](this, e);
-    };
-    this.firstLine = function () { return 0; };
-    this.lastLine = function () { return this.ace.session.getLength() - 1; };
-    this.lineCount = function () { return this.ace.session.getLength(); };
-    this.setCursor = function (line, ch) {
-        if (typeof line === 'object') {
-            ch = line.ch;
-            line = line.line;
-        }
-        var shouldScroll = !this.curOp && !this.ace.inVirtualSelectionMode;
-        if (!this.ace.inVirtualSelectionMode)
-            this.ace.exitMultiSelectMode();
-        this.ace.session.unfold({ row: line, column: ch });
-        this.ace.selection.moveTo(line, ch);
-        if (shouldScroll) {
-            this.ace.renderer.scrollCursorIntoView();
-            this.ace.endOperation();
-        }
-    };
-    this.getCursor = function (p) {
-        var sel = this.ace.selection;
-        var pos = p == 'anchor' ? (sel.isEmpty() ? sel.lead : sel.anchor) :
-            p == 'head' || !p ? sel.lead : sel.getRange()[p];
-        return toCmPos(pos);
-    };
-    this.listSelections = function (p) {
-        var ranges = this.ace.multiSelect.rangeList.ranges;
-        if (!ranges.length || this.ace.inVirtualSelectionMode)
-            return [{ anchor: this.getCursor('anchor'), head: this.getCursor('head') }];
-        return ranges.map(function (r) {
-            return {
-                anchor: this.clipPos(toCmPos(r.cursor == r.end ? r.start : r.end)),
-                head: this.clipPos(toCmPos(r.cursor))
-            };
-        }, this);
-    };
-    this.setSelections = function (p, primIndex) {
-        var sel = this.ace.multiSelect;
-        var ranges = p.map(function (x) {
-            var anchor = toAcePos(x.anchor);
-            var head = toAcePos(x.head);
-            var r = Range.comparePoints(anchor, head) < 0
-                ? new Range.fromPoints(anchor, head)
-                : new Range.fromPoints(head, anchor);
-            r.cursor = Range.comparePoints(r.start, head) ? r.end : r.start;
-            return r;
-        });
-        if (this.ace.inVirtualSelectionMode) {
-            this.ace.selection.fromOrientedRange(ranges[0]);
-            return;
-        }
-        if (!primIndex) {
-            ranges = ranges.reverse();
-        }
-        else if (ranges[primIndex]) {
-            ranges.push(ranges.splice(primIndex, 1)[0]);
-        }
-        sel.toSingleRange(ranges[0].clone());
-        var session = this.ace.session;
-        for (var i = 0; i < ranges.length; i++) {
-            var range = session.$clipRangeToDocument(ranges[i]); // todo why ace doesn't do this?
-            sel.addRange(range);
-        }
-    };
-    this.setSelection = function (a, h, options) {
-        var sel = this.ace.selection;
-        sel.moveTo(a.line, a.ch);
-        sel.selectTo(h.line, h.ch);
-        if (options && options.origin == '*mouse') {
-            this.onBeforeEndOperation();
-        }
-    };
-    this.somethingSelected = function (p) {
-        return !this.ace.selection.isEmpty();
-    };
-    this.clipPos = function (p) {
-        var pos = this.ace.session.$clipPositionToDocument(p.line, p.ch);
-        return toCmPos(pos);
-    };
-    this.foldCode = function (pos) {
-        this.ace.session.$toggleFoldWidget(pos.line, {});
-    };
-    this.markText = function (cursor) {
-        return { clear: function () { }, find: function () { } };
-    };
-    this.$updateMarkers = function (delta) {
-        var isInsert = delta.action == "insert";
-        var start = delta.start;
-        var end = delta.end;
-        var rowShift = (end.row - start.row) * (isInsert ? 1 : -1);
-        var colShift = (end.column - start.column) * (isInsert ? 1 : -1);
-        if (isInsert)
-            end = start;
-        for (var i in this.marks) {
-            var point = this.marks[i];
-            var cmp = Range.comparePoints(point, start);
-            if (cmp < 0) {
-                continue; // delta starts after the range
-            }
-            if (cmp === 0) {
-                if (isInsert) {
-                    if (point.bias == 1) {
-                        cmp = 1;
-                    }
-                    else {
-                        point.bias = -1;
-                        continue;
-                    }
-                }
-            }
-            var cmp2 = isInsert ? cmp : Range.comparePoints(point, end);
-            if (cmp2 > 0) {
-                point.row += rowShift;
-                point.column += point.row == end.row ? colShift : 0;
-                continue;
-            }
-            if (!isInsert && cmp2 <= 0) {
-                point.row = start.row;
-                point.column = start.column;
-                if (cmp2 === 0)
-                    point.bias = 1;
-            }
-        }
-    };
-    var Marker = function (cm, id, row, column) {
-        this.cm = cm;
-        this.id = id;
-        this.row = row;
-        this.column = column;
-        cm.marks[this.id] = this;
-    };
-    Marker.prototype.clear = function () { delete this.cm.marks[this.id]; };
-    Marker.prototype.find = function () { return toCmPos(this); };
-    this.setBookmark = function (cursor, options) {
-        var bm = new Marker(this, this.$uid++, cursor.line, cursor.ch);
-        if (!options || !options.insertLeft)
-            bm.$insertRight = true;
-        this.marks[bm.id] = bm;
-        return bm;
-    };
-    this.moveH = function (increment, unit) {
-        if (unit == 'char') {
-            var sel = this.ace.selection;
-            sel.clearSelection();
-            sel.moveCursorBy(0, increment);
-        }
-    };
-    this.findPosV = function (start, amount, unit, goalColumn) {
-        if (unit == 'page') {
-            var renderer = this.ace.renderer;
-            var config = renderer.layerConfig;
-            amount = amount * Math.floor(config.height / config.lineHeight);
-            unit = 'line';
-        }
-        if (unit == 'line') {
-            var screenPos = this.ace.session.documentToScreenPosition(start.line, start.ch);
-            if (goalColumn != null)
-                screenPos.column = goalColumn;
-            screenPos.row += amount;
-            screenPos.row = Math.min(Math.max(0, screenPos.row), this.ace.session.getScreenLength() - 1);
-            var pos = this.ace.session.screenToDocumentPosition(screenPos.row, screenPos.column);
-            return toCmPos(pos);
-        }
-        else {
-            debugger;
-        }
-    };
-    this.charCoords = function (pos, mode) {
-        if (mode == 'div' || !mode) {
-            var sc = this.ace.session.documentToScreenPosition(pos.line, pos.ch);
-            return { left: sc.column, top: sc.row };
-        }
-        if (mode == 'local') {
-            var renderer = this.ace.renderer;
-            var sc = this.ace.session.documentToScreenPosition(pos.line, pos.ch);
-            var lh = renderer.layerConfig.lineHeight;
-            var cw = renderer.layerConfig.characterWidth;
-            var top = lh * sc.row;
-            return { left: sc.column * cw, top: top, bottom: top + lh };
-        }
-    };
-    this.coordsChar = function (pos, mode) {
-        var renderer = this.ace.renderer;
-        if (mode == 'local') {
-            var row = Math.max(0, Math.floor(pos.top / renderer.lineHeight));
-            var col = Math.max(0, Math.floor(pos.left / renderer.characterWidth));
-            var ch = renderer.session.screenToDocumentPosition(row, col);
-            return toCmPos(ch);
-        }
-        else if (mode == 'div') {
-            throw "not implemented";
-        }
-    };
-    this.getSearchCursor = function (query, pos, caseFold) {
-        var caseSensitive = false;
-        var isRegexp = false;
-        if (query instanceof RegExp && !query.global) {
-            caseSensitive = !query.ignoreCase;
-            query = query.source;
-            isRegexp = true;
-        }
-        if (query == "\\n") {
-            query = "\n";
-            isRegexp = false;
-        }
-        var search = new Search();
-        if (pos.ch == undefined)
-            pos.ch = Number.MAX_VALUE;
-        var acePos = { row: pos.line, column: pos.ch };
-        var cm = this;
-        var last = null;
-        return {
-            findNext: function () { return this.find(false); },
-            findPrevious: function () { return this.find(true); },
-            find: function (back) {
-                search.setOptions({
-                    needle: query,
-                    caseSensitive: caseSensitive,
-                    wrap: false,
-                    backwards: back,
-                    regExp: isRegexp,
-                    start: last || acePos
-                });
-                var range = search.find(cm.ace.session);
-                last = range;
-                return last && [!last.isEmpty()];
-            },
-            from: function () { return last && toCmPos(last.start); },
-            to: function () { return last && toCmPos(last.end); },
-            replace: function (text) {
-                if (last) {
-                    last.end = cm.ace.session.doc.replace(last, text);
-                }
-            }
-        };
-    };
-    this.scrollTo = function (x, y) {
-        var renderer = this.ace.renderer;
-        var config = renderer.layerConfig;
-        var maxHeight = config.maxHeight;
-        maxHeight -= (renderer.$size.scrollerHeight - renderer.lineHeight) * renderer.$scrollPastEnd;
-        if (y != null)
-            this.ace.session.setScrollTop(Math.max(0, Math.min(y, maxHeight)));
-        if (x != null)
-            this.ace.session.setScrollLeft(Math.max(0, Math.min(x, config.width)));
-    };
-    this.scrollInfo = function () { return 0; };
-    this.scrollIntoView = function (pos, margin) {
-        if (pos) {
-            var renderer = this.ace.renderer;
-            var viewMargin = { "top": 0, "bottom": margin };
-            renderer.scrollCursorIntoView(toAcePos(pos), (renderer.lineHeight * 2) / renderer.$size.scrollerHeight, viewMargin);
-        }
-    };
-    this.getLine = function (row) { return this.ace.session.getLine(row); };
-    this.getRange = function (s, e) {
-        return this.ace.session.getTextRange(new Range(s.line, s.ch, e.line, e.ch));
-    };
-    this.replaceRange = function (text, s, e) {
-        if (!e)
-            e = s;
-        var range = new Range(s.line, s.ch, e.line, e.ch);
-        this.ace.session.$clipRangeToDocument(range);
-        return this.ace.session.replace(range, text);
-    };
-    this.replaceSelection =
-        this.replaceSelections = function (p) {
-            var sel = this.ace.selection;
-            if (this.ace.inVirtualSelectionMode) {
-                this.ace.session.replace(sel.getRange(), p[0] || "");
-                return;
-            }
-            sel.inVirtualSelectionMode = true;
-            var ranges = sel.rangeList.ranges;
-            if (!ranges.length)
-                ranges = [this.ace.multiSelect.getRange()];
-            for (var i = ranges.length; i--;)
-                this.ace.session.replace(ranges[i], p[i] || "");
-            sel.inVirtualSelectionMode = false;
-        };
-    this.getSelection = function () {
-        return this.ace.getSelectedText();
-    };
-    this.getSelections = function () {
-        return this.listSelections().map(function (x) {
-            return this.getRange(x.anchor, x.head);
-        }, this);
-    };
-    this.getInputField = function () {
-        return this.ace.textInput.getElement();
-    };
-    this.getWrapperElement = function () {
-        return this.ace.container;
-    };
-    var optMap = {
-        indentWithTabs: "useSoftTabs",
-        indentUnit: "tabSize",
-        tabSize: "tabSize",
-        firstLineNumber: "firstLineNumber",
-        readOnly: "readOnly"
-    };
-    this.setOption = function (name, val) {
-        this.state[name] = val;
-        switch (name) {
-            case 'indentWithTabs':
-                name = optMap[name];
-                val = !val;
-                break;
-            case 'keyMap':
-                this.state.$keyMap = val;
-                return;
-                break;
-            default:
-                name = optMap[name];
-        }
-        if (name)
-            this.ace.setOption(name, val);
-    };
-    this.getOption = function (name) {
-        var val;
-        var aceOpt = optMap[name];
-        if (aceOpt)
-            val = this.ace.getOption(aceOpt);
-        switch (name) {
-            case 'indentWithTabs':
-                name = optMap[name];
-                return !val;
-            case 'keyMap':
-                return this.state.$keyMap || 'vim';
-        }
-        return aceOpt ? val : this.state[name];
-    };
-    this.toggleOverwrite = function (on) {
-        this.state.overwrite = on;
-        return this.ace.setOverwrite(on);
-    };
-    this.addOverlay = function (o) {
-        if (!this.$searchHighlight || !this.$searchHighlight.session) {
-            var highlight = new SearchHighlight(null, "ace_highlight-marker", "text");
-            var marker = this.ace.session.addDynamicMarker(highlight);
-            highlight.id = marker.id;
-            highlight.session = this.ace.session;
-            highlight.destroy = function (o) {
-                highlight.session.off("change", highlight.updateOnChange);
-                highlight.session.off("changeEditor", highlight.destroy);
-                highlight.session.removeMarker(highlight.id);
-                highlight.session = null;
-            };
-            highlight.updateOnChange = function (delta) {
-                var row = delta.start.row;
-                if (row == delta.end.row)
-                    highlight.cache[row] = undefined;
-                else
-                    highlight.cache.splice(row, highlight.cache.length);
-            };
-            highlight.session.on("changeEditor", highlight.destroy);
-            highlight.session.on("change", highlight.updateOnChange);
-        }
-        var re = new RegExp(o.query.source, "gmi");
-        this.$searchHighlight = o.highlight = highlight;
-        this.$searchHighlight.setRegexp(re);
-        this.ace.renderer.updateBackMarkers();
-    };
-    this.removeOverlay = function (o) {
-        if (this.$searchHighlight && this.$searchHighlight.session) {
-            this.$searchHighlight.destroy();
-        }
-    };
-    this.getScrollInfo = function () {
-        var renderer = this.ace.renderer;
-        var config = renderer.layerConfig;
-        return {
-            left: renderer.scrollLeft,
-            top: renderer.scrollTop,
-            height: config.maxHeight,
-            width: config.width,
-            clientHeight: config.height,
-            clientWidth: config.width
-        };
-    };
-    this.getValue = function () {
-        return this.ace.getValue();
-    };
-    this.setValue = function (v) {
-        return this.ace.setValue(v, -1);
-    };
-    this.getTokenTypeAt = function (pos) {
-        var token = this.ace.session.getTokenAt(pos.line, pos.ch);
-        return token && /comment|string/.test(token.type) ? "string" : "";
-    };
-    this.findMatchingBracket = function (pos) {
-        var m = this.ace.session.findMatchingBracket(toAcePos(pos));
-        return { to: m && toCmPos(m) };
-    };
-    this.indentLine = function (line, method) {
-        if (method === true)
-            this.ace.session.indentRows(line, line, "\t");
-        else if (method === false)
-            this.ace.session.outdentRows(new Range(line, 0, line, 0));
-    };
-    this.indexFromPos = function (pos) {
-        return this.ace.session.doc.positionToIndex(toAcePos(pos));
-    };
-    this.posFromIndex = function (index) {
-        return toCmPos(this.ace.session.doc.indexToPosition(index));
-    };
-    this.focus = function (index) {
-        return this.ace.textInput.focus();
-    };
-    this.blur = function (index) {
-        return this.ace.blur();
-    };
-    this.defaultTextHeight = function (index) {
-        return this.ace.renderer.layerConfig.lineHeight;
-    };
-    this.scanForBracket = function (pos, dir, _, options) {
-        var re = options.bracketRegex.source;
-        var tokenRe = /paren|text|operator|tag/;
-        if (dir == 1) {
-            var m = this.ace.session.$findClosingBracket(re.slice(1, 2), toAcePos(pos), tokenRe);
-        }
-        else {
-            var m = this.ace.session.$findOpeningBracket(re.slice(-2, -1), { row: pos.line, column: pos.ch + 1 }, tokenRe);
-        }
-        return m && { pos: toCmPos(m) };
-    };
-    this.refresh = function () {
-        return this.ace.resize(true);
-    };
-    this.getMode = function () {
-        return { name: this.getOption("mode") };
-    };
-    this.execCommand = function (name) {
-        if (CodeMirror.commands.hasOwnProperty(name))
-            return CodeMirror.commands[name](this);
-        if (name == "indentAuto")
-            return this.ace.execCommand("autoindent");
-        console.log(name + " is not implemented");
-    };
-    this.getLineNumber = function (handle) {
-        return handle.row;
-    };
-    this.getLineHandle = function (row) {
-        return { text: this.ace.session.getLine(row), row: row };
-    };
-}).call(CodeMirror.prototype);
-function toAcePos(cmPos) {
-    return { row: cmPos.line, column: cmPos.ch };
-}
-function toCmPos(acePos) {
-    return new Pos(acePos.row, acePos.column);
-}
-var StringStream = CodeMirror.StringStream = function (string, tabSize) {
-    this.pos = this.start = 0;
-    this.string = string;
-    this.tabSize = tabSize || 8;
-    this.lastColumnPos = this.lastColumnValue = 0;
-    this.lineStart = 0;
-};
-StringStream.prototype = {
-    eol: function () { return this.pos >= this.string.length; },
-    sol: function () { return this.pos == this.lineStart; },
-    peek: function () { return this.string.charAt(this.pos) || undefined; },
-    next: function () {
-        if (this.pos < this.string.length)
-            return this.string.charAt(this.pos++);
-    },
-    eat: function (match) {
-        var ch = this.string.charAt(this.pos);
-        if (typeof match == "string")
-            var ok = ch == match;
-        else
-            var ok = ch && (match.test ? match.test(ch) : match(ch));
-        if (ok) {
-            ++this.pos;
-            return ch;
-        }
-    },
-    eatWhile: function (match) {
-        var start = this.pos;
-        while (this.eat(match)) { }
-        return this.pos > start;
-    },
-    eatSpace: function () {
-        var start = this.pos;
-        while (/[\s\u00a0]/.test(this.string.charAt(this.pos)))
-            ++this.pos;
-        return this.pos > start;
-    },
-    skipToEnd: function () { this.pos = this.string.length; },
-    skipTo: function (ch) {
-        var found = this.string.indexOf(ch, this.pos);
-        if (found > -1) {
-            this.pos = found;
-            return true;
-        }
-    },
-    backUp: function (n) { this.pos -= n; },
-    column: function () {
-        throw "not implemented";
-    },
-    indentation: function () {
-        throw "not implemented";
-    },
-    match: function (pattern, consume, caseInsensitive) {
-        if (typeof pattern == "string") {
-            var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };
-            var substr = this.string.substr(this.pos, pattern.length);
-            if (cased(substr) == cased(pattern)) {
-                if (consume !== false)
-                    this.pos += pattern.length;
-                return true;
-            }
-        }
-        else {
-            var match = this.string.slice(this.pos).match(pattern);
-            if (match && match.index > 0)
-                return null;
-            if (match && consume !== false)
-                this.pos += match[0].length;
-            return match;
-        }
-    },
-    current: function () { return this.string.slice(this.start, this.pos); },
-    hideFirstChars: function (n, inner) {
-        this.lineStart += n;
-        try {
-            return inner();
-        }
-        finally {
-            this.lineStart -= n;
-        }
-    }
-};
-CodeMirror.defineExtension = function (name, fn) {
-    CodeMirror.prototype[name] = fn;
-};
-dom.importCssString(".normal-mode .ace_cursor{\n    border: none;\n    background-color: rgba(255,0,0,0.5);\n}\n.normal-mode .ace_hidden-cursors .ace_cursor{\n  background-color: transparent;\n  border: 1px solid red;\n  opacity: 0.7\n}\n.ace_dialog {\n  position: absolute;\n  left: 0; right: 0;\n  background: inherit;\n  z-index: 15;\n  padding: .1em .8em;\n  overflow: hidden;\n  color: inherit;\n}\n.ace_dialog-top {\n  border-bottom: 1px solid #444;\n  top: 0;\n}\n.ace_dialog-bottom {\n  border-top: 1px solid #444;\n  bottom: 0;\n}\n.ace_dialog input {\n  border: none;\n  outline: none;\n  background: transparent;\n  width: 20em;\n  color: inherit;\n  font-family: monospace;\n}", "vimMode", false);
-(function () {
-    function dialogDiv(cm, template, bottom) {
-        var wrap = cm.ace.container;
-        var dialog;
-        dialog = wrap.appendChild(document.createElement("div"));
-        if (bottom)
-            dialog.className = "ace_dialog ace_dialog-bottom";
-        else
-            dialog.className = "ace_dialog ace_dialog-top";
-        if (typeof template == "string") {
-            dialog.innerHTML = template;
-        }
-        else { // Assuming it's a detached DOM element.
-            dialog.appendChild(template);
-        }
-        return dialog;
-    }
-    function closeNotification(cm, newVal) {
-        if (cm.state.currentNotificationClose)
-            cm.state.currentNotificationClose();
-        cm.state.currentNotificationClose = newVal;
-    }
-    CodeMirror.defineExtension("openDialog", function (template, callback, options) {
-        if (this.virtualSelectionMode())
-            return;
-        if (!options)
-            options = {};
-        closeNotification(this, null);
-        var dialog = dialogDiv(this, template, options.bottom);
-        var closed = false, me = this;
-        this.state.dialog = dialog;
-        function close(newVal) {
-            if (typeof newVal == 'string') {
-                inp.value = newVal;
-            }
-            else {
-                if (closed)
-                    return;
-                if (newVal && newVal.type == "blur") {
-                    if (document.activeElement === inp)
-                        return;
-                }
-                if (me.state.dialog == dialog) {
-                    me.state.dialog = null;
-                    me.focus();
-                }
-                closed = true;
-                dialog.remove();
-                if (options.onClose)
-                    options.onClose(dialog);
-                var cm = me;
-                if (cm.state.vim) {
-                    cm.state.vim.status = null;
-                    cm.ace._signal("changeStatus");
-                    cm.ace.renderer.$loop.schedule(cm.ace.renderer.CHANGE_CURSOR);
-                }
-            }
-        }
-        var inp = dialog.getElementsByTagName("input")[0], button;
-        if (inp) {
-            if (options.value) {
-                inp.value = options.value;
-                if (options.selectValueOnOpen !== false)
-                    inp.select();
-            }
-            if (options.onInput)
-                CodeMirror.on(inp, "input", function (e) { options.onInput(e, inp.value, close); });
-            if (options.onKeyUp)
-                CodeMirror.on(inp, "keyup", function (e) { options.onKeyUp(e, inp.value, close); });
-            CodeMirror.on(inp, "keydown", function (e) {
-                if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) {
-                    return;
-                }
-                if (e.keyCode == 13)
-                    callback(inp.value);
-                if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) {
-                    CodeMirror.e_stop(e);
-                    close();
-                }
-            });
-            if (options.closeOnBlur !== false)
-                CodeMirror.on(inp, "blur", close);
-            inp.focus();
-        }
-        else if (button = dialog.getElementsByTagName("button")[0]) {
-            CodeMirror.on(button, "click", function () {
-                close();
-                me.focus();
-            });
-            if (options.closeOnBlur !== false)
-                CodeMirror.on(button, "blur", close);
-            button.focus();
-        }
-        return close;
-    });
-    CodeMirror.defineExtension("openNotification", function (template, options) {
-        if (this.virtualSelectionMode())
-            return;
-        closeNotification(this, close);
-        var dialog = dialogDiv(this, template, options && options.bottom);
-        var closed = false, doneTimer;
-        var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000;
-        function close() {
-            if (closed)
-                return;
-            closed = true;
-            clearTimeout(doneTimer);
-            dialog.remove();
-        }
-        CodeMirror.on(dialog, 'click', function (e) {
-            CodeMirror.e_preventDefault(e);
-            close();
-        });
-        if (duration)
-            doneTimer = setTimeout(close, duration);
-        return close;
-    });
-})();
-var Pos = CodeMirror.Pos;
-function transformCursor(cm, range) {
-    var vim = cm.state.vim;
-    if (!vim || vim.insertMode)
-        return range.head;
-    var head = vim.sel.head;
-    if (!head)
-        return range.head;
-    if (vim.visualBlock) {
-        if (range.head.line != head.line) {
-            return;
-        }
-    }
-    if (range.from() == range.anchor && !range.empty()) {
-        if (range.head.line == head.line && range.head.ch != head.ch)
-            return new Pos(range.head.line, range.head.ch - 1);
-    }
-    return range.head;
-}
-var defaultKeymap = [
-    { keys: '<Left>', type: 'keyToKey', toKeys: 'h' },
-    { keys: '<Right>', type: 'keyToKey', toKeys: 'l' },
-    { keys: '<Up>', type: 'keyToKey', toKeys: 'k' },
-    { keys: '<Down>', type: 'keyToKey', toKeys: 'j' },
-    { keys: 'g<Up>', type: 'keyToKey', toKeys: 'gk' },
-    { keys: 'g<Down>', type: 'keyToKey', toKeys: 'gj' },
-    { keys: '<Space>', type: 'keyToKey', toKeys: 'l' },
-    { keys: '<BS>', type: 'keyToKey', toKeys: 'h', context: 'normal' },
-    { keys: '<Del>', type: 'keyToKey', toKeys: 'x', context: 'normal' },
-    { keys: '<C-Space>', type: 'keyToKey', toKeys: 'W' },
-    { keys: '<C-BS>', type: 'keyToKey', toKeys: 'B', context: 'normal' },
-    { keys: '<S-Space>', type: 'keyToKey', toKeys: 'w' },
-    { keys: '<S-BS>', type: 'keyToKey', toKeys: 'b', context: 'normal' },
-    { keys: '<C-n>', type: 'keyToKey', toKeys: 'j' },
-    { keys: '<C-p>', type: 'keyToKey', toKeys: 'k' },
-    { keys: '<C-[>', type: 'keyToKey', toKeys: '<Esc>' },
-    { keys: '<C-c>', type: 'keyToKey', toKeys: '<Esc>' },
-    { keys: '<C-[>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
-    { keys: '<C-c>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
-    { keys: '<C-Esc>', type: 'keyToKey', toKeys: '<Esc>' },
-    { keys: '<C-Esc>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
-    { keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' },
-    { keys: 's', type: 'keyToKey', toKeys: 'c', context: 'visual' },
-    { keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' },
-    { keys: 'S', type: 'keyToKey', toKeys: 'VdO', context: 'visual' },
-    { keys: '<Home>', type: 'keyToKey', toKeys: '0' },
-    { keys: '<End>', type: 'keyToKey', toKeys: '$' },
-    { keys: '<PageUp>', type: 'keyToKey', toKeys: '<C-b>' },
-    { keys: '<PageDown>', type: 'keyToKey', toKeys: '<C-f>' },
-    { keys: '<CR>', type: 'keyToKey', toKeys: 'j^', context: 'normal' },
-    { keys: '<Ins>', type: 'keyToKey', toKeys: 'i', context: 'normal' },
-    { keys: '<Ins>', type: 'action', action: 'toggleOverwrite', context: 'insert' },
-    { keys: 'H', type: 'motion', motion: 'moveToTopLine', motionArgs: { linewise: true, toJumplist: true } },
-    { keys: 'M', type: 'motion', motion: 'moveToMiddleLine', motionArgs: { linewise: true, toJumplist: true } },
-    { keys: 'L', type: 'motion', motion: 'moveToBottomLine', motionArgs: { linewise: true, toJumplist: true } },
-    { keys: 'h', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: false } },
-    { keys: 'l', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: true } },
-    { keys: 'j', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, linewise: true } },
-    { keys: 'k', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, linewise: true } },
-    { keys: 'gj', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: true } },
-    { keys: 'gk', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: false } },
-    { keys: 'w', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false } },
-    { keys: 'W', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false, bigWord: true } },
-    { keys: 'e', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, inclusive: true } },
-    { keys: 'E', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, bigWord: true, inclusive: true } },
-    { keys: 'b', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false } },
-    { keys: 'B', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false, bigWord: true } },
-    { keys: 'ge', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, inclusive: true } },
-    { keys: 'gE', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, bigWord: true, inclusive: true } },
-    { keys: '{', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: false, toJumplist: true } },
-    { keys: '}', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: true, toJumplist: true } },
-    { keys: '(', type: 'motion', motion: 'moveBySentence', motionArgs: { forward: false } },
-    { keys: ')', type: 'motion', motion: 'moveBySentence', motionArgs: { forward: true } },
-    { keys: '<C-f>', type: 'motion', motion: 'moveByPage', motionArgs: { forward: true } },
-    { keys: '<C-b>', type: 'motion', motion: 'moveByPage', motionArgs: { forward: false } },
-    { keys: '<C-d>', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: true, explicitRepeat: true } },
-    { keys: '<C-u>', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: false, explicitRepeat: true } },
-    { keys: 'gg', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true } },
-    { keys: 'G', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true } },
-    { keys: "g$", type: "motion", motion: "moveToEndOfDisplayLine" },
-    { keys: "g^", type: "motion", motion: "moveToStartOfDisplayLine" },
-    { keys: "g0", type: "motion", motion: "moveToStartOfDisplayLine" },
-    { keys: '0', type: 'motion', motion: 'moveToStartOfLine' },
-    { keys: '^', type: 'motion', motion: 'moveToFirstNonWhiteSpaceCharacter' },
-    { keys: '+', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar: true } },
-    { keys: '-', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, toFirstChar: true } },
-    { keys: '_', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar: true, repeatOffset: -1 } },
-    { keys: '$', type: 'motion', motion: 'moveToEol', motionArgs: { inclusive: true } },
-    { keys: '%', type: 'motion', motion: 'moveToMatchedSymbol', motionArgs: { inclusive: true, toJumplist: true } },
-    { keys: 'f<character>', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: true, inclusive: true } },
-    { keys: 'F<character>', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: false } },
-    { keys: 't<character>', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: true, inclusive: true } },
-    { keys: 'T<character>', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: false } },
-    { keys: ';', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: true } },
-    { keys: ',', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: false } },
-    { keys: '\'<character>', type: 'motion', motion: 'goToMark', motionArgs: { toJumplist: true, linewise: true } },
-    { keys: '`<character>', type: 'motion', motion: 'goToMark', motionArgs: { toJumplist: true } },
-    { keys: ']`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true } },
-    { keys: '[`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false } },
-    { keys: ']\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true, linewise: true } },
-    { keys: '[\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false, linewise: true } },
-    { keys: ']p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true, matchIndent: true } },
-    { keys: '[p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true, matchIndent: true } },
-    { keys: ']<character>', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: true, toJumplist: true } },
-    { keys: '[<character>', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: false, toJumplist: true } },
-    { keys: '|', type: 'motion', motion: 'moveToColumn' },
-    { keys: 'o', type: 'motion', motion: 'moveToOtherHighlightedEnd', context: 'visual' },
-    { keys: 'O', type: 'motion', motion: 'moveToOtherHighlightedEnd', motionArgs: { sameLine: true }, context: 'visual' },
-    { keys: 'd', type: 'operator', operator: 'delete' },
-    { keys: 'y', type: 'operator', operator: 'yank' },
-    { keys: 'c', type: 'operator', operator: 'change' },
-    { keys: '=', type: 'operator', operator: 'indentAuto' },
-    { keys: '>', type: 'operator', operator: 'indent', operatorArgs: { indentRight: true } },
-    { keys: '<', type: 'operator', operator: 'indent', operatorArgs: { indentRight: false } },
-    { keys: 'g~', type: 'operator', operator: 'changeCase' },
-    { keys: 'gu', type: 'operator', operator: 'changeCase', operatorArgs: { toLower: true }, isEdit: true },
-    { keys: 'gU', type: 'operator', operator: 'changeCase', operatorArgs: { toLower: false }, isEdit: true },
-    { keys: 'n', type: 'motion', motion: 'findNext', motionArgs: { forward: true, toJumplist: true } },
-    { keys: 'N', type: 'motion', motion: 'findNext', motionArgs: { forward: false, toJumplist: true } },
-    { keys: 'gn', type: 'motion', motion: 'findAndSelectNextInclusive', motionArgs: { forward: true } },
-    { keys: 'gN', type: 'motion', motion: 'findAndSelectNextInclusive', motionArgs: { forward: false } },
-    { keys: 'x', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorMotionArgs: { visualLine: false } },
-    { keys: 'X', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: false }, operatorMotionArgs: { visualLine: true } },
-    { keys: 'D', type: 'operatorMotion', operator: 'delete', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal' },
-    { keys: 'D', type: 'operator', operator: 'delete', operatorArgs: { linewise: true }, context: 'visual' },
-    { keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'expandToLine', motionArgs: { linewise: true }, context: 'normal' },
-    { keys: 'Y', type: 'operator', operator: 'yank', operatorArgs: { linewise: true }, context: 'visual' },
-    { keys: 'C', type: 'operatorMotion', operator: 'change', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal' },
-    { keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual' },
-    { keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal' },
-    { keys: '~', type: 'operator', operator: 'changeCase', context: 'visual' },
-    { keys: '<C-w>', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' },
-    { keys: '<C-w>', type: 'idle', context: 'normal' },
-    { keys: '<C-i>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true } },
-    { keys: '<C-o>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false } },
-    { keys: '<C-e>', type: 'action', action: 'scroll', actionArgs: { forward: true, linewise: true } },
-    { keys: '<C-y>', type: 'action', action: 'scroll', actionArgs: { forward: false, linewise: true } },
-    { keys: 'a', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'charAfter' }, context: 'normal' },
-    { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }, context: 'normal' },
-    { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' },
-    { keys: 'i', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }, context: 'normal' },
-    { keys: 'gi', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'lastEdit' }, context: 'normal' },
-    { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'firstNonBlank' }, context: 'normal' },
-    { keys: 'gI', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'bol' }, context: 'normal' },
-    { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'startOfSelectedArea' }, context: 'visual' },
-    { keys: 'o', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: true }, context: 'normal' },
-    { keys: 'O', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: false }, context: 'normal' },
-    { keys: 'v', type: 'action', action: 'toggleVisualMode' },
-    { keys: 'V', type: 'action', action: 'toggleVisualMode', actionArgs: { linewise: true } },
-    { keys: '<C-v>', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true } },
-    { keys: '<C-q>', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true } },
-    { keys: 'gv', type: 'action', action: 'reselectLastSelection' },
-    { keys: 'J', type: 'action', action: 'joinLines', isEdit: true },
-    { keys: 'gJ', type: 'action', action: 'joinLines', actionArgs: { keepSpaces: true }, isEdit: true },
-    { keys: 'p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true } },
-    { keys: 'P', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true } },
-    { keys: 'r<character>', type: 'action', action: 'replace', isEdit: true },
-    { keys: '@<character>', type: 'action', action: 'replayMacro' },
-    { keys: 'q<character>', type: 'action', action: 'enterMacroRecordMode' },
-    { keys: 'R', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { replace: true }, context: 'normal' },
-    { keys: 'R', type: 'operator', operator: 'change', operatorArgs: { linewise: true, fullLine: true }, context: 'visual', exitVisualBlock: true },
-    { keys: 'u', type: 'action', action: 'undo', context: 'normal' },
-    { keys: 'u', type: 'operator', operator: 'changeCase', operatorArgs: { toLower: true }, context: 'visual', isEdit: true },
-    { keys: 'U', type: 'operator', operator: 'changeCase', operatorArgs: { toLower: false }, context: 'visual', isEdit: true },
-    { keys: '<C-r>', type: 'action', action: 'redo' },
-    { keys: 'm<character>', type: 'action', action: 'setMark' },
-    { keys: '"<character>', type: 'action', action: 'setRegister' },
-    { keys: 'zz', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' } },
-    { keys: 'z.', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }, motion: 'moveToFirstNonWhiteSpaceCharacter' },
-    { keys: 'zt', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' } },
-    { keys: 'z<CR>', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' }, motion: 'moveToFirstNonWhiteSpaceCharacter' },
-    { keys: 'z-', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' } },
-    { keys: 'zb', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' }, motion: 'moveToFirstNonWhiteSpaceCharacter' },
-    { keys: '.', type: 'action', action: 'repeatLastEdit' },
-    { keys: '<C-a>', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: { increase: true, backtrack: false } },
-    { keys: '<C-x>', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: { increase: false, backtrack: false } },
-    { keys: '<C-t>', type: 'action', action: 'indent', actionArgs: { indentRight: true }, context: 'insert' },
-    { keys: '<C-d>', type: 'action', action: 'indent', actionArgs: { indentRight: false }, context: 'insert' },
-    { keys: 'a<character>', type: 'motion', motion: 'textObjectManipulation' },
-    { keys: 'i<character>', type: 'motion', motion: 'textObjectManipulation', motionArgs: { textObjectInner: true } },
-    { keys: '/', type: 'search', searchArgs: { forward: true, querySrc: 'prompt', toJumplist: true } },
-    { keys: '?', type: 'search', searchArgs: { forward: false, querySrc: 'prompt', toJumplist: true } },
-    { keys: '*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true } },
-    { keys: '#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true } },
-    { keys: 'g*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true } },
-    { keys: 'g#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true } },
-    { keys: ':', type: 'ex' }
-];
-var defaultKeymapLength = defaultKeymap.length;
-var defaultExCommandMap = [
-    { name: 'colorscheme', shortName: 'colo' },
-    { name: 'map' },
-    { name: 'imap', shortName: 'im' },
-    { name: 'nmap', shortName: 'nm' },
-    { name: 'vmap', shortName: 'vm' },
-    { name: 'unmap' },
-    { name: 'write', shortName: 'w' },
-    { name: 'undo', shortName: 'u' },
-    { name: 'redo', shortName: 'red' },
-    { name: 'set', shortName: 'se' },
-    { name: 'setlocal', shortName: 'setl' },
-    { name: 'setglobal', shortName: 'setg' },
-    { name: 'sort', shortName: 'sor' },
-    { name: 'substitute', shortName: 's', possiblyAsync: true },
-    { name: 'nohlsearch', shortName: 'noh' },
-    { name: 'yank', shortName: 'y' },
-    { name: 'delmarks', shortName: 'delm' },
-    { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true },
-    { name: 'vglobal', shortName: 'v' },
-    { name: 'global', shortName: 'g' }
-];
-var Vim = function () { return vimApi; }; //{
-function enterVimMode(cm) {
-    cm.setOption('disableInput', true);
-    cm.setOption('showCursorWhenSelecting', false);
-    CodeMirror.signal(cm, "vim-mode-change", { mode: "normal" });
-    cm.on('cursorActivity', onCursorActivity);
-    maybeInitVimState(cm);
-    CodeMirror.on(cm.getInputField(), 'paste', getOnPasteFn(cm));
-}
-function leaveVimMode(cm) {
-    cm.setOption('disableInput', false);
-    cm.off('cursorActivity', onCursorActivity);
-    CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm));
-    cm.state.vim = null;
-}
-function detachVimMap(cm, next) {
-    if (this == CodeMirror.keyMap.vim) {
-        cm.options.$customCursor = null;
-        CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor");
-    }
-    if (!next || next.attach != attachVimMap)
-        leaveVimMode(cm);
-}
-function attachVimMap(cm, prev) {
-    if (this == CodeMirror.keyMap.vim) {
-        if (cm.curOp)
-            cm.curOp.selectionChanged = true;
-        cm.options.$customCursor = transformCursor;
-        CodeMirror.addClass(cm.getWrapperElement(), "cm-fat-cursor");
-    }
-    if (!prev || prev.attach != attachVimMap)
-        enterVimMode(cm);
-}
-CodeMirror.defineOption('vimMode', false, function (cm, val, prev) {
-    if (val && cm.getOption("keyMap") != "vim")
-        cm.setOption("keyMap", "vim");
-    else if (!val && prev != CodeMirror.Init && /^vim/.test(cm.getOption("keyMap")))
-        cm.setOption("keyMap", "default");
-});
-function cmKey(key, cm) {
-    if (!cm) {
-        return undefined;
-    }
-    if (this[key]) {
-        return this[key];
-    }
-    var vimKey = cmKeyToVimKey(key);
-    if (!vimKey) {
-        return false;
-    }
-    var cmd = vimApi.findKey(cm, vimKey);
-    if (typeof cmd == 'function') {
-        CodeMirror.signal(cm, 'vim-keypress', vimKey);
-    }
-    return cmd;
-}
-var modifiers = { Shift: 'S', Ctrl: 'C', Alt: 'A', Cmd: 'D', Mod: 'A', CapsLock: '' };
-var specialKeys = { Enter: 'CR', Backspace: 'BS', Delete: 'Del', Insert: 'Ins' };
-function cmKeyToVimKey(key) {
-    if (key.charAt(0) == '\'') {
-        return key.charAt(1);
-    }
-    var pieces = key.split(/-(?!$)/);
-    var lastPiece = pieces[pieces.length - 1];
-    if (pieces.length == 1 && pieces[0].length == 1) {
-        return false;
-    }
-    else if (pieces.length == 2 && pieces[0] == 'Shift' && lastPiece.length == 1) {
-        return false;
-    }
-    var hasCharacter = false;
-    for (var i = 0; i < pieces.length; i++) {
-        var piece = pieces[i];
-        if (piece in modifiers) {
-            pieces[i] = modifiers[piece];
-        }
-        else {
-            hasCharacter = true;
-        }
-        if (piece in specialKeys) {
-            pieces[i] = specialKeys[piece];
-        }
-    }
-    if (!hasCharacter) {
-        return false;
-    }
-    if (isUpperCase(lastPiece)) {
-        pieces[pieces.length - 1] = lastPiece.toLowerCase();
-    }
-    return '<' + pieces.join('-') + '>';
-}
-function getOnPasteFn(cm) {
-    var vim = cm.state.vim;
-    if (!vim.onPasteFn) {
-        vim.onPasteFn = function () {
-            if (!vim.insertMode) {
-                cm.setCursor(offsetCursor(cm.getCursor(), 0, 1));
-                actions.enterInsertMode(cm, {}, vim);
-            }
-        };
-    }
-    return vim.onPasteFn;
-}
-var numberRegex = /[\d]/;
-var wordCharTest = [CodeMirror.isWordChar, function (ch) {
-        return ch && !CodeMirror.isWordChar(ch) && !/\s/.test(ch);
-    }], bigWordCharTest = [function (ch) {
-        return /\S/.test(ch);
-    }];
-function makeKeyRange(start, size) {
-    var keys = [];
-    for (var i = start; i < start + size; i++) {
-        keys.push(String.fromCharCode(i));
-    }
-    return keys;
-}
-var upperCaseAlphabet = makeKeyRange(65, 26);
-var lowerCaseAlphabet = makeKeyRange(97, 26);
-var numbers = makeKeyRange(48, 10);
-var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']);
-var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':', '_', '/']);
-var upperCaseChars;
-try {
-    upperCaseChars = new RegExp("^[\\p{Lu}]$", "u");
-}
-catch (_) {
-    upperCaseChars = /^[A-Z]$/;
-}
-function isLine(cm, line) {
-    return line >= cm.firstLine() && line <= cm.lastLine();
-}
-function isLowerCase(k) {
-    return (/^[a-z]$/).test(k);
-}
-function isMatchableSymbol(k) {
-    return '()[]{}'.indexOf(k) != -1;
-}
-function isNumber(k) {
-    return numberRegex.test(k);
-}
-function isUpperCase(k) {
-    return upperCaseChars.test(k);
-}
-function isWhiteSpaceString(k) {
-    return (/^\s*$/).test(k);
-}
-function isEndOfSentenceSymbol(k) {
-    return '.?!'.indexOf(k) != -1;
-}
-function inArray(val, arr) {
-    for (var i = 0; i < arr.length; i++) {
-        if (arr[i] == val) {
-            return true;
-        }
-    }
-    return false;
-}
-var options = {};
-function defineOption(name, defaultValue, type, aliases, callback) {
-    if (defaultValue === undefined && !callback) {
-        throw Error('defaultValue is required unless callback is provided');
-    }
-    if (!type) {
-        type = 'string';
-    }
-    options[name] = {
-        type: type,
-        defaultValue: defaultValue,
-        callback: callback
-    };
-    if (aliases) {
-        for (var i = 0; i < aliases.length; i++) {
-            options[aliases[i]] = options[name];
-        }
-    }
-    if (defaultValue) {
-        setOption(name, defaultValue);
-    }
-}
-function setOption(name, value, cm, cfg) {
-    var option = options[name];
-    cfg = cfg || {};
-    var scope = cfg.scope;
-    if (!option) {
-        return new Error('Unknown option: ' + name);
-    }
-    if (option.type == 'boolean') {
-        if (value && value !== true) {
-            return new Error('Invalid argument: ' + name + '=' + value);
-        }
-        else if (value !== false) {
-            value = true;
-        }
-    }
-    if (option.callback) {
-        if (scope !== 'local') {
-            option.callback(value, undefined);
-        }
-        if (scope !== 'global' && cm) {
-            option.callback(value, cm);
-        }
-    }
-    else {
-        if (scope !== 'local') {
-            option.value = option.type == 'boolean' ? !!value : value;
-        }
-        if (scope !== 'global' && cm) {
-            cm.state.vim.options[name] = { value: value };
-        }
-    }
-}
-function getOption(name, cm, cfg) {
-    var option = options[name];
-    cfg = cfg || {};
-    var scope = cfg.scope;
-    if (!option) {
-        return new Error('Unknown option: ' + name);
-    }
-    if (option.callback) {
-        var local = cm && option.callback(undefined, cm);
-        if (scope !== 'global' && local !== undefined) {
-            return local;
-        }
-        if (scope !== 'local') {
-            return option.callback();
-        }
-        return;
-    }
-    else {
-        var local = (scope !== 'global') && (cm && cm.state.vim.options[name]);
-        return (local || (scope !== 'local') && option || {}).value;
-    }
-}
-defineOption('filetype', undefined, 'string', ['ft'], function (name, cm) {
-    if (cm === undefined) {
-        return;
-    }
-    if (name === undefined) {
-        var mode = cm.getOption('mode');
-        return mode == 'null' ? '' : mode;
-    }
-    else {
-        var mode = name == '' ? 'null' : name;
-        cm.setOption('mode', mode);
-    }
-});
-var createCircularJumpList = function () {
-    var size = 100;
-    var pointer = -1;
-    var head = 0;
-    var tail = 0;
-    var buffer = new Array(size);
-    function add(cm, oldCur, newCur) {
-        var current = pointer % size;
-        var curMark = buffer[current];
-        function useNextSlot(cursor) {
-            var next = ++pointer % size;
-            var trashMark = buffer[next];
-            if (trashMark) {
-                trashMark.clear();
-            }
-            buffer[next] = cm.setBookmark(cursor);
-        }
-        if (curMark) {
-            var markPos = curMark.find();
-            if (markPos && !cursorEqual(markPos, oldCur)) {
-                useNextSlot(oldCur);
-            }
-        }
-        else {
-            useNextSlot(oldCur);
-        }
-        useNextSlot(newCur);
-        head = pointer;
-        tail = pointer - size + 1;
-        if (tail < 0) {
-            tail = 0;
-        }
-    }
-    function move(cm, offset) {
-        pointer += offset;
-        if (pointer > head) {
-            pointer = head;
-        }
-        else if (pointer < tail) {
-            pointer = tail;
-        }
-        var mark = buffer[(size + pointer) % size];
-        if (mark && !mark.find()) {
-            var inc = offset > 0 ? 1 : -1;
-            var newCur;
-            var oldCur = cm.getCursor();
-            do {
-                pointer += inc;
-                mark = buffer[(size + pointer) % size];
-                if (mark &&
-                    (newCur = mark.find()) &&
-                    !cursorEqual(oldCur, newCur)) {
-                    break;
-                }
-            } while (pointer < head && pointer > tail);
-        }
-        return mark;
-    }
-    function find(cm, offset) {
-        var oldPointer = pointer;
-        var mark = move(cm, offset);
-        pointer = oldPointer;
-        return mark && mark.find();
-    }
-    return {
-        cachedCursor: undefined,
-        add: add,
-        find: find,
-        move: move
-    };
-};
-var createInsertModeChanges = function (c) {
-    if (c) {
-        return {
-            changes: c.changes,
-            expectCursorActivityForChange: c.expectCursorActivityForChange
-        };
-    }
-    return {
-        changes: [],
-        expectCursorActivityForChange: false
-    };
-};
-function MacroModeState() {
-    this.latestRegister = undefined;
-    this.isPlaying = false;
-    this.isRecording = false;
-    this.replaySearchQueries = [];
-    this.onRecordingDone = undefined;
-    this.lastInsertModeChanges = createInsertModeChanges();
-}
-MacroModeState.prototype = {
-    exitMacroRecordMode: function () {
-        var macroModeState = vimGlobalState.macroModeState;
-        if (macroModeState.onRecordingDone) {
-            macroModeState.onRecordingDone(); // close dialog
-        }
-        macroModeState.onRecordingDone = undefined;
-        macroModeState.isRecording = false;
-    },
-    enterMacroRecordMode: function (cm, registerName) {
-        var register = vimGlobalState.registerController.getRegister(registerName);
-        if (register) {
-            register.clear();
-            this.latestRegister = registerName;
-            if (cm.openDialog) {
-                this.onRecordingDone = cm.openDialog(document.createTextNode('(recording)[' + registerName + ']'), null, { bottom: true });
-            }
-            this.isRecording = true;
-        }
-    }
-};
-function maybeInitVimState(cm) {
-    if (!cm.state.vim) {
-        cm.state.vim = {
-            inputState: new InputState(),
-            lastEditInputState: undefined,
-            lastEditActionCommand: undefined,
-            lastHPos: -1,
-            lastHSPos: -1,
-            lastMotion: null,
-            marks: {},
-            insertMode: false,
-            insertModeRepeat: undefined,
-            visualMode: false,
-            visualLine: false,
-            visualBlock: false,
-            lastSelection: null,
-            lastPastedText: null,
-            sel: {},
-            options: {}
-        };
-    }
-    return cm.state.vim;
-}
-var vimGlobalState;
-function resetVimGlobalState() {
-    vimGlobalState = {
-        searchQuery: null,
-        searchIsReversed: false,
-        lastSubstituteReplacePart: undefined,
-        jumpList: createCircularJumpList(),
-        macroModeState: new MacroModeState,
-        lastCharacterSearch: { increment: 0, forward: true, selectedCharacter: '' },
-        registerController: new RegisterController({}),
-        searchHistoryController: new HistoryController(),
-        exCommandHistoryController: new HistoryController()
-    };
-    for (var optionName in options) {
-        var option = options[optionName];
-        option.value = option.defaultValue;
-    }
-}
-var lastInsertModeKeyTimer;
-var vimApi = {
-    buildKeyMap: function () {
-    },
-    getRegisterController: function () {
-        return vimGlobalState.registerController;
-    },
-    resetVimGlobalState_: resetVimGlobalState,
-    getVimGlobalState_: function () {
-        return vimGlobalState;
-    },
-    maybeInitVimState_: maybeInitVimState,
-    suppressErrorLogging: false,
-    InsertModeKey: InsertModeKey,
-    map: function (lhs, rhs, ctx) {
-        exCommandDispatcher.map(lhs, rhs, ctx);
-    },
-    unmap: function (lhs, ctx) {
-        return exCommandDispatcher.unmap(lhs, ctx);
-    },
-    noremap: function (lhs, rhs, ctx) {
-        function toCtxArray(ctx) {
-            return ctx ? [ctx] : ['normal', 'insert', 'visual'];
-        }
-        var ctxsToMap = toCtxArray(ctx);
-        var actualLength = defaultKeymap.length, origLength = defaultKeymapLength;
-        for (var i = actualLength - origLength; i < actualLength && ctxsToMap.length; i++) {
-            var mapping = defaultKeymap[i];
-            if (mapping.keys == rhs &&
-                (!ctx || !mapping.context || mapping.context === ctx) &&
-                mapping.type.substr(0, 2) !== 'ex' &&
-                mapping.type.substr(0, 3) !== 'key') {
-                var newMapping = {};
-                for (var key in mapping) {
-                    newMapping[key] = mapping[key];
-                }
-                newMapping.keys = lhs;
-                if (ctx && !newMapping.context) {
-                    newMapping.context = ctx;
-                }
-                this._mapCommand(newMapping);
-                var mappedCtxs = toCtxArray(mapping.context);
-                ctxsToMap = ctxsToMap.filter(function (el) { return mappedCtxs.indexOf(el) === -1; });
-            }
-        }
-    },
-    mapclear: function (ctx) {
-        var actualLength = defaultKeymap.length, origLength = defaultKeymapLength;
-        var userKeymap = defaultKeymap.slice(0, actualLength - origLength);
-        defaultKeymap = defaultKeymap.slice(actualLength - origLength);
-        if (ctx) {
-            for (var i = userKeymap.length - 1; i >= 0; i--) {
-                var mapping = userKeymap[i];
-                if (ctx !== mapping.context) {
-                    if (mapping.context) {
-                        this._mapCommand(mapping);
-                    }
-                    else {
-                        var contexts = ['normal', 'insert', 'visual'];
-                        for (var j in contexts) {
-                            if (contexts[j] !== ctx) {
-                                var newMapping = {};
-                                for (var key in mapping) {
-                                    newMapping[key] = mapping[key];
-                                }
-                                newMapping.context = contexts[j];
-                                this._mapCommand(newMapping);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    },
-    setOption: setOption,
-    getOption: getOption,
-    defineOption: defineOption,
-    defineEx: function (name, prefix, func) {
-        if (!prefix) {
-            prefix = name;
-        }
-        else if (name.indexOf(prefix) !== 0) {
-            throw new Error('(Vim.defineEx) "' + prefix + '" is not a prefix of "' + name + '", command not registered');
-        }
-        exCommands[name] = func;
-        exCommandDispatcher.commandMap_[prefix] = { name: name, shortName: prefix, type: 'api' };
-    },
-    handleKey: function (cm, key, origin) {
-        var command = this.findKey(cm, key, origin);
-        if (typeof command === 'function') {
-            return command();
-        }
-    },
-    findKey: function (cm, key, origin) {
-        var vim = maybeInitVimState(cm);
-        function handleMacroRecording() {
-            var macroModeState = vimGlobalState.macroModeState;
-            if (macroModeState.isRecording) {
-                if (key == 'q') {
-                    macroModeState.exitMacroRecordMode();
-                    clearInputState(cm);
-                    return true;
-                }
-                if (origin != 'mapping') {
-                    logKey(macroModeState, key);
-                }
-            }
-        }
-        function handleEsc() {
-            if (key == '<Esc>') {
-                clearInputState(cm);
-                if (vim.visualMode) {
-                    exitVisualMode(cm);
-                }
-                else if (vim.insertMode) {
-                    exitInsertMode(cm);
-                }
-                return true;
-            }
-        }
-        function doKeyToKey(keys) {
-            var match;
-            while (keys) {
-                match = (/<\w+-.+?>|<\w+>|./).exec(keys);
-                key = match[0];
-                keys = keys.substring(match.index + key.length);
-                vimApi.handleKey(cm, key, 'mapping');
-            }
-        }
-        function handleKeyInsertMode() {
-            if (handleEsc()) {
-                return true;
-            }
-            var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key;
-            var keysAreChars = key.length == 1;
-            var match = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert');
-            while (keys.length > 1 && match.type != 'full') {
-                var keys = vim.inputState.keyBuffer = keys.slice(1);
-                var thisMatch = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert');
-                if (thisMatch.type != 'none') {
-                    match = thisMatch;
-                }
-            }
-            if (match.type == 'none') {
-                clearInputState(cm);
-                return false;
-            }
-            else if (match.type == 'partial') {
-                if (lastInsertModeKeyTimer) {
-                    window.clearTimeout(lastInsertModeKeyTimer);
-                }
-                lastInsertModeKeyTimer = window.setTimeout(function () { if (vim.insertMode && vim.inputState.keyBuffer) {
-                    clearInputState(cm);
-                } }, getOption('insertModeEscKeysTimeout'));
-                return !keysAreChars;
-            }
-            if (lastInsertModeKeyTimer) {
-                window.clearTimeout(lastInsertModeKeyTimer);
-            }
-            if (keysAreChars) {
-                var selections = cm.listSelections();
-                for (var i = 0; i < selections.length; i++) {
-                    var here = selections[i].head;
-                    cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input');
-                }
-                vimGlobalState.macroModeState.lastInsertModeChanges.changes.pop();
-            }
-            clearInputState(cm);
-            return match.command;
-        }
-        function handleKeyNonInsertMode() {
-            if (handleMacroRecording() || handleEsc()) {
-                return true;
-            }
-            var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key;
-            if (/^[1-9]\d*$/.test(keys)) {
-                return true;
-            }
-            var keysMatcher = /^(\d*)(.*)$/.exec(keys);
-            if (!keysMatcher) {
-                clearInputState(cm);
-                return false;
-            }
-            var context = vim.visualMode ? 'visual' :
-                'normal';
-            var mainKey = keysMatcher[2] || keysMatcher[1];
-            if (vim.inputState.operatorShortcut && vim.inputState.operatorShortcut.slice(-1) == mainKey) {
-                mainKey = vim.inputState.operatorShortcut;
-            }
-            var match = commandDispatcher.matchCommand(mainKey, defaultKeymap, vim.inputState, context);
-            if (match.type == 'none') {
-                clearInputState(cm);
-                return false;
-            }
-            else if (match.type == 'partial') {
-                return true;
-            }
-            else if (match.type == 'clear') {
-                clearInputState(cm);
-                return true;
-            } // ace_patch
-            vim.inputState.keyBuffer = '';
-            var keysMatcher = /^(\d*)(.*)$/.exec(keys);
-            if (keysMatcher[1] && keysMatcher[1] != '0') {
-                vim.inputState.pushRepeatDigit(keysMatcher[1]);
-            }
-            return match.command;
-        }
-        var command;
-        if (vim.insertMode) {
-            command = handleKeyInsertMode();
-        }
-        else {
-            command = handleKeyNonInsertMode();
-        }
-        if (command === false) {
-            return undefined; //ace_patch
-        }
-        else if (command === true) {
-            return function () { return true; };
-        }
-        else {
-            return function () {
-                if ((command.operator || command.isEdit) && cm.getOption('readOnly'))
-                    return; // ace_patch
-                return cm.operation(function () {
-                    cm.curOp.isVimOp = true;
-                    try {
-                        if (command.type == 'keyToKey') {
-                            doKeyToKey(command.toKeys);
-                        }
-                        else {
-                            commandDispatcher.processCommand(cm, vim, command);
-                        }
-                    }
-                    catch (e) {
-                        cm.state.vim = undefined;
-                        maybeInitVimState(cm);
-                        if (!vimApi.suppressErrorLogging) {
-                            console['log'](e);
-                        }
-                        throw e;
-                    }
-                    return true;
-                });
-            };
-        }
-    },
-    handleEx: function (cm, input) {
-        exCommandDispatcher.processCommand(cm, input);
-    },
-    defineMotion: defineMotion,
-    defineAction: defineAction,
-    defineOperator: defineOperator,
-    mapCommand: mapCommand,
-    _mapCommand: _mapCommand,
-    defineRegister: defineRegister,
-    exitVisualMode: exitVisualMode,
-    exitInsertMode: exitInsertMode
-};
-function InputState() {
-    this.prefixRepeat = [];
-    this.motionRepeat = [];
-    this.operator = null;
-    this.operatorArgs = null;
-    this.motion = null;
-    this.motionArgs = null;
-    this.keyBuffer = []; // For matching multi-key commands.
-    this.registerName = null; // Defaults to the unnamed register.
-}
-InputState.prototype.pushRepeatDigit = function (n) {
-    if (!this.operator) {
-        this.prefixRepeat = this.prefixRepeat.concat(n);
-    }
-    else {
-        this.motionRepeat = this.motionRepeat.concat(n);
-    }
-};
-InputState.prototype.getRepeat = function () {
-    var repeat = 0;
-    if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) {
-        repeat = 1;
-        if (this.prefixRepeat.length > 0) {
-            repeat *= parseInt(this.prefixRepeat.join(''), 10);
-        }
-        if (this.motionRepeat.length > 0) {
-            repeat *= parseInt(this.motionRepeat.join(''), 10);
-        }
-    }
-    return repeat;
-};
-function clearInputState(cm, reason) {
-    cm.state.vim.inputState = new InputState();
-    CodeMirror.signal(cm, 'vim-command-done', reason);
-}
-function Register(text, linewise, blockwise) {
-    this.clear();
-    this.keyBuffer = [text || ''];
-    this.insertModeChanges = [];
-    this.searchQueries = [];
-    this.linewise = !!linewise;
-    this.blockwise = !!blockwise;
-}
-Register.prototype = {
-    setText: function (text, linewise, blockwise) {
-        this.keyBuffer = [text || ''];
-        this.linewise = !!linewise;
-        this.blockwise = !!blockwise;
-    },
-    pushText: function (text, linewise) {
-        if (linewise) {
-            if (!this.linewise) {
-                this.keyBuffer.push('\n');
-            }
-            this.linewise = true;
-        }
-        this.keyBuffer.push(text);
-    },
-    pushInsertModeChanges: function (changes) {
-        this.insertModeChanges.push(createInsertModeChanges(changes));
-    },
-    pushSearchQuery: function (query) {
-        this.searchQueries.push(query);
-    },
-    clear: function () {
-        this.keyBuffer = [];
-        this.insertModeChanges = [];
-        this.searchQueries = [];
-        this.linewise = false;
-    },
-    toString: function () {
-        return this.keyBuffer.join('');
-    }
-};
-function defineRegister(name, register) {
-    var registers = vimGlobalState.registerController.registers;
-    if (!name || name.length != 1) {
-        throw Error('Register name must be 1 character');
-    }
-    registers[name] = register;
-    validRegisters.push(name);
-}
-function RegisterController(registers) {
-    this.registers = registers;
-    this.unnamedRegister = registers['"'] = new Register();
-    registers['.'] = new Register();
-    registers[':'] = new Register();
-    registers['/'] = new Register();
-}
-RegisterController.prototype = {
-    pushText: function (registerName, operator, text, linewise, blockwise) {
-        if (registerName === '_')
-            return;
-        if (linewise && text.charAt(text.length - 1) !== '\n') {
-            text += '\n';
-        }
-        var register = this.isValidRegister(registerName) ?
-            this.getRegister(registerName) : null;
-        if (!register) {
-            switch (operator) {
-                case 'yank':
-                    this.registers['0'] = new Register(text, linewise, blockwise);
-                    break;
-                case 'delete':
-                case 'change':
-                    if (text.indexOf('\n') == -1) {
-                        this.registers['-'] = new Register(text, linewise);
-                    }
-                    else {
-                        this.shiftNumericRegisters_();
-                        this.registers['1'] = new Register(text, linewise);
-                    }
-                    break;
-            }
-            this.unnamedRegister.setText(text, linewise, blockwise);
-            return;
-        }
-        var append = isUpperCase(registerName);
-        if (append) {
-            register.pushText(text, linewise);
-        }
-        else {
-            register.setText(text, linewise, blockwise);
-        }
-        this.unnamedRegister.setText(register.toString(), linewise);
-    },
-    getRegister: function (name) {
-        if (!this.isValidRegister(name)) {
-            return this.unnamedRegister;
-        }
-        name = name.toLowerCase();
-        if (!this.registers[name]) {
-            this.registers[name] = new Register();
-        }
-        return this.registers[name];
-    },
-    isValidRegister: function (name) {
-        return name && inArray(name, validRegisters);
-    },
-    shiftNumericRegisters_: function () {
-        for (var i = 9; i >= 2; i--) {
-            this.registers[i] = this.getRegister('' + (i - 1));
-        }
-    }
-};
-function HistoryController() {
-    this.historyBuffer = [];
-    this.iterator = 0;
-    this.initialPrefix = null;
-}
-HistoryController.prototype = {
-    nextMatch: function (input, up) {
-        var historyBuffer = this.historyBuffer;
-        var dir = up ? -1 : 1;
-        if (this.initialPrefix === null)
-            this.initialPrefix = input;
-        for (var i = this.iterator + dir; up ? i >= 0 : i < historyBuffer.length; i += dir) {
-            var element = historyBuffer[i];
-            for (var j = 0; j <= element.length; j++) {
-                if (this.initialPrefix == element.substring(0, j)) {
-                    this.iterator = i;
-                    return element;
-                }
-            }
-        }
-        if (i >= historyBuffer.length) {
-            this.iterator = historyBuffer.length;
-            return this.initialPrefix;
-        }
-        if (i < 0)
-            return input;
-    },
-    pushInput: function (input) {
-        var index = this.historyBuffer.indexOf(input);
-        if (index > -1)
-            this.historyBuffer.splice(index, 1);
-        if (input.length)
-            this.historyBuffer.push(input);
-    },
-    reset: function () {
-        this.initialPrefix = null;
-        this.iterator = this.historyBuffer.length;
-    }
-};
-var commandDispatcher = {
-    matchCommand: function (keys, keyMap, inputState, context) {
-        var matches = commandMatches(keys, keyMap, context, inputState);
-        if (!matches.full && !matches.partial) {
-            return { type: 'none' };
-        }
-        else if (!matches.full && matches.partial) {
-            return { type: 'partial' };
-        }
-        var bestMatch;
-        for (var i = 0; i < matches.full.length; i++) {
-            var match = matches.full[i];
-            if (!bestMatch) {
-                bestMatch = match;
-            }
-        }
-        if (bestMatch.keys.slice(-11) == '<character>') {
-            var character = lastChar(keys);
-            if (!character || character.length > 1)
-                return { type: 'clear' }; //ace_patch
-            inputState.selectedCharacter = character;
-        }
-        return { type: 'full', command: bestMatch };
-    },
-    processCommand: function (cm, vim, command) {
-        vim.inputState.repeatOverride = command.repeatOverride;
-        switch (command.type) {
-            case 'motion':
-                this.processMotion(cm, vim, command);
-                break;
-            case 'operator':
-                this.processOperator(cm, vim, command);
-                break;
-            case 'operatorMotion':
-                this.processOperatorMotion(cm, vim, command);
-                break;
-            case 'action':
-                this.processAction(cm, vim, command);
-                break;
-            case 'search':
-                this.processSearch(cm, vim, command);
-                break;
-            case 'ex':
-            case 'keyToEx':
-                this.processEx(cm, vim, command);
-                break;
-            default:
-                break;
-        }
-    },
-    processMotion: function (cm, vim, command) {
-        vim.inputState.motion = command.motion;
-        vim.inputState.motionArgs = copyArgs(command.motionArgs);
-        this.evalInput(cm, vim);
-    },
-    processOperator: function (cm, vim, command) {
-        var inputState = vim.inputState;
-        if (inputState.operator) {
-            if (inputState.operator == command.operator) {
-                inputState.motion = 'expandToLine';
-                inputState.motionArgs = { linewise: true };
-                this.evalInput(cm, vim);
-                return;
-            }
-            else {
-                clearInputState(cm);
-            }
-        }
-        inputState.operator = command.operator;
-        inputState.operatorArgs = copyArgs(command.operatorArgs);
-        if (command.keys.length > 1) {
-            inputState.operatorShortcut = command.keys;
-        }
-        if (command.exitVisualBlock) {
-            vim.visualBlock = false;
-            updateCmSelection(cm);
-        }
-        if (vim.visualMode) {
-            this.evalInput(cm, vim);
-        }
-    },
-    processOperatorMotion: function (cm, vim, command) {
-        var visualMode = vim.visualMode;
-        var operatorMotionArgs = copyArgs(command.operatorMotionArgs);
-        if (operatorMotionArgs) {
-            if (visualMode && operatorMotionArgs.visualLine) {
-                vim.visualLine = true;
-            }
-        }
-        this.processOperator(cm, vim, command);
-        if (!visualMode) {
-            this.processMotion(cm, vim, command);
-        }
-    },
-    processAction: function (cm, vim, command) {
-        var inputState = vim.inputState;
-        var repeat = inputState.getRepeat();
-        var repeatIsExplicit = !!repeat;
-        var actionArgs = copyArgs(command.actionArgs) || {};
-        if (inputState.selectedCharacter) {
-            actionArgs.selectedCharacter = inputState.selectedCharacter;
-        }
-        if (command.operator) {
-            this.processOperator(cm, vim, command);
-        }
-        if (command.motion) {
-            this.processMotion(cm, vim, command);
-        }
-        if (command.motion || command.operator) {
-            this.evalInput(cm, vim);
-        }
-        actionArgs.repeat = repeat || 1;
-        actionArgs.repeatIsExplicit = repeatIsExplicit;
-        actionArgs.registerName = inputState.registerName;
-        clearInputState(cm);
-        vim.lastMotion = null;
-        if (command.isEdit) {
-            this.recordLastEdit(vim, inputState, command);
-        }
-        actions[command.action](cm, actionArgs, vim);
-    },
-    processSearch: function (cm, vim, command) {
-        if (!cm.getSearchCursor) {
-            return;
-        }
-        var forward = command.searchArgs.forward;
-        var wholeWordOnly = command.searchArgs.wholeWordOnly;
-        getSearchState(cm).setReversed(!forward);
-        var promptPrefix = (forward) ? '/' : '?';
-        var originalQuery = getSearchState(cm).getQuery();
-        var originalScrollPos = cm.getScrollInfo();
-        function handleQuery(query, ignoreCase, smartCase) {
-            vimGlobalState.searchHistoryController.pushInput(query);
-            vimGlobalState.searchHistoryController.reset();
-            try {
-                updateSearchQuery(cm, query, ignoreCase, smartCase);
-            }
-            catch (e) {
-                showConfirm(cm, 'Invalid regex: ' + query);
-                clearInputState(cm);
-                return;
-            }
-            commandDispatcher.processMotion(cm, vim, {
-                type: 'motion',
-                motion: 'findNext',
-                motionArgs: { forward: true, toJumplist: command.searchArgs.toJumplist }
-            });
-        }
-        function onPromptClose(query) {
-            handleQuery(query, true /** ignoreCase */, true /** smartCase */);
-            var macroModeState = vimGlobalState.macroModeState;
-            if (macroModeState.isRecording) {
-                logSearchQuery(macroModeState, query);
-            }
-        }
-        function onPromptKeyUp(e, query, close) {
-            var keyName = CodeMirror.keyName(e), up, offset;
-            if (keyName == 'Up' || keyName == 'Down') {
-                up = keyName == 'Up' ? true : false;
-                offset = e.target ? e.target.selectionEnd : 0;
-                query = vimGlobalState.searchHistoryController.nextMatch(query, up) || '';
-                close(query);
-                if (offset && e.target)
-                    e.target.selectionEnd = e.target.selectionStart = Math.min(offset, e.target.value.length);
-            }
-            else {
-                if (keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift')
-                    vimGlobalState.searchHistoryController.reset();
-            }
-            var parsedQuery;
-            try {
-                parsedQuery = updateSearchQuery(cm, query, true /** ignoreCase */, true /** smartCase */);
-            }
-            catch (e) {
-            }
-            if (parsedQuery) {
-                cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30);
-            }
-            else {
-                clearSearchHighlight(cm);
-                cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
-            }
-        }
-        function onPromptKeyDown(e, query, close) {
-            var keyName = CodeMirror.keyName(e);
-            if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' ||
-                (keyName == 'Backspace' && query == '')) {
-                vimGlobalState.searchHistoryController.pushInput(query);
-                vimGlobalState.searchHistoryController.reset();
-                updateSearchQuery(cm, originalQuery);
-                clearSearchHighlight(cm);
-                cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
-                CodeMirror.e_stop(e);
-                clearInputState(cm);
-                close();
-                cm.focus();
-            }
-            else if (keyName == 'Up' || keyName == 'Down') {
-                CodeMirror.e_stop(e);
-            }
-            else if (keyName == 'Ctrl-U') {
-                CodeMirror.e_stop(e);
-                close('');
-            }
-        }
-        switch (command.searchArgs.querySrc) {
-            case 'prompt':
-                var macroModeState = vimGlobalState.macroModeState;
-                if (macroModeState.isPlaying) {
-                    var query = macroModeState.replaySearchQueries.shift();
-                    handleQuery(query, true /** ignoreCase */, false /** smartCase */);
-                }
-                else {
-                    showPrompt(cm, {
-                        onClose: onPromptClose,
-                        prefix: promptPrefix,
-                        desc: '(JavaScript regexp)',
-                        onKeyUp: onPromptKeyUp,
-                        onKeyDown: onPromptKeyDown
-                    });
-                }
-                break;
-            case 'wordUnderCursor':
-                var word = expandWordUnderCursor(cm, false /** inclusive */, true /** forward */, false /** bigWord */, true /** noSymbol */);
-                var isKeyword = true;
-                if (!word) {
-                    word = expandWordUnderCursor(cm, false /** inclusive */, true /** forward */, false /** bigWord */, false /** noSymbol */);
-                    isKeyword = false;
-                }
-                if (!word) {
-                    return;
-                }
-                var query = cm.getLine(word.start.line).substring(word.start.ch, word.end.ch);
-                if (isKeyword && wholeWordOnly) {
-                    query = '\\b' + query + '\\b';
-                }
-                else {
-                    query = escapeRegex(query);
-                }
-                vimGlobalState.jumpList.cachedCursor = cm.getCursor();
-                cm.setCursor(word.start);
-                handleQuery(query, true /** ignoreCase */, false /** smartCase */);
-                break;
-        }
-    },
-    processEx: function (cm, vim, command) {
-        function onPromptClose(input) {
-            vimGlobalState.exCommandHistoryController.pushInput(input);
-            vimGlobalState.exCommandHistoryController.reset();
-            exCommandDispatcher.processCommand(cm, input);
-        }
-        function onPromptKeyDown(e, input, close) {
-            var keyName = CodeMirror.keyName(e), up, offset;
-            if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' ||
-                (keyName == 'Backspace' && input == '')) {
-                vimGlobalState.exCommandHistoryController.pushInput(input);
-                vimGlobalState.exCommandHistoryController.reset();
-                CodeMirror.e_stop(e);
-                clearInputState(cm);
-                close();
-                cm.focus();
-            }
-            if (keyName == 'Up' || keyName == 'Down') {
-                CodeMirror.e_stop(e);
-                up = keyName == 'Up' ? true : false;
-                offset = e.target ? e.target.selectionEnd : 0;
-                input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || '';
-                close(input);
-                if (offset && e.target)
-                    e.target.selectionEnd = e.target.selectionStart = Math.min(offset, e.target.value.length);
-            }
-            else if (keyName == 'Ctrl-U') {
-                CodeMirror.e_stop(e);
-                close('');
-            }
-            else {
-                if (keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift')
-                    vimGlobalState.exCommandHistoryController.reset();
-            }
-        }
-        if (command.type == 'keyToEx') {
-            exCommandDispatcher.processCommand(cm, command.exArgs.input);
-        }
-        else {
-            if (vim.visualMode) {
-                showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>',
-                    onKeyDown: onPromptKeyDown, selectValueOnOpen: false });
-            }
-            else {
-                showPrompt(cm, { onClose: onPromptClose, prefix: ':',
-                    onKeyDown: onPromptKeyDown });
-            }
-        }
-    },
-    evalInput: function (cm, vim) {
-        var inputState = vim.inputState;
-        var motion = inputState.motion;
-        var motionArgs = inputState.motionArgs || {};
-        var operator = inputState.operator;
-        var operatorArgs = inputState.operatorArgs || {};
-        var registerName = inputState.registerName;
-        var sel = vim.sel;
-        var origHead = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.head) : cm.getCursor('head'));
-        var origAnchor = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.anchor) : cm.getCursor('anchor'));
-        var oldHead = copyCursor(origHead);
-        var oldAnchor = copyCursor(origAnchor);
-        var newHead, newAnchor;
-        var repeat;
-        if (operator) {
-            this.recordLastEdit(vim, inputState);
-        }
-        if (inputState.repeatOverride !== undefined) {
-            repeat = inputState.repeatOverride;
-        }
-        else {
-            repeat = inputState.getRepeat();
-        }
-        if (repeat > 0 && motionArgs.explicitRepeat) {
-            motionArgs.repeatIsExplicit = true;
-        }
-        else if (motionArgs.noRepeat ||
-            (!motionArgs.explicitRepeat && repeat === 0)) {
-            repeat = 1;
-            motionArgs.repeatIsExplicit = false;
-        }
-        if (inputState.selectedCharacter) {
-            motionArgs.selectedCharacter = operatorArgs.selectedCharacter =
-                inputState.selectedCharacter;
-        }
-        motionArgs.repeat = repeat;
-        clearInputState(cm);
-        if (motion) {
-            var motionResult = motions[motion](cm, origHead, motionArgs, vim, inputState);
-            vim.lastMotion = motions[motion];
-            if (!motionResult) {
-                return;
-            }
-            if (motionArgs.toJumplist) {
-                if (!operator && cm.ace.curOp != null)
-                    cm.ace.curOp.command.scrollIntoView = "center-animate"; // ace_patch
-                var jumpList = vimGlobalState.jumpList;
-                var cachedCursor = jumpList.cachedCursor;
-                if (cachedCursor) {
-                    recordJumpPosition(cm, cachedCursor, motionResult);
-                    delete jumpList.cachedCursor;
-                }
-                else {
-                    recordJumpPosition(cm, origHead, motionResult);
-                }
-            }
-            if (motionResult instanceof Array) {
-                newAnchor = motionResult[0];
-                newHead = motionResult[1];
-            }
-            else {
-                newHead = motionResult;
-            }
-            if (!newHead) {
-                newHead = copyCursor(origHead);
-            }
-            if (vim.visualMode) {
-                if (!(vim.visualBlock && newHead.ch === Infinity)) {
-                    newHead = clipCursorToContent(cm, newHead);
-                }
-                if (newAnchor) {
-                    newAnchor = clipCursorToContent(cm, newAnchor);
-                }
-                newAnchor = newAnchor || oldAnchor;
-                sel.anchor = newAnchor;
-                sel.head = newHead;
-                updateCmSelection(cm);
-                updateMark(cm, vim, '<', cursorIsBefore(newAnchor, newHead) ? newAnchor
-                    : newHead);
-                updateMark(cm, vim, '>', cursorIsBefore(newAnchor, newHead) ? newHead
-                    : newAnchor);
-            }
-            else if (!operator) {
-                newHead = clipCursorToContent(cm, newHead);
-                cm.setCursor(newHead.line, newHead.ch);
-            }
-        }
-        if (operator) {
-            if (operatorArgs.lastSel) {
-                newAnchor = oldAnchor;
-                var lastSel = operatorArgs.lastSel;
-                var lineOffset = Math.abs(lastSel.head.line - lastSel.anchor.line);
-                var chOffset = Math.abs(lastSel.head.ch - lastSel.anchor.ch);
-                if (lastSel.visualLine) {
-                    newHead = new Pos(oldAnchor.line + lineOffset, oldAnchor.ch);
-                }
-                else if (lastSel.visualBlock) {
-                    newHead = new Pos(oldAnchor.line + lineOffset, oldAnchor.ch + chOffset);
-                }
-                else if (lastSel.head.line == lastSel.anchor.line) {
-                    newHead = new Pos(oldAnchor.line, oldAnchor.ch + chOffset);
-                }
-                else {
-                    newHead = new Pos(oldAnchor.line + lineOffset, oldAnchor.ch);
-                }
-                vim.visualMode = true;
-                vim.visualLine = lastSel.visualLine;
-                vim.visualBlock = lastSel.visualBlock;
-                sel = vim.sel = {
-                    anchor: newAnchor,
-                    head: newHead
-                };
-                updateCmSelection(cm);
-            }
-            else if (vim.visualMode) {
-                operatorArgs.lastSel = {
-                    anchor: copyCursor(sel.anchor),
-                    head: copyCursor(sel.head),
-                    visualBlock: vim.visualBlock,
-                    visualLine: vim.visualLine
-                };
-            }
-            var curStart, curEnd, linewise, mode;
-            var cmSel;
-            if (vim.visualMode) {
-                curStart = cursorMin(sel.head, sel.anchor);
-                curEnd = cursorMax(sel.head, sel.anchor);
-                linewise = vim.visualLine || operatorArgs.linewise;
-                mode = vim.visualBlock ? 'block' :
-                    linewise ? 'line' :
-                        'char';
-                cmSel = makeCmSelection(cm, {
-                    anchor: curStart,
-                    head: curEnd
-                }, mode);
-                if (linewise) {
-                    var ranges = cmSel.ranges;
-                    if (mode == 'block') {
-                        for (var i = 0; i < ranges.length; i++) {
-                            ranges[i].head.ch = lineLength(cm, ranges[i].head.line);
-                        }
-                    }
-                    else if (mode == 'line') {
-                        ranges[0].head = new Pos(ranges[0].head.line + 1, 0);
-                    }
-                }
-            }
-            else {
-                curStart = copyCursor(newAnchor || oldAnchor);
-                curEnd = copyCursor(newHead || oldHead);
-                if (cursorIsBefore(curEnd, curStart)) {
-                    var tmp = curStart;
-                    curStart = curEnd;
-                    curEnd = tmp;
-                }
-                linewise = motionArgs.linewise || operatorArgs.linewise;
-                if (linewise) {
-                    expandSelectionToLine(cm, curStart, curEnd);
-                }
-                else if (motionArgs.forward) {
-                    clipToLine(cm, curStart, curEnd);
-                }
-                mode = 'char';
-                var exclusive = !motionArgs.inclusive || linewise;
-                cmSel = makeCmSelection(cm, {
-                    anchor: curStart,
-                    head: curEnd
-                }, mode, exclusive);
-            }
-            cm.setSelections(cmSel.ranges, cmSel.primary);
-            vim.lastMotion = null;
-            operatorArgs.repeat = repeat; // For indent in visual mode.
-            operatorArgs.registerName = registerName;
-            operatorArgs.linewise = linewise;
-            var operatorMoveTo = operators[operator](cm, operatorArgs, cmSel.ranges, oldAnchor, newHead);
-            if (vim.visualMode) {
-                exitVisualMode(cm, operatorMoveTo != null);
-            }
-            if (operatorMoveTo) {
-                cm.setCursor(operatorMoveTo);
-            }
-        }
-    },
-    recordLastEdit: function (vim, inputState, actionCommand) {
-        var macroModeState = vimGlobalState.macroModeState;
-        if (macroModeState.isPlaying) {
-            return;
-        }
-        vim.lastEditInputState = inputState;
-        vim.lastEditActionCommand = actionCommand;
-        macroModeState.lastInsertModeChanges.changes = [];
-        macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false;
-        macroModeState.lastInsertModeChanges.visualBlock = vim.visualBlock ? vim.sel.head.line - vim.sel.anchor.line : 0;
-    }
-};
-var motions = {
-    moveToTopLine: function (cm, _head, motionArgs) {
-        var line = getUserVisibleLines(cm).top + motionArgs.repeat - 1;
-        return new Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
-    },
-    moveToMiddleLine: function (cm) {
-        var range = getUserVisibleLines(cm);
-        var line = Math.floor((range.top + range.bottom) * 0.5);
-        return new Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
-    },
-    moveToBottomLine: function (cm, _head, motionArgs) {
-        var line = getUserVisibleLines(cm).bottom - motionArgs.repeat + 1;
-        return new Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
-    },
-    expandToLine: function (_cm, head, motionArgs) {
-        var cur = head;
-        return new Pos(cur.line + motionArgs.repeat - 1, Infinity);
-    },
-    findNext: function (cm, _head, motionArgs) {
-        var state = getSearchState(cm);
-        var query = state.getQuery();
-        if (!query) {
-            return;
-        }
-        var prev = !motionArgs.forward;
-        prev = (state.isReversed()) ? !prev : prev;
-        highlightSearchMatches(cm, query);
-        return findNext(cm, prev /** prev */, query, motionArgs.repeat);
-    },
-    findAndSelectNextInclusive: function (cm, _head, motionArgs, vim, prevInputState) {
-        var state = getSearchState(cm);
-        var query = state.getQuery();
-        if (!query) {
-            return;
-        }
-        var prev = !motionArgs.forward;
-        prev = (state.isReversed()) ? !prev : prev;
-        var next = findNextFromAndToInclusive(cm, prev, query, motionArgs.repeat, vim);
-        if (!next) {
-            return;
-        }
-        if (prevInputState.operator) {
-            return next;
-        }
-        var from = next[0];
-        var to = new Pos(next[1].line, next[1].ch - 1);
-        if (vim.visualMode) {
-            if (vim.visualLine || vim.visualBlock) {
-                vim.visualLine = false;
-                vim.visualBlock = false;
-                CodeMirror.signal(cm, "vim-mode-change", { mode: "visual", subMode: "" });
-            }
-            var anchor = vim.sel.anchor;
-            if (anchor) {
-                if (state.isReversed()) {
-                    if (motionArgs.forward) {
-                        return [anchor, from];
-                    }
-                    return [anchor, to];
-                }
-                else {
-                    if (motionArgs.forward) {
-                        return [anchor, to];
-                    }
-                    return [anchor, from];
-                }
-            }
-        }
-        else {
-            vim.visualMode = true;
-            vim.visualLine = false;
-            vim.visualBlock = false;
-            CodeMirror.signal(cm, "vim-mode-change", { mode: "visual", subMode: "" });
-        }
-        return prev ? [to, from] : [from, to];
-    },
-    goToMark: function (cm, _head, motionArgs, vim) {
-        var pos = getMarkPos(cm, vim, motionArgs.selectedCharacter);
-        if (pos) {
-            return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos;
-        }
-        return null;
-    },
-    moveToOtherHighlightedEnd: function (cm, _head, motionArgs, vim) {
-        if (vim.visualBlock && motionArgs.sameLine) {
-            var sel = vim.sel;
-            return [
-                clipCursorToContent(cm, new Pos(sel.anchor.line, sel.head.ch)),
-                clipCursorToContent(cm, new Pos(sel.head.line, sel.anchor.ch))
-            ];
-        }
-        else {
-            return ([vim.sel.head, vim.sel.anchor]);
-        }
-    },
-    jumpToMark: function (cm, head, motionArgs, vim) {
-        var best = head;
-        for (var i = 0; i < motionArgs.repeat; i++) {
-            var cursor = best;
-            for (var key in vim.marks) {
-                if (!isLowerCase(key)) {
-                    continue;
-                }
-                var mark = vim.marks[key].find();
-                var isWrongDirection = (motionArgs.forward) ?
-                    cursorIsBefore(mark, cursor) : cursorIsBefore(cursor, mark);
-                if (isWrongDirection) {
-                    continue;
-                }
-                if (motionArgs.linewise && (mark.line == cursor.line)) {
-                    continue;
-                }
-                var equal = cursorEqual(cursor, best);
-                var between = (motionArgs.forward) ?
-                    cursorIsBetween(cursor, mark, best) :
-                    cursorIsBetween(best, mark, cursor);
-                if (equal || between) {
-                    best = mark;
-                }
-            }
-        }
-        if (motionArgs.linewise) {
-            best = new Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line)));
-        }
-        return best;
-    },
-    moveByCharacters: function (_cm, head, motionArgs) {
-        var cur = head;
-        var repeat = motionArgs.repeat;
-        var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat;
-        return new Pos(cur.line, ch);
-    },
-    moveByLines: function (cm, head, motionArgs, vim) {
-        var cur = head;
-        var endCh = cur.ch;
-        switch (vim.lastMotion) {
-            case this.moveByLines:
-            case this.moveByDisplayLines:
-            case this.moveByScroll:
-            case this.moveToColumn:
-            case this.moveToEol:
-                endCh = vim.lastHPos;
-                break;
-            default:
-                vim.lastHPos = endCh;
-        }
-        var repeat = motionArgs.repeat + (motionArgs.repeatOffset || 0);
-        var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat;
-        var first = cm.firstLine();
-        var last = cm.lastLine();
-        if (line < first && cur.line == first) {
-            return this.moveToStartOfLine(cm, head, motionArgs, vim);
-        }
-        else if (line > last && cur.line == last) {
-            return moveToEol(cm, head, motionArgs, vim, true);
-        }
-        var fold = cm.ace.session.getFoldLine(line);
-        if (fold) {
-            if (motionArgs.forward) {
-                if (line > fold.start.row)
-                    line = fold.end.row + 1;
-            }
-            else {
-                line = fold.start.row;
-            }
-        }
-        if (motionArgs.toFirstChar) {
-            endCh = findFirstNonWhiteSpaceCharacter(cm.getLine(line));
-            vim.lastHPos = endCh;
-        }
-        vim.lastHSPos = cm.charCoords(new Pos(line, endCh), 'div').left;
-        return new Pos(line, endCh);
-    },
-    moveByDisplayLines: function (cm, head, motionArgs, vim) {
-        var cur = head;
-        switch (vim.lastMotion) {
-            case this.moveByDisplayLines:
-            case this.moveByScroll:
-            case this.moveByLines:
-            case this.moveToColumn:
-            case this.moveToEol:
-                break;
-            default:
-                vim.lastHSPos = cm.charCoords(cur, 'div').left;
-        }
-        var repeat = motionArgs.repeat;
-        var res = cm.findPosV(cur, (motionArgs.forward ? repeat : -repeat), 'line', vim.lastHSPos);
-        if (res.hitSide) {
-            if (motionArgs.forward) {
-                var lastCharCoords = cm.charCoords(res, 'div');
-                var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos };
-                var res = cm.coordsChar(goalCoords, 'div');
-            }
-            else {
-                var resCoords = cm.charCoords(new Pos(cm.firstLine(), 0), 'div');
-                resCoords.left = vim.lastHSPos;
-                res = cm.coordsChar(resCoords, 'div');
-            }
-        }
-        vim.lastHPos = res.ch;
-        return res;
-    },
-    moveByPage: function (cm, head, motionArgs) {
-        var curStart = head;
-        var repeat = motionArgs.repeat;
-        return cm.findPosV(curStart, (motionArgs.forward ? repeat : -repeat), 'page');
-    },
-    moveByParagraph: function (cm, head, motionArgs) {
-        var dir = motionArgs.forward ? 1 : -1;
-        return findParagraph(cm, head, motionArgs.repeat, dir);
-    },
-    moveBySentence: function (cm, head, motionArgs) {
-        var dir = motionArgs.forward ? 1 : -1;
-        return findSentence(cm, head, motionArgs.repeat, dir);
-    },
-    moveByScroll: function (cm, head, motionArgs, vim) {
-        var scrollbox = cm.getScrollInfo();
-        var curEnd = null;
-        var repeat = motionArgs.repeat;
-        if (!repeat) {
-            repeat = scrollbox.clientHeight / (2 * cm.defaultTextHeight());
-        }
-        var orig = cm.charCoords(head, 'local');
-        motionArgs.repeat = repeat;
-        var curEnd = motions.moveByDisplayLines(cm, head, motionArgs, vim);
-        if (!curEnd) {
-            return null;
-        }
-        var dest = cm.charCoords(curEnd, 'local');
-        cm.scrollTo(null, scrollbox.top + dest.top - orig.top);
-        return curEnd;
-    },
-    moveByWords: function (cm, head, motionArgs) {
-        return moveToWord(cm, head, motionArgs.repeat, !!motionArgs.forward, !!motionArgs.wordEnd, !!motionArgs.bigWord);
-    },
-    moveTillCharacter: function (cm, _head, motionArgs) {
-        var repeat = motionArgs.repeat;
-        var curEnd = moveToCharacter(cm, repeat, motionArgs.forward, motionArgs.selectedCharacter);
-        var increment = motionArgs.forward ? -1 : 1;
-        recordLastCharacterSearch(increment, motionArgs);
-        if (!curEnd)
-            return null;
-        curEnd.ch += increment;
-        return curEnd;
-    },
-    moveToCharacter: function (cm, head, motionArgs) {
-        var repeat = motionArgs.repeat;
-        recordLastCharacterSearch(0, motionArgs);
-        return moveToCharacter(cm, repeat, motionArgs.forward, motionArgs.selectedCharacter) || head;
-    },
-    moveToSymbol: function (cm, head, motionArgs) {
-        var repeat = motionArgs.repeat;
-        return findSymbol(cm, repeat, motionArgs.forward, motionArgs.selectedCharacter) || head;
-    },
-    moveToColumn: function (cm, head, motionArgs, vim) {
-        var repeat = motionArgs.repeat;
-        vim.lastHPos = repeat - 1;
-        vim.lastHSPos = cm.charCoords(head, 'div').left;
-        return moveToColumn(cm, repeat);
-    },
-    moveToEol: function (cm, head, motionArgs, vim) {
-        return moveToEol(cm, head, motionArgs, vim, false);
-    },
-    moveToFirstNonWhiteSpaceCharacter: function (cm, head) {
-        var cursor = head;
-        return new Pos(cursor.line, findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line)));
-    },
-    moveToMatchedSymbol: function (cm, head) {
-        var cursor = head;
-        var line = cursor.line;
-        var ch = cursor.ch;
-        var lineText = cm.getLine(line);
-        var symbol;
-        for (; ch < lineText.length; ch++) {
-            symbol = lineText.charAt(ch);
-            if (symbol && isMatchableSymbol(symbol)) {
-                var style = cm.getTokenTypeAt(new Pos(line, ch + 1));
-                if (style !== "string" && style !== "comment") {
-                    break;
-                }
-            }
-        }
-        if (ch < lineText.length) {
-            var re = /[<>]/.test(lineText[ch]) ? /[(){}[\]<>]/ : /[(){}[\]]/; //ace_patch?
-            var matched = cm.findMatchingBracket(new Pos(line, ch + 1), { bracketRegex: re });
-            return matched.to;
-        }
-        else {
-            return cursor;
-        }
-    },
-    moveToStartOfLine: function (_cm, head) {
-        return new Pos(head.line, 0);
-    },
-    moveToLineOrEdgeOfDocument: function (cm, _head, motionArgs) {
-        var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine();
-        if (motionArgs.repeatIsExplicit) {
-            lineNum = motionArgs.repeat - cm.getOption('firstLineNumber');
-        }
-        return new Pos(lineNum, findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum)));
-    },
-    moveToStartOfDisplayLine: function (cm) {
-        cm.execCommand("goLineLeft");
-        return cm.getCursor();
-    },
-    moveToEndOfDisplayLine: function (cm) {
-        cm.execCommand("goLineRight");
-        var head = cm.getCursor();
-        if (head.sticky == "before")
-            head.ch--;
-        return head;
-    },
-    textObjectManipulation: function (cm, head, motionArgs, vim) {
-        var mirroredPairs = { '(': ')', ')': '(',
-            '{': '}', '}': '{',
-            '[': ']', ']': '[',
-            '<': '>', '>': '<' };
-        var selfPaired = { '\'': true, '"': true, '`': true };
-        var character = motionArgs.selectedCharacter;
-        if (character == 'b') {
-            character = '(';
-        }
-        else if (character == 'B') {
-            character = '{';
-        }
-        var inclusive = !motionArgs.textObjectInner;
-        var tmp;
-        if (mirroredPairs[character]) {
-            tmp = selectCompanionObject(cm, head, character, inclusive);
-        }
-        else if (selfPaired[character]) {
-            tmp = findBeginningAndEnd(cm, head, character, inclusive);
-        }
-        else if (character === 'W') {
-            tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, true /** bigWord */);
-        }
-        else if (character === 'w') {
-            tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, false /** bigWord */);
-        }
-        else if (character === 'p') {
-            tmp = findParagraph(cm, head, motionArgs.repeat, 0, inclusive);
-            motionArgs.linewise = true;
-            if (vim.visualMode) {
-                if (!vim.visualLine) {
-                    vim.visualLine = true;
-                }
-            }
-            else {
-                var operatorArgs = vim.inputState.operatorArgs;
-                if (operatorArgs) {
-                    operatorArgs.linewise = true;
-                }
-                tmp.end.line--;
-            }
-        }
-        else if (character === 't') {
-            tmp = expandTagUnderCursor(cm, head, inclusive);
-        }
-        else {
-            return null;
-        }
-        if (!cm.state.vim.visualMode) {
-            return [tmp.start, tmp.end];
-        }
-        else {
-            return expandSelection(cm, tmp.start, tmp.end);
-        }
-    },
-    repeatLastCharacterSearch: function (cm, head, motionArgs) {
-        var lastSearch = vimGlobalState.lastCharacterSearch;
-        var repeat = motionArgs.repeat;
-        var forward = motionArgs.forward === lastSearch.forward;
-        var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1);
-        cm.moveH(-increment, 'char');
-        motionArgs.inclusive = forward ? true : false;
-        var curEnd = moveToCharacter(cm, repeat, forward, lastSearch.selectedCharacter);
-        if (!curEnd) {
-            cm.moveH(increment, 'char');
-            return head;
-        }
-        curEnd.ch += increment;
-        return curEnd;
-    }
-};
-function defineMotion(name, fn) {
-    motions[name] = fn;
-}
-function fillArray(val, times) {
-    var arr = [];
-    for (var i = 0; i < times; i++) {
-        arr.push(val);
-    }
-    return arr;
-}
-var operators = {
-    change: function (cm, args, ranges) {
-        var finalHead, text;
-        var vim = cm.state.vim;
-        var anchor = ranges[0].anchor, head = ranges[0].head;
-        if (!vim.visualMode) {
-            text = cm.getRange(anchor, head);
-            var lastState = vim.lastEditInputState || {};
-            if (lastState.motion == "moveByWords" && !isWhiteSpaceString(text)) {
-                var match = (/\s+$/).exec(text);
-                if (match && lastState.motionArgs && lastState.motionArgs.forward) {
-                    head = offsetCursor(head, 0, -match[0].length);
-                    text = text.slice(0, -match[0].length);
-                }
-            }
-            var prevLineEnd = new Pos(anchor.line - 1, Number.MAX_VALUE);
-            var wasLastLine = cm.firstLine() == cm.lastLine();
-            if (head.line > cm.lastLine() && args.linewise && !wasLastLine) {
-                cm.replaceRange('', prevLineEnd, head);
-            }
-            else {
-                cm.replaceRange('', anchor, head);
-            }
-            if (args.linewise) {
-                if (!wasLastLine) {
-                    cm.setCursor(prevLineEnd);
-                    CodeMirror.commands.newlineAndIndent(cm);
-                }
-                anchor.ch = Number.MAX_VALUE;
-            }
-            finalHead = anchor;
-        }
-        else if (args.fullLine) {
-            head.ch = Number.MAX_VALUE;
-            head.line--;
-            cm.setSelection(anchor, head);
-            text = cm.getSelection();
-            cm.replaceSelection("");
-            finalHead = anchor;
-        }
-        else {
-            text = cm.getSelection();
-            var replacement = fillArray('', ranges.length);
-            cm.replaceSelections(replacement);
-            finalHead = cursorMin(ranges[0].head, ranges[0].anchor);
-        }
-        vimGlobalState.registerController.pushText(args.registerName, 'change', text, args.linewise, ranges.length > 1);
-        actions.enterInsertMode(cm, { head: finalHead }, cm.state.vim);
-    },
-    'delete': function (cm, args, ranges) {
-        var finalHead, text;
-        var vim = cm.state.vim;
-        if (!vim.visualBlock) {
-            var anchor = ranges[0].anchor, head = ranges[0].head;
-            if (args.linewise &&
-                head.line != cm.firstLine() &&
-                anchor.line == cm.lastLine() &&
-                anchor.line == head.line - 1) {
-                if (anchor.line == cm.firstLine()) {
-                    anchor.ch = 0;
-                }
-                else {
-                    anchor = new Pos(anchor.line - 1, lineLength(cm, anchor.line - 1));
-                }
-            }
-            text = cm.getRange(anchor, head);
-            cm.replaceRange('', anchor, head);
-            finalHead = anchor;
-            if (args.linewise) {
-                finalHead = motions.moveToFirstNonWhiteSpaceCharacter(cm, anchor);
-            }
-        }
-        else {
-            text = cm.getSelection();
-            var replacement = fillArray('', ranges.length);
-            cm.replaceSelections(replacement);
-            finalHead = cursorMin(ranges[0].head, ranges[0].anchor);
-        }
-        vimGlobalState.registerController.pushText(args.registerName, 'delete', text, args.linewise, vim.visualBlock);
-        return clipCursorToContent(cm, finalHead);
-    },
-    indent: function (cm, args, ranges) {
-        var vim = cm.state.vim;
-        var startLine = ranges[0].anchor.line;
-        var endLine = vim.visualBlock ?
-            ranges[ranges.length - 1].anchor.line :
-            ranges[0].head.line;
-        var repeat = (vim.visualMode) ? args.repeat : 1;
-        if (args.linewise) {
-            endLine--;
-        }
-        for (var i = startLine; i <= endLine; i++) {
-            for (var j = 0; j < repeat; j++) {
-                cm.indentLine(i, args.indentRight);
-            }
-        }
-        return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor);
-    },
-    indentAuto: function (cm, _args, ranges) {
-        if (ranges.length > 1) { // ace_patch
-            cm.setSelection(ranges[0].anchor, ranges[ranges.length - 1].head);
-        }
-        cm.execCommand("indentAuto");
-        return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor);
-    },
-    changeCase: function (cm, args, ranges, oldAnchor, newHead) {
-        var selections = cm.getSelections();
-        var swapped = [];
-        var toLower = args.toLower;
-        for (var j = 0; j < selections.length; j++) {
-            var toSwap = selections[j];
-            var text = '';
-            if (toLower === true) {
-                text = toSwap.toLowerCase();
-            }
-            else if (toLower === false) {
-                text = toSwap.toUpperCase();
-            }
-            else {
-                for (var i = 0; i < toSwap.length; i++) {
-                    var character = toSwap.charAt(i);
-                    text += isUpperCase(character) ? character.toLowerCase() :
-                        character.toUpperCase();
-                }
-            }
-            swapped.push(text);
-        }
-        cm.replaceSelections(swapped);
-        if (args.shouldMoveCursor) {
-            return newHead;
-        }
-        else if (!cm.state.vim.visualMode && args.linewise && ranges[0].anchor.line + 1 == ranges[0].head.line) {
-            return motions.moveToFirstNonWhiteSpaceCharacter(cm, oldAnchor);
-        }
-        else if (args.linewise) {
-            return oldAnchor;
-        }
-        else {
-            return cursorMin(ranges[0].anchor, ranges[0].head);
-        }
-    },
-    yank: function (cm, args, ranges, oldAnchor) {
-        var vim = cm.state.vim;
-        var text = cm.getSelection();
-        var endPos = vim.visualMode
-            ? cursorMin(vim.sel.anchor, vim.sel.head, ranges[0].head, ranges[0].anchor)
-            : oldAnchor;
-        vimGlobalState.registerController.pushText(args.registerName, 'yank', text, args.linewise, vim.visualBlock);
-        return endPos;
-    }
-};
-function defineOperator(name, fn) {
-    operators[name] = fn;
-}
-var actions = {
-    jumpListWalk: function (cm, actionArgs, vim) {
-        if (vim.visualMode) {
-            return;
-        }
-        var repeat = actionArgs.repeat;
-        var forward = actionArgs.forward;
-        var jumpList = vimGlobalState.jumpList;
-        var mark = jumpList.move(cm, forward ? repeat : -repeat);
-        var markPos = mark ? mark.find() : undefined;
-        markPos = markPos ? markPos : cm.getCursor();
-        cm.setCursor(markPos);
-        cm.ace.curOp.command.scrollIntoView = "center-animate"; // ace_patch
-    },
-    scroll: function (cm, actionArgs, vim) {
-        if (vim.visualMode) {
-            return;
-        }
-        var repeat = actionArgs.repeat || 1;
-        var lineHeight = cm.defaultTextHeight();
-        var top = cm.getScrollInfo().top;
-        var delta = lineHeight * repeat;
-        var newPos = actionArgs.forward ? top + delta : top - delta;
-        var cursor = copyCursor(cm.getCursor());
-        var cursorCoords = cm.charCoords(cursor, 'local');
-        if (actionArgs.forward) {
-            if (newPos > cursorCoords.top) {
-                cursor.line += (newPos - cursorCoords.top) / lineHeight;
-                cursor.line = Math.ceil(cursor.line);
-                cm.setCursor(cursor);
-                cursorCoords = cm.charCoords(cursor, 'local');
-                cm.scrollTo(null, cursorCoords.top);
-            }
-            else {
-                cm.scrollTo(null, newPos);
-            }
-        }
-        else {
-            var newBottom = newPos + cm.getScrollInfo().clientHeight;
-            if (newBottom < cursorCoords.bottom) {
-                cursor.line -= (cursorCoords.bottom - newBottom) / lineHeight;
-                cursor.line = Math.floor(cursor.line);
-                cm.setCursor(cursor);
-                cursorCoords = cm.charCoords(cursor, 'local');
-                cm.scrollTo(null, cursorCoords.bottom - cm.getScrollInfo().clientHeight);
-            }
-            else {
-                cm.scrollTo(null, newPos);
-            }
-        }
-    },
-    scrollToCursor: function (cm, actionArgs) {
-        var lineNum = cm.getCursor().line;
-        var charCoords = cm.charCoords(new Pos(lineNum, 0), 'local');
-        var height = cm.getScrollInfo().clientHeight;
-        var y = charCoords.top;
-        var lineHeight = charCoords.bottom - y;
-        switch (actionArgs.position) {
-            case 'center':
-                y = y - (height / 2) + lineHeight;
-                break;
-            case 'bottom':
-                y = y - height + lineHeight;
-                break;
-        }
-        cm.scrollTo(null, y);
-    },
-    replayMacro: function (cm, actionArgs, vim) {
-        var registerName = actionArgs.selectedCharacter;
-        var repeat = actionArgs.repeat;
-        var macroModeState = vimGlobalState.macroModeState;
-        if (registerName == '@') {
-            registerName = macroModeState.latestRegister;
-        }
-        else {
-            macroModeState.latestRegister = registerName;
-        }
-        while (repeat--) {
-            executeMacroRegister(cm, vim, macroModeState, registerName);
-        }
-    },
-    enterMacroRecordMode: function (cm, actionArgs) {
-        var macroModeState = vimGlobalState.macroModeState;
-        var registerName = actionArgs.selectedCharacter;
-        if (vimGlobalState.registerController.isValidRegister(registerName)) {
-            macroModeState.enterMacroRecordMode(cm, registerName);
-        }
-    },
-    toggleOverwrite: function (cm) {
-        if (!cm.state.overwrite) {
-            cm.toggleOverwrite(true);
-            cm.setOption('keyMap', 'vim-replace');
-            CodeMirror.signal(cm, "vim-mode-change", { mode: "replace" });
-        }
-        else {
-            cm.toggleOverwrite(false);
-            cm.setOption('keyMap', 'vim-insert');
-            CodeMirror.signal(cm, "vim-mode-change", { mode: "insert" });
-        }
-    },
-    enterInsertMode: function (cm, actionArgs, vim) {
-        if (cm.getOption('readOnly')) {
-            return;
-        }
-        vim.insertMode = true;
-        vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1;
-        var insertAt = (actionArgs) ? actionArgs.insertAt : null;
-        var sel = vim.sel;
-        var head = actionArgs.head || cm.getCursor('head');
-        var height = cm.listSelections().length;
-        if (insertAt == 'eol') {
-            head = new Pos(head.line, lineLength(cm, head.line));
-        }
-        else if (insertAt == 'bol') {
-            head = new Pos(head.line, 0);
-        }
-        else if (insertAt == 'charAfter') {
-            head = offsetCursor(head, 0, 1);
-        }
-        else if (insertAt == 'firstNonBlank') {
-            head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head);
-        }
-        else if (insertAt == 'startOfSelectedArea') {
-            if (!vim.visualMode)
-                return;
-            if (!vim.visualBlock) {
-                if (sel.head.line < sel.anchor.line) {
-                    head = sel.head;
-                }
-                else {
-                    head = new Pos(sel.anchor.line, 0);
-                }
-            }
-            else {
-                head = new Pos(Math.min(sel.head.line, sel.anchor.line), Math.min(sel.head.ch, sel.anchor.ch));
-                height = Math.abs(sel.head.line - sel.anchor.line) + 1;
-            }
-        }
-        else if (insertAt == 'endOfSelectedArea') {
-            if (!vim.visualMode)
-                return;
-            if (!vim.visualBlock) {
-                if (sel.head.line >= sel.anchor.line) {
-                    head = offsetCursor(sel.head, 0, 1);
-                }
-                else {
-                    head = new Pos(sel.anchor.line, 0);
-                }
-            }
-            else {
-                head = new Pos(Math.min(sel.head.line, sel.anchor.line), Math.max(sel.head.ch, sel.anchor.ch) + 1);
-                height = Math.abs(sel.head.line - sel.anchor.line) + 1;
-            }
-        }
-        else if (insertAt == 'inplace') {
-            if (vim.visualMode) {
-                return;
-            }
-        }
-        else if (insertAt == 'lastEdit') {
-            head = getLastEditPos(cm) || head;
-        }
-        cm.setOption('disableInput', false);
-        if (actionArgs && actionArgs.replace) {
-            cm.toggleOverwrite(true);
-            cm.setOption('keyMap', 'vim-replace');
-            CodeMirror.signal(cm, "vim-mode-change", { mode: "replace" });
-        }
-        else {
-            cm.toggleOverwrite(false);
-            cm.setOption('keyMap', 'vim-insert');
-            CodeMirror.signal(cm, "vim-mode-change", { mode: "insert" });
-        }
-        if (!vimGlobalState.macroModeState.isPlaying) {
-            cm.on('change', onChange);
-            CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);
-        }
-        if (vim.visualMode) {
-            exitVisualMode(cm);
-        }
-        selectForInsert(cm, head, height);
-    },
-    toggleVisualMode: function (cm, actionArgs, vim) {
-        var repeat = actionArgs.repeat;
-        var anchor = cm.getCursor();
-        var head;
-        if (!vim.visualMode) {
-            vim.visualMode = true;
-            vim.visualLine = !!actionArgs.linewise;
-            vim.visualBlock = !!actionArgs.blockwise;
-            head = clipCursorToContent(cm, new Pos(anchor.line, anchor.ch + repeat - 1));
-            vim.sel = {
-                anchor: anchor,
-                head: head
-            };
-            CodeMirror.signal(cm, "vim-mode-change", { mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : "" });
-            updateCmSelection(cm);
-            updateMark(cm, vim, '<', cursorMin(anchor, head));
-            updateMark(cm, vim, '>', cursorMax(anchor, head));
-        }
-        else if (vim.visualLine ^ actionArgs.linewise ||
-            vim.visualBlock ^ actionArgs.blockwise) {
-            vim.visualLine = !!actionArgs.linewise;
-            vim.visualBlock = !!actionArgs.blockwise;
-            CodeMirror.signal(cm, "vim-mode-change", { mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : "" });
-            updateCmSelection(cm);
-        }
-        else {
-            exitVisualMode(cm);
-        }
-    },
-    reselectLastSelection: function (cm, _actionArgs, vim) {
-        var lastSelection = vim.lastSelection;
-        if (vim.visualMode) {
-            updateLastSelection(cm, vim);
-        }
-        if (lastSelection) {
-            var anchor = lastSelection.anchorMark.find();
-            var head = lastSelection.headMark.find();
-            if (!anchor || !head) {
-                return;
-            }
-            vim.sel = {
-                anchor: anchor,
-                head: head
-            };
-            vim.visualMode = true;
-            vim.visualLine = lastSelection.visualLine;
-            vim.visualBlock = lastSelection.visualBlock;
-            updateCmSelection(cm);
-            updateMark(cm, vim, '<', cursorMin(anchor, head));
-            updateMark(cm, vim, '>', cursorMax(anchor, head));
-            CodeMirror.signal(cm, 'vim-mode-change', {
-                mode: 'visual',
-                subMode: vim.visualLine ? 'linewise' :
-                    vim.visualBlock ? 'blockwise' : ''
-            });
-        }
-    },
-    joinLines: function (cm, actionArgs, vim) {
-        var curStart, curEnd;
-        if (vim.visualMode) {
-            curStart = cm.getCursor('anchor');
-            curEnd = cm.getCursor('head');
-            if (cursorIsBefore(curEnd, curStart)) {
-                var tmp = curEnd;
-                curEnd = curStart;
-                curStart = tmp;
-            }
-            curEnd.ch = lineLength(cm, curEnd.line) - 1;
-        }
-        else {
-            var repeat = Math.max(actionArgs.repeat, 2);
-            curStart = cm.getCursor();
-            curEnd = clipCursorToContent(cm, new Pos(curStart.line + repeat - 1, Infinity));
-        }
-        var finalCh = 0;
-        for (var i = curStart.line; i < curEnd.line; i++) {
-            finalCh = lineLength(cm, curStart.line);
-            var tmp = new Pos(curStart.line + 1, lineLength(cm, curStart.line + 1));
-            var text = cm.getRange(curStart, tmp);
-            text = actionArgs.keepSpaces
-                ? text.replace(/\n\r?/g, '')
-                : text.replace(/\n\s*/g, ' ');
-            cm.replaceRange(text, curStart, tmp);
-        }
-        var curFinalPos = new Pos(curStart.line, finalCh);
-        if (vim.visualMode) {
-            exitVisualMode(cm, false);
-        }
-        cm.setCursor(curFinalPos);
-    },
-    newLineAndEnterInsertMode: function (cm, actionArgs, vim) {
-        vim.insertMode = true;
-        var insertAt = copyCursor(cm.getCursor());
-        if (insertAt.line === cm.firstLine() && !actionArgs.after) {
-            cm.replaceRange('\n', new Pos(cm.firstLine(), 0));
-            cm.setCursor(cm.firstLine(), 0);
-        }
-        else {
-            insertAt.line = (actionArgs.after) ? insertAt.line :
-                insertAt.line - 1;
-            insertAt.ch = lineLength(cm, insertAt.line);
-            cm.setCursor(insertAt);
-            var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment ||
-                CodeMirror.commands.newlineAndIndent;
-            newlineFn(cm);
-        }
-        this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim);
-    },
-    paste: function (cm, actionArgs, vim) {
-        var cur = copyCursor(cm.getCursor());
-        var register = vimGlobalState.registerController.getRegister(actionArgs.registerName);
-        var text = register.toString();
-        if (!text) {
-            return;
-        }
-        if (actionArgs.matchIndent) {
-            var tabSize = cm.getOption("tabSize");
-            var whitespaceLength = function (str) {
-                var tabs = (str.split("\t").length - 1);
-                var spaces = (str.split(" ").length - 1);
-                return tabs * tabSize + spaces * 1;
-            };
-            var currentLine = cm.getLine(cm.getCursor().line);
-            var indent = whitespaceLength(currentLine.match(/^\s*/)[0]);
-            var chompedText = text.replace(/\n$/, '');
-            var wasChomped = text !== chompedText;
-            var firstIndent = whitespaceLength(text.match(/^\s*/)[0]);
-            var text = chompedText.replace(/^\s*/gm, function (wspace) {
-                var newIndent = indent + (whitespaceLength(wspace) - firstIndent);
-                if (newIndent < 0) {
-                    return "";
-                }
-                else if (cm.getOption("indentWithTabs")) {
-                    var quotient = Math.floor(newIndent / tabSize);
-                    return Array(quotient + 1).join('\t');
-                }
-                else {
-                    return Array(newIndent + 1).join(' ');
-                }
-            });
-            text += wasChomped ? "\n" : "";
-        }
-        if (actionArgs.repeat > 1) {
-            var text = Array(actionArgs.repeat + 1).join(text);
-        }
-        var linewise = register.linewise;
-        var blockwise = register.blockwise;
-        if (blockwise) {
-            text = text.split('\n');
-            if (linewise) {
-                text.pop();
-            }
-            for (var i = 0; i < text.length; i++) {
-                text[i] = (text[i] == '') ? ' ' : text[i];
-            }
-            cur.ch += actionArgs.after ? 1 : 0;
-            cur.ch = Math.min(lineLength(cm, cur.line), cur.ch);
-        }
-        else if (linewise) {
-            if (vim.visualMode) {
-                text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n';
-            }
-            else if (actionArgs.after) {
-                text = '\n' + text.slice(0, text.length - 1);
-                cur.ch = lineLength(cm, cur.line);
-            }
-            else {
-                cur.ch = 0;
-            }
-        }
-        else {
-            cur.ch += actionArgs.after ? 1 : 0;
-        }
-        var curPosFinal;
-        var idx;
-        if (vim.visualMode) {
-            vim.lastPastedText = text;
-            var lastSelectionCurEnd;
-            var selectedArea = getSelectedAreaRange(cm, vim);
-            var selectionStart = selectedArea[0];
-            var selectionEnd = selectedArea[1];
-            var selectedText = cm.getSelection();
-            var selections = cm.listSelections();
-            var emptyStrings = new Array(selections.length).join('1').split('1');
-            if (vim.lastSelection) {
-                lastSelectionCurEnd = vim.lastSelection.headMark.find();
-            }
-            vimGlobalState.registerController.unnamedRegister.setText(selectedText);
-            if (blockwise) {
-                cm.replaceSelections(emptyStrings);
-                selectionEnd = new Pos(selectionStart.line + text.length - 1, selectionStart.ch);
-                cm.setCursor(selectionStart);
-                selectBlock(cm, selectionEnd);
-                cm.replaceSelections(text);
-                curPosFinal = selectionStart;
-            }
-            else if (vim.visualBlock) {
-                cm.replaceSelections(emptyStrings);
-                cm.setCursor(selectionStart);
-                cm.replaceRange(text, selectionStart, selectionStart);
-                curPosFinal = selectionStart;
-            }
-            else {
-                cm.replaceRange(text, selectionStart, selectionEnd);
-                curPosFinal = cm.posFromIndex(cm.indexFromPos(selectionStart) + text.length - 1);
-            }
-            if (lastSelectionCurEnd) {
-                vim.lastSelection.headMark = cm.setBookmark(lastSelectionCurEnd);
-            }
-            if (linewise) {
-                curPosFinal.ch = 0;
-            }
-        }
-        else {
-            if (blockwise) {
-                cm.setCursor(cur);
-                for (var i = 0; i < text.length; i++) {
-                    var line = cur.line + i;
-                    if (line > cm.lastLine()) {
-                        cm.replaceRange('\n', new Pos(line, 0));
-                    }
-                    var lastCh = lineLength(cm, line);
-                    if (lastCh < cur.ch) {
-                        extendLineToColumn(cm, line, cur.ch);
-                    }
-                }
-                cm.setCursor(cur);
-                selectBlock(cm, new Pos(cur.line + text.length - 1, cur.ch));
-                cm.replaceSelections(text);
-                curPosFinal = cur;
-            }
-            else {
-                cm.replaceRange(text, cur);
-                if (linewise && actionArgs.after) {
-                    curPosFinal = new Pos(cur.line + 1, findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1)));
-                }
-                else if (linewise && !actionArgs.after) {
-                    curPosFinal = new Pos(cur.line, findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line)));
-                }
-                else if (!linewise && actionArgs.after) {
-                    idx = cm.indexFromPos(cur);
-                    curPosFinal = cm.posFromIndex(idx + text.length - 1);
-                }
-                else {
-                    idx = cm.indexFromPos(cur);
-                    curPosFinal = cm.posFromIndex(idx + text.length);
-                }
-            }
-        }
-        if (vim.visualMode) {
-            exitVisualMode(cm, false);
-        }
-        cm.setCursor(curPosFinal);
-    },
-    undo: function (cm, actionArgs) {
-        cm.operation(function () {
-            repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)();
-            cm.setCursor(cm.getCursor('anchor'));
-        });
-    },
-    redo: function (cm, actionArgs) {
-        repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)();
-    },
-    setRegister: function (_cm, actionArgs, vim) {
-        vim.inputState.registerName = actionArgs.selectedCharacter;
-    },
-    setMark: function (cm, actionArgs, vim) {
-        var markName = actionArgs.selectedCharacter;
-        updateMark(cm, vim, markName, cm.getCursor());
-    },
-    replace: function (cm, actionArgs, vim) {
-        var replaceWith = actionArgs.selectedCharacter;
-        var curStart = cm.getCursor();
-        var replaceTo;
-        var curEnd;
-        var selections = cm.listSelections();
-        if (vim.visualMode) {
-            curStart = cm.getCursor('start');
-            curEnd = cm.getCursor('end');
-        }
-        else {
-            var line = cm.getLine(curStart.line);
-            replaceTo = curStart.ch + actionArgs.repeat;
-            if (replaceTo > line.length) {
-                replaceTo = line.length;
-            }
-            curEnd = new Pos(curStart.line, replaceTo);
-        }
-        if (replaceWith == '\n') {
-            if (!vim.visualMode)
-                cm.replaceRange('', curStart, curEnd);
-            (CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm);
-        }
-        else {
-            var replaceWithStr = cm.getRange(curStart, curEnd);
-            replaceWithStr = replaceWithStr.replace(/[^\n]/g, replaceWith);
-            if (vim.visualBlock) {
-                var spaces = new Array(cm.getOption("tabSize") + 1).join(' ');
-                replaceWithStr = cm.getSelection();
-                replaceWithStr = replaceWithStr.replace(/\t/g, spaces).replace(/[^\n]/g, replaceWith).split('\n');
-                cm.replaceSelections(replaceWithStr);
-            }
-            else {
-                cm.replaceRange(replaceWithStr, curStart, curEnd);
-            }
-            if (vim.visualMode) {
-                curStart = cursorIsBefore(selections[0].anchor, selections[0].head) ?
-                    selections[0].anchor : selections[0].head;
-                cm.setCursor(curStart);
-                exitVisualMode(cm, false);
-            }
-            else {
-                cm.setCursor(offsetCursor(curEnd, 0, -1));
-            }
-        }
-    },
-    incrementNumberToken: function (cm, actionArgs) {
-        var cur = cm.getCursor();
-        var lineStr = cm.getLine(cur.line);
-        var re = /(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;
-        var match;
-        var start;
-        var end;
-        var numberStr;
-        while ((match = re.exec(lineStr)) !== null) {
-            start = match.index;
-            end = start + match[0].length;
-            if (cur.ch < end)
-                break;
-        }
-        if (!actionArgs.backtrack && (end <= cur.ch))
-            return;
-        if (match) {
-            var baseStr = match[2] || match[4];
-            var digits = match[3] || match[5];
-            var increment = actionArgs.increase ? 1 : -1;
-            var base = { '0b': 2, '0': 8, '': 10, '0x': 16 }[baseStr.toLowerCase()];
-            var number = parseInt(match[1] + digits, base) + (increment * actionArgs.repeat);
-            numberStr = number.toString(base);
-            var zeroPadding = baseStr ? new Array(digits.length - numberStr.length + 1 + match[1].length).join('0') : '';
-            if (numberStr.charAt(0) === '-') {
-                numberStr = '-' + baseStr + zeroPadding + numberStr.substr(1);
-            }
-            else {
-                numberStr = baseStr + zeroPadding + numberStr;
-            }
-            var from = new Pos(cur.line, start);
-            var to = new Pos(cur.line, end);
-            cm.replaceRange(numberStr, from, to);
-        }
-        else {
-            return;
-        }
-        cm.setCursor(new Pos(cur.line, start + numberStr.length - 1));
-    },
-    repeatLastEdit: function (cm, actionArgs, vim) {
-        var lastEditInputState = vim.lastEditInputState;
-        if (!lastEditInputState) {
-            return;
-        }
-        var repeat = actionArgs.repeat;
-        if (repeat && actionArgs.repeatIsExplicit) {
-            vim.lastEditInputState.repeatOverride = repeat;
-        }
-        else {
-            repeat = vim.lastEditInputState.repeatOverride || repeat;
-        }
-        repeatLastEdit(cm, vim, repeat, false /** repeatForInsert */);
-    },
-    indent: function (cm, actionArgs) {
-        cm.indentLine(cm.getCursor().line, actionArgs.indentRight);
-    },
-    exitInsertMode: exitInsertMode
-};
-function defineAction(name, fn) {
-    actions[name] = fn;
-}
-function clipCursorToContent(cm, cur) {
-    var vim = cm.state.vim;
-    var includeLineBreak = vim.insertMode || vim.visualMode;
-    var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine());
-    var maxCh = lineLength(cm, line) - 1 + !!includeLineBreak;
-    var ch = Math.min(Math.max(0, cur.ch), maxCh);
-    return new Pos(line, ch);
-}
-function copyArgs(args) {
-    var ret = {};
-    for (var prop in args) {
-        if (args.hasOwnProperty(prop)) {
-            ret[prop] = args[prop];
-        }
-    }
-    return ret;
-}
-function offsetCursor(cur, offsetLine, offsetCh) {
-    if (typeof offsetLine === 'object') {
-        offsetCh = offsetLine.ch;
-        offsetLine = offsetLine.line;
-    }
-    return new Pos(cur.line + offsetLine, cur.ch + offsetCh);
-}
-function commandMatches(keys, keyMap, context, inputState) {
-    var match, partial = [], full = [];
-    for (var i = 0; i < keyMap.length; i++) {
-        var command = keyMap[i];
-        if (context == 'insert' && command.context != 'insert' ||
-            command.context && command.context != context ||
-            inputState.operator && command.type == 'action' ||
-            !(match = commandMatch(keys, command.keys))) {
-            continue;
-        }
-        if (match == 'partial') {
-            partial.push(command);
-        }
-        if (match == 'full') {
-            full.push(command);
-        }
-    }
-    return {
-        partial: partial.length && partial,
-        full: full.length && full
-    };
-}
-function commandMatch(pressed, mapped) {
-    if (mapped.slice(-11) == '<character>') {
-        var prefixLen = mapped.length - 11;
-        var pressedPrefix = pressed.slice(0, prefixLen);
-        var mappedPrefix = mapped.slice(0, prefixLen);
-        return pressedPrefix == mappedPrefix && pressed.length > prefixLen ? 'full' :
-            mappedPrefix.indexOf(pressedPrefix) == 0 ? 'partial' : false;
-    }
-    else {
-        return pressed == mapped ? 'full' :
-            mapped.indexOf(pressed) == 0 ? 'partial' : false;
-    }
-}
-function lastChar(keys) {
-    var match = /^.*(<[^>]+>)$/.exec(keys);
-    var selectedCharacter = match ? match[1] : keys.slice(-1);
-    if (selectedCharacter.length > 1) {
-        switch (selectedCharacter) {
-            case '<CR>':
-                selectedCharacter = '\n';
-                break;
-            case '<Space>':
-                selectedCharacter = ' ';
-                break;
-            default:
-                selectedCharacter = '';
-                break;
-        }
-    }
-    return selectedCharacter;
-}
-function repeatFn(cm, fn, repeat) {
-    return function () {
-        for (var i = 0; i < repeat; i++) {
-            fn(cm);
-        }
-    };
-}
-function copyCursor(cur) {
-    return new Pos(cur.line, cur.ch);
-}
-function cursorEqual(cur1, cur2) {
-    return cur1.ch == cur2.ch && cur1.line == cur2.line;
-}
-function cursorIsBefore(cur1, cur2) {
-    if (cur1.line < cur2.line) {
-        return true;
-    }
-    if (cur1.line == cur2.line && cur1.ch < cur2.ch) {
-        return true;
-    }
-    return false;
-}
-function cursorMin(cur1, cur2) {
-    if (arguments.length > 2) {
-        cur2 = cursorMin.apply(undefined, Array.prototype.slice.call(arguments, 1));
-    }
-    return cursorIsBefore(cur1, cur2) ? cur1 : cur2;
-}
-function cursorMax(cur1, cur2) {
-    if (arguments.length > 2) {
-        cur2 = cursorMax.apply(undefined, Array.prototype.slice.call(arguments, 1));
-    }
-    return cursorIsBefore(cur1, cur2) ? cur2 : cur1;
-}
-function cursorIsBetween(cur1, cur2, cur3) {
-    var cur1before2 = cursorIsBefore(cur1, cur2);
-    var cur2before3 = cursorIsBefore(cur2, cur3);
-    return cur1before2 && cur2before3;
-}
-function lineLength(cm, lineNum) {
-    return cm.getLine(lineNum).length;
-}
-function trim(s) {
-    if (s.trim) {
-        return s.trim();
-    }
-    return s.replace(/^\s+|\s+$/g, '');
-}
-function escapeRegex(s) {
-    return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, '\\$1');
-}
-function extendLineToColumn(cm, lineNum, column) {
-    var endCh = lineLength(cm, lineNum);
-    var spaces = new Array(column - endCh + 1).join(' ');
-    cm.setCursor(new Pos(lineNum, endCh));
-    cm.replaceRange(spaces, cm.getCursor());
-}
-function selectBlock(cm, selectionEnd) {
-    var selections = [], ranges = cm.listSelections();
-    var head = copyCursor(cm.clipPos(selectionEnd));
-    var isClipped = !cursorEqual(selectionEnd, head);
-    var curHead = cm.getCursor('head');
-    var primIndex = getIndex(ranges, curHead);
-    var wasClipped = cursorEqual(ranges[primIndex].head, ranges[primIndex].anchor);
-    var max = ranges.length - 1;
-    var index = max - primIndex > primIndex ? max : 0;
-    var base = ranges[index].anchor;
-    var firstLine = Math.min(base.line, head.line);
-    var lastLine = Math.max(base.line, head.line);
-    var baseCh = base.ch, headCh = head.ch;
-    var dir = ranges[index].head.ch - baseCh;
-    var newDir = headCh - baseCh;
-    if (dir > 0 && newDir <= 0) {
-        baseCh++;
-        if (!isClipped) {
-            headCh--;
-        }
-    }
-    else if (dir < 0 && newDir >= 0) {
-        baseCh--;
-        if (!wasClipped) {
-            headCh++;
-        }
-    }
-    else if (dir < 0 && newDir == -1) {
-        baseCh--;
-        headCh++;
-    }
-    for (var line = firstLine; line <= lastLine; line++) {
-        var range = { anchor: new Pos(line, baseCh), head: new Pos(line, headCh) };
-        selections.push(range);
-    }
-    cm.setSelections(selections);
-    selectionEnd.ch = headCh;
-    base.ch = baseCh;
-    return base;
-}
-function selectForInsert(cm, head, height) {
-    var sel = [];
-    for (var i = 0; i < height; i++) {
-        var lineHead = offsetCursor(head, i, 0);
-        sel.push({ anchor: lineHead, head: lineHead });
-    }
-    cm.setSelections(sel, 0);
-}
-function getIndex(ranges, cursor, end) {
-    for (var i = 0; i < ranges.length; i++) {
-        var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor);
-        var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor);
-        if (atAnchor || atHead) {
-            return i;
-        }
-    }
-    return -1;
-}
-function getSelectedAreaRange(cm, vim) {
-    var lastSelection = vim.lastSelection;
-    var getCurrentSelectedAreaRange = function () {
-        var selections = cm.listSelections();
-        var start = selections[0];
-        var end = selections[selections.length - 1];
-        var selectionStart = cursorIsBefore(start.anchor, start.head) ? start.anchor : start.head;
-        var selectionEnd = cursorIsBefore(end.anchor, end.head) ? end.head : end.anchor;
-        return [selectionStart, selectionEnd];
-    };
-    var getLastSelectedAreaRange = function () {
-        var selectionStart = cm.getCursor();
-        var selectionEnd = cm.getCursor();
-        var block = lastSelection.visualBlock;
-        if (block) {
-            var width = block.width;
-            var height = block.height;
-            selectionEnd = new Pos(selectionStart.line + height, selectionStart.ch + width);
-            var selections = [];
-            for (var i = selectionStart.line; i < selectionEnd.line; i++) {
-                var anchor = new Pos(i, selectionStart.ch);
-                var head = new Pos(i, selectionEnd.ch);
-                var range = { anchor: anchor, head: head };
-                selections.push(range);
-            }
-            cm.setSelections(selections);
-        }
-        else {
-            var start = lastSelection.anchorMark.find();
-            var end = lastSelection.headMark.find();
-            var line = end.line - start.line;
-            var ch = end.ch - start.ch;
-            selectionEnd = { line: selectionEnd.line + line, ch: line ? selectionEnd.ch : ch + selectionEnd.ch };
-            if (lastSelection.visualLine) {
-                selectionStart = new Pos(selectionStart.line, 0);
-                selectionEnd = new Pos(selectionEnd.line, lineLength(cm, selectionEnd.line));
-            }
-            cm.setSelection(selectionStart, selectionEnd);
-        }
-        return [selectionStart, selectionEnd];
-    };
-    if (!vim.visualMode) {
-        return getLastSelectedAreaRange();
-    }
-    else {
-        return getCurrentSelectedAreaRange();
-    }
-}
-function updateLastSelection(cm, vim) {
-    var anchor = vim.sel.anchor;
-    var head = vim.sel.head;
-    if (vim.lastPastedText) {
-        head = cm.posFromIndex(cm.indexFromPos(anchor) + vim.lastPastedText.length);
-        vim.lastPastedText = null;
-    }
-    vim.lastSelection = { 'anchorMark': cm.setBookmark(anchor),
-        'headMark': cm.setBookmark(head),
-        'anchor': copyCursor(anchor),
-        'head': copyCursor(head),
-        'visualMode': vim.visualMode,
-        'visualLine': vim.visualLine,
-        'visualBlock': vim.visualBlock };
-}
-function expandSelection(cm, start, end) {
-    var sel = cm.state.vim.sel;
-    var head = sel.head;
-    var anchor = sel.anchor;
-    var tmp;
-    if (cursorIsBefore(end, start)) {
-        tmp = end;
-        end = start;
-        start = tmp;
-    }
-    if (cursorIsBefore(head, anchor)) {
-        head = cursorMin(start, head);
-        anchor = cursorMax(anchor, end);
-    }
-    else {
-        anchor = cursorMin(start, anchor);
-        head = cursorMax(head, end);
-        head = offsetCursor(head, 0, -1);
-        if (head.ch == -1 && head.line != cm.firstLine()) {
-            head = new Pos(head.line - 1, lineLength(cm, head.line - 1));
-        }
-    }
-    return [anchor, head];
-}
-function updateCmSelection(cm, sel, mode) {
-    var vim = cm.state.vim;
-    sel = sel || vim.sel;
-    var mode = mode ||
-        vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char';
-    var cmSel = makeCmSelection(cm, sel, mode);
-    cm.setSelections(cmSel.ranges, cmSel.primary);
-}
-function makeCmSelection(cm, sel, mode, exclusive) {
-    var head = copyCursor(sel.head);
-    var anchor = copyCursor(sel.anchor);
-    if (mode == 'char') {
-        var headOffset = !exclusive && !cursorIsBefore(sel.head, sel.anchor) ? 1 : 0;
-        var anchorOffset = cursorIsBefore(sel.head, sel.anchor) ? 1 : 0;
-        head = offsetCursor(sel.head, 0, headOffset);
-        anchor = offsetCursor(sel.anchor, 0, anchorOffset);
-        return {
-            ranges: [{ anchor: anchor, head: head }],
-            primary: 0
-        };
-    }
-    else if (mode == 'line') {
-        if (!cursorIsBefore(sel.head, sel.anchor)) {
-            anchor.ch = 0;
-            var lastLine = cm.lastLine();
-            if (head.line > lastLine) {
-                head.line = lastLine;
-            }
-            head.ch = lineLength(cm, head.line);
-        }
-        else {
-            head.ch = 0;
-            anchor.ch = lineLength(cm, anchor.line);
-        }
-        return {
-            ranges: [{ anchor: anchor, head: head }],
-            primary: 0
-        };
-    }
-    else if (mode == 'block') {
-        var top = Math.min(anchor.line, head.line), fromCh = anchor.ch, bottom = Math.max(anchor.line, head.line), toCh = head.ch;
-        if (fromCh < toCh) {
-            toCh += 1;
-        }
-        else {
-            fromCh += 1;
-        }
-        ;
-        var height = bottom - top + 1;
-        var primary = head.line == top ? 0 : height - 1;
-        var ranges = [];
-        for (var i = 0; i < height; i++) {
-            ranges.push({
-                anchor: new Pos(top + i, fromCh),
-                head: new Pos(top + i, toCh)
-            });
-        }
-        return {
-            ranges: ranges,
-            primary: primary
-        };
-    }
-}
-function getHead(cm) {
-    var cur = cm.getCursor('head');
-    if (cm.getSelection().length == 1) {
-        cur = cursorMin(cur, cm.getCursor('anchor'));
-    }
-    return cur;
-}
-function exitVisualMode(cm, moveHead) {
-    var vim = cm.state.vim;
-    if (moveHead !== false) {
-        cm.setCursor(clipCursorToContent(cm, vim.sel.head));
-    }
-    updateLastSelection(cm, vim);
-    vim.visualMode = false;
-    vim.visualLine = false;
-    vim.visualBlock = false;
-    if (!vim.insertMode)
-        CodeMirror.signal(cm, "vim-mode-change", { mode: "normal" });
-}
-function clipToLine(cm, curStart, curEnd) {
-    var selection = cm.getRange(curStart, curEnd);
-    if (/\n\s*$/.test(selection)) {
-        var lines = selection.split('\n');
-        lines.pop();
-        var line;
-        for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) {
-            curEnd.line--;
-            curEnd.ch = 0;
-        }
-        if (line) {
-            curEnd.line--;
-            curEnd.ch = lineLength(cm, curEnd.line);
-        }
-        else {
-            curEnd.ch = 0;
-        }
-    }
-}
-function expandSelectionToLine(_cm, curStart, curEnd) {
-    curStart.ch = 0;
-    curEnd.ch = 0;
-    curEnd.line++;
-}
-function findFirstNonWhiteSpaceCharacter(text) {
-    if (!text) {
-        return 0;
-    }
-    var firstNonWS = text.search(/\S/);
-    return firstNonWS == -1 ? text.length : firstNonWS;
-}
-function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbol) {
-    var cur = getHead(cm);
-    var line = cm.getLine(cur.line);
-    var idx = cur.ch;
-    var test = noSymbol ? wordCharTest[0] : bigWordCharTest[0];
-    while (!test(line.charAt(idx))) {
-        idx++;
-        if (idx >= line.length) {
-            return null;
-        }
-    }
-    if (bigWord) {
-        test = bigWordCharTest[0];
-    }
-    else {
-        test = wordCharTest[0];
-        if (!test(line.charAt(idx))) {
-            test = wordCharTest[1];
-        }
-    }
-    var end = idx, start = idx;
-    while (test(line.charAt(end)) && end < line.length) {
-        end++;
-    }
-    while (test(line.charAt(start)) && start >= 0) {
-        start--;
-    }
-    start++;
-    if (inclusive) {
-        var wordEnd = end;
-        while (/\s/.test(line.charAt(end)) && end < line.length) {
-            end++;
-        }
-        if (wordEnd == end) {
-            var wordStart = start;
-            while (/\s/.test(line.charAt(start - 1)) && start > 0) {
-                start--;
-            }
-            if (!start) {
-                start = wordStart;
-            }
-        }
-    }
-    return { start: new Pos(cur.line, start), end: new Pos(cur.line, end) };
-}
-function expandTagUnderCursor(cm, head, inclusive) {
-    var cur = head;
-    if (!CodeMirror.findMatchingTag || !CodeMirror.findEnclosingTag) {
-        return { start: cur, end: cur };
-    }
-    var tags = CodeMirror.findMatchingTag(cm, head) || CodeMirror.findEnclosingTag(cm, head);
-    if (!tags || !tags.open || !tags.close) {
-        return { start: cur, end: cur };
-    }
-    if (inclusive) {
-        return { start: tags.open.from, end: tags.close.to };
-    }
-    return { start: tags.open.to, end: tags.close.from };
-}
-function recordJumpPosition(cm, oldCur, newCur) {
-    if (!cursorEqual(oldCur, newCur)) {
-        vimGlobalState.jumpList.add(cm, oldCur, newCur);
-    }
-}
-function recordLastCharacterSearch(increment, args) {
-    vimGlobalState.lastCharacterSearch.increment = increment;
-    vimGlobalState.lastCharacterSearch.forward = args.forward;
-    vimGlobalState.lastCharacterSearch.selectedCharacter = args.selectedCharacter;
-}
-var symbolToMode = {
-    '(': 'bracket', ')': 'bracket', '{': 'bracket', '}': 'bracket',
-    '[': 'section', ']': 'section',
-    '*': 'comment', '/': 'comment',
-    'm': 'method', 'M': 'method',
-    '#': 'preprocess'
-};
-var findSymbolModes = {
-    bracket: {
-        isComplete: function (state) {
-            if (state.nextCh === state.symb) {
-                state.depth++;
-                if (state.depth >= 1)
-                    return true;
-            }
-            else if (state.nextCh === state.reverseSymb) {
-                state.depth--;
-            }
-            return false;
-        }
-    },
-    section: {
-        init: function (state) {
-            state.curMoveThrough = true;
-            state.symb = (state.forward ? ']' : '[') === state.symb ? '{' : '}';
-        },
-        isComplete: function (state) {
-            return state.index === 0 && state.nextCh === state.symb;
-        }
-    },
-    comment: {
-        isComplete: function (state) {
-            var found = state.lastCh === '*' && state.nextCh === '/';
-            state.lastCh = state.nextCh;
-            return found;
-        }
-    },
-    method: {
-        init: function (state) {
-            state.symb = (state.symb === 'm' ? '{' : '}');
-            state.reverseSymb = state.symb === '{' ? '}' : '{';
-        },
-        isComplete: function (state) {
-            if (state.nextCh === state.symb)
-                return true;
-            return false;
-        }
-    },
-    preprocess: {
-        init: function (state) {
-            state.index = 0;
-        },
-        isComplete: function (state) {
-            if (state.nextCh === '#') {
-                var token = state.lineText.match(/^#(\w+)/)[1];
-                if (token === 'endif') {
-                    if (state.forward && state.depth === 0) {
-                        return true;
-                    }
-                    state.depth++;
-                }
-                else if (token === 'if') {
-                    if (!state.forward && state.depth === 0) {
-                        return true;
-                    }
-                    state.depth--;
-                }
-                if (token === 'else' && state.depth === 0)
-                    return true;
-            }
-            return false;
-        }
-    }
-};
-function findSymbol(cm, repeat, forward, symb) {
-    var cur = copyCursor(cm.getCursor());
-    var increment = forward ? 1 : -1;
-    var endLine = forward ? cm.lineCount() : -1;
-    var curCh = cur.ch;
-    var line = cur.line;
-    var lineText = cm.getLine(line);
-    var state = {
-        lineText: lineText,
-        nextCh: lineText.charAt(curCh),
-        lastCh: null,
-        index: curCh,
-        symb: symb,
-        reverseSymb: (forward ? { ')': '(', '}': '{' } : { '(': ')', '{': '}' })[symb],
-        forward: forward,
-        depth: 0,
-        curMoveThrough: false
-    };
-    var mode = symbolToMode[symb];
-    if (!mode)
-        return cur;
-    var init = findSymbolModes[mode].init;
-    var isComplete = findSymbolModes[mode].isComplete;
-    if (init) {
-        init(state);
-    }
-    while (line !== endLine && repeat) {
-        state.index += increment;
-        state.nextCh = state.lineText.charAt(state.index);
-        if (!state.nextCh) {
-            line += increment;
-            state.lineText = cm.getLine(line) || '';
-            if (increment > 0) {
-                state.index = 0;
-            }
-            else {
-                var lineLen = state.lineText.length;
-                state.index = (lineLen > 0) ? (lineLen - 1) : 0;
-            }
-            state.nextCh = state.lineText.charAt(state.index);
-        }
-        if (isComplete(state)) {
-            cur.line = line;
-            cur.ch = state.index;
-            repeat--;
-        }
-    }
-    if (state.nextCh || state.curMoveThrough) {
-        return new Pos(line, state.index);
-    }
-    return cur;
-}
-function findWord(cm, cur, forward, bigWord, emptyLineIsWord) {
-    var lineNum = cur.line;
-    var pos = cur.ch;
-    var line = cm.getLine(lineNum);
-    var dir = forward ? 1 : -1;
-    var charTests = bigWord ? bigWordCharTest : wordCharTest;
-    if (emptyLineIsWord && line == '') {
-        lineNum += dir;
-        line = cm.getLine(lineNum);
-        if (!isLine(cm, lineNum)) {
-            return null;
-        }
-        pos = (forward) ? 0 : line.length;
-    }
-    while (true) {
-        if (emptyLineIsWord && line == '') {
-            return { from: 0, to: 0, line: lineNum };
-        }
-        var stop = (dir > 0) ? line.length : -1;
-        var wordStart = stop, wordEnd = stop;
-        while (pos != stop) {
-            var foundWord = false;
-            for (var i = 0; i < charTests.length && !foundWord; ++i) {
-                if (charTests[i](line.charAt(pos))) {
-                    wordStart = pos;
-                    while (pos != stop && charTests[i](line.charAt(pos))) {
-                        pos += dir;
-                    }
-                    wordEnd = pos;
-                    foundWord = wordStart != wordEnd;
-                    if (wordStart == cur.ch && lineNum == cur.line &&
-                        wordEnd == wordStart + dir) {
-                        continue;
-                    }
-                    else {
-                        return {
-                            from: Math.min(wordStart, wordEnd + 1),
-                            to: Math.max(wordStart, wordEnd),
-                            line: lineNum
-                        };
-                    }
-                }
-            }
-            if (!foundWord) {
-                pos += dir;
-            }
-        }
-        lineNum += dir;
-        if (!isLine(cm, lineNum)) {
-            return null;
-        }
-        line = cm.getLine(lineNum);
-        pos = (dir > 0) ? 0 : line.length;
-    }
-}
-function moveToWord(cm, cur, repeat, forward, wordEnd, bigWord) {
-    var curStart = copyCursor(cur);
-    var words = [];
-    if (forward && !wordEnd || !forward && wordEnd) {
-        repeat++;
-    }
-    var emptyLineIsWord = !(forward && wordEnd);
-    for (var i = 0; i < repeat; i++) {
-        var word = findWord(cm, cur, forward, bigWord, emptyLineIsWord);
-        if (!word) {
-            var eodCh = lineLength(cm, cm.lastLine());
-            words.push(forward
-                ? { line: cm.lastLine(), from: eodCh, to: eodCh }
-                : { line: 0, from: 0, to: 0 });
-            break;
-        }
-        words.push(word);
-        cur = new Pos(word.line, forward ? (word.to - 1) : word.from);
-    }
-    var shortCircuit = words.length != repeat;
-    var firstWord = words[0];
-    var lastWord = words.pop();
-    if (forward && !wordEnd) {
-        if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) {
-            lastWord = words.pop();
-        }
-        return new Pos(lastWord.line, lastWord.from);
-    }
-    else if (forward && wordEnd) {
-        return new Pos(lastWord.line, lastWord.to - 1);
-    }
-    else if (!forward && wordEnd) {
-        if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) {
-            lastWord = words.pop();
-        }
-        return new Pos(lastWord.line, lastWord.to);
-    }
-    else {
-        return new Pos(lastWord.line, lastWord.from);
-    }
-}
-function moveToEol(cm, head, motionArgs, vim, keepHPos) {
-    var cur = head;
-    var retval = new Pos(cur.line + motionArgs.repeat - 1, Infinity);
-    var end = cm.clipPos(retval);
-    end.ch--;
-    if (!keepHPos) {
-        vim.lastHPos = Infinity;
-        vim.lastHSPos = cm.charCoords(end, 'div').left;
-    }
-    return retval;
-}
-function moveToCharacter(cm, repeat, forward, character) {
-    var cur = cm.getCursor();
-    var start = cur.ch;
-    var idx;
-    for (var i = 0; i < repeat; i++) {
-        var line = cm.getLine(cur.line);
-        idx = charIdxInLine(start, line, character, forward, true);
-        if (idx == -1) {
-            return null;
-        }
-        start = idx;
-    }
-    return new Pos(cm.getCursor().line, idx);
-}
-function moveToColumn(cm, repeat) {
-    var line = cm.getCursor().line;
-    return clipCursorToContent(cm, new Pos(line, repeat - 1));
-}
-function updateMark(cm, vim, markName, pos) {
-    if (!inArray(markName, validMarks)) {
-        return;
-    }
-    if (vim.marks[markName]) {
-        vim.marks[markName].clear();
-    }
-    vim.marks[markName] = cm.setBookmark(pos);
-}
-function charIdxInLine(start, line, character, forward, includeChar) {
-    var idx;
-    if (forward) {
-        idx = line.indexOf(character, start + 1);
-        if (idx != -1 && !includeChar) {
-            idx -= 1;
-        }
-    }
-    else {
-        idx = line.lastIndexOf(character, start - 1);
-        if (idx != -1 && !includeChar) {
-            idx += 1;
-        }
-    }
-    return idx;
-}
-function findParagraph(cm, head, repeat, dir, inclusive) {
-    var line = head.line;
-    var min = cm.firstLine();
-    var max = cm.lastLine();
-    var start, end, i = line;
-    function isEmpty(i) { return !/\S/.test(cm.getLine(i)); } // ace_patch
-    function isBoundary(i, dir, any) {
-        if (any) {
-            return isEmpty(i) != isEmpty(i + dir);
-        }
-        return !isEmpty(i) && isEmpty(i + dir);
-    }
-    function skipFold(i) {
-        dir = dir > 0 ? 1 : -1;
-        var foldLine = cm.ace.session.getFoldLine(i);
-        if (foldLine) {
-            if (i + dir > foldLine.start.row && i + dir < foldLine.end.row)
-                dir = (dir > 0 ? foldLine.end.row : foldLine.start.row) - i;
-        }
-    }
-    if (dir) {
-        while (min <= i && i <= max && repeat > 0) {
-            skipFold(i);
-            if (isBoundary(i, dir)) {
-                repeat--;
-            }
-            i += dir;
-        }
-        return new Pos(i, 0);
-    }
-    var vim = cm.state.vim;
-    if (vim.visualLine && isBoundary(line, 1, true)) {
-        var anchor = vim.sel.anchor;
-        if (isBoundary(anchor.line, -1, true)) {
-            if (!inclusive || anchor.line != line) {
-                line += 1;
-            }
-        }
-    }
-    var startState = isEmpty(line);
-    for (i = line; i <= max && repeat; i++) {
-        if (isBoundary(i, 1, true)) {
-            if (!inclusive || isEmpty(i) != startState) {
-                repeat--;
-            }
-        }
-    }
-    end = new Pos(i, 0);
-    if (i > max && !startState) {
-        startState = true;
-    }
-    else {
-        inclusive = false;
-    }
-    for (i = line; i > min; i--) {
-        if (!inclusive || isEmpty(i) == startState || i == line) {
-            if (isBoundary(i, -1, true)) {
-                break;
-            }
-        }
-    }
-    start = new Pos(i, 0);
-    return { start: start, end: end };
-}
-function findSentence(cm, cur, repeat, dir) {
-    function nextChar(cm, idx) {
-        if (idx.pos + idx.dir < 0 || idx.pos + idx.dir >= idx.line.length) {
-            idx.ln += idx.dir;
-            if (!isLine(cm, idx.ln)) {
-                idx.line = null;
-                idx.ln = null;
-                idx.pos = null;
-                return;
-            }
-            idx.line = cm.getLine(idx.ln);
-            idx.pos = (idx.dir > 0) ? 0 : idx.line.length - 1;
-        }
-        else {
-            idx.pos += idx.dir;
-        }
-    }
-    function forward(cm, ln, pos, dir) {
-        var line = cm.getLine(ln);
-        var stop = (line === "");
-        var curr = {
-            line: line,
-            ln: ln,
-            pos: pos,
-            dir: dir,
-        };
-        var last_valid = {
-            ln: curr.ln,
-            pos: curr.pos,
-        };
-        var skip_empty_lines = (curr.line === "");
-        nextChar(cm, curr);
-        while (curr.line !== null) {
-            last_valid.ln = curr.ln;
-            last_valid.pos = curr.pos;
-            if (curr.line === "" && !skip_empty_lines) {
-                return { ln: curr.ln, pos: curr.pos, };
-            }
-            else if (stop && curr.line !== "" && !isWhiteSpaceString(curr.line[curr.pos])) {
-                return { ln: curr.ln, pos: curr.pos, };
-            }
-            else if (isEndOfSentenceSymbol(curr.line[curr.pos])
-                && !stop
-                && (curr.pos === curr.line.length - 1
-                    || isWhiteSpaceString(curr.line[curr.pos + 1]))) {
-                stop = true;
-            }
-            nextChar(cm, curr);
-        }
-        var line = cm.getLine(last_valid.ln);
-        last_valid.pos = 0;
-        for (var i = line.length - 1; i >= 0; --i) {
-            if (!isWhiteSpaceString(line[i])) {
-                last_valid.pos = i;
-                break;
-            }
-        }
-        return last_valid;
-    }
-    function reverse(cm, ln, pos, dir) {
-        var line = cm.getLine(ln);
-        var curr = {
-            line: line,
-            ln: ln,
-            pos: pos,
-            dir: dir,
-        };
-        var last_valid = {
-            ln: curr.ln,
-            pos: null,
-        };
-        var skip_empty_lines = (curr.line === "");
-        nextChar(cm, curr);
-        while (curr.line !== null) {
-            if (curr.line === "" && !skip_empty_lines) {
-                if (last_valid.pos !== null) {
-                    return last_valid;
-                }
-                else {
-                    return { ln: curr.ln, pos: curr.pos };
-                }
-            }
-            else if (isEndOfSentenceSymbol(curr.line[curr.pos])
-                && last_valid.pos !== null
-                && !(curr.ln === last_valid.ln && curr.pos + 1 === last_valid.pos)) {
-                return last_valid;
-            }
-            else if (curr.line !== "" && !isWhiteSpaceString(curr.line[curr.pos])) {
-                skip_empty_lines = false;
-                last_valid = { ln: curr.ln, pos: curr.pos };
-            }
-            nextChar(cm, curr);
-        }
-        var line = cm.getLine(last_valid.ln);
-        last_valid.pos = 0;
-        for (var i = 0; i < line.length; ++i) {
-            if (!isWhiteSpaceString(line[i])) {
-                last_valid.pos = i;
-                break;
-            }
-        }
-        return last_valid;
-    }
-    var curr_index = {
-        ln: cur.line,
-        pos: cur.ch,
-    };
-    while (repeat > 0) {
-        if (dir < 0) {
-            curr_index = reverse(cm, curr_index.ln, curr_index.pos, dir);
-        }
-        else {
-            curr_index = forward(cm, curr_index.ln, curr_index.pos, dir);
-        }
-        repeat--;
-    }
-    return new Pos(curr_index.ln, curr_index.pos);
-}
-function selectCompanionObject(cm, head, symb, inclusive) {
-    var cur = head, start, end;
-    var bracketRegexp = ({
-        '(': /[()]/, ')': /[()]/,
-        '[': /[[\]]/, ']': /[[\]]/,
-        '{': /[{}]/, '}': /[{}]/,
-        '<': /[<>]/, '>': /[<>]/
-    })[symb];
-    var openSym = ({
-        '(': '(', ')': '(',
-        '[': '[', ']': '[',
-        '{': '{', '}': '{',
-        '<': '<', '>': '<'
-    })[symb];
-    var curChar = cm.getLine(cur.line).charAt(cur.ch);
-    var offset = curChar === openSym ? 1 : 0;
-    start = cm.scanForBracket(new Pos(cur.line, cur.ch + offset), -1, undefined, { 'bracketRegex': bracketRegexp });
-    end = cm.scanForBracket(new Pos(cur.line, cur.ch + offset), 1, undefined, { 'bracketRegex': bracketRegexp });
-    if (!start || !end) {
-        return { start: cur, end: cur };
-    }
-    start = start.pos;
-    end = end.pos;
-    if ((start.line == end.line && start.ch > end.ch)
-        || (start.line > end.line)) {
-        var tmp = start;
-        start = end;
-        end = tmp;
-    }
-    if (inclusive) {
-        end.ch += 1;
-    }
-    else {
-        start.ch += 1;
-    }
-    return { start: start, end: end };
-}
-function findBeginningAndEnd(cm, head, symb, inclusive) {
-    var cur = copyCursor(head);
-    var line = cm.getLine(cur.line);
-    var chars = line.split('');
-    var start, end, i, len;
-    var firstIndex = chars.indexOf(symb);
-    if (cur.ch < firstIndex) {
-        cur.ch = firstIndex;
-    }
-    else if (firstIndex < cur.ch && chars[cur.ch] == symb) {
-        end = cur.ch; // assign end to the current cursor
-        --cur.ch; // make sure to look backwards
-    }
-    if (chars[cur.ch] == symb && !end) {
-        start = cur.ch + 1; // assign start to ahead of the cursor
-    }
-    else {
-        for (i = cur.ch; i > -1 && !start; i--) {
-            if (chars[i] == symb) {
-                start = i + 1;
-            }
-        }
-    }
-    if (start && !end) {
-        for (i = start, len = chars.length; i < len && !end; i++) {
-            if (chars[i] == symb) {
-                end = i;
-            }
-        }
-    }
-    if (!start || !end) {
-        return { start: cur, end: cur };
-    }
-    if (inclusive) {
-        --start;
-        ++end;
-    }
-    return {
-        start: new Pos(cur.line, start),
-        end: new Pos(cur.line, end)
-    };
-}
-defineOption('pcre', true, 'boolean');
-function SearchState() { }
-SearchState.prototype = {
-    getQuery: function () {
-        return vimGlobalState.query;
-    },
-    setQuery: function (query) {
-        vimGlobalState.query = query;
-    },
-    getOverlay: function () {
-        return this.searchOverlay;
-    },
-    setOverlay: function (overlay) {
-        this.searchOverlay = overlay;
-    },
-    isReversed: function () {
-        return vimGlobalState.isReversed;
-    },
-    setReversed: function (reversed) {
-        vimGlobalState.isReversed = reversed;
-    },
-    getScrollbarAnnotate: function () {
-        return this.annotate;
-    },
-    setScrollbarAnnotate: function (annotate) {
-        this.annotate = annotate;
-    }
-};
-function getSearchState(cm) {
-    var vim = cm.state.vim;
-    return vim.searchState_ || (vim.searchState_ = new SearchState());
-}
-function splitBySlash(argString) {
-    return splitBySeparator(argString, '/');
-}
-function findUnescapedSlashes(argString) {
-    return findUnescapedSeparators(argString, '/');
-}
-function splitBySeparator(argString, separator) {
-    var slashes = findUnescapedSeparators(argString, separator) || [];
-    if (!slashes.length)
-        return [];
-    var tokens = [];
-    if (slashes[0] !== 0)
-        return;
-    for (var i = 0; i < slashes.length; i++) {
-        if (typeof slashes[i] == 'number')
-            tokens.push(argString.substring(slashes[i] + 1, slashes[i + 1]));
-    }
-    return tokens;
-}
-function findUnescapedSeparators(str, separator) {
-    if (!separator)
-        separator = '/';
-    var escapeNextChar = false;
-    var slashes = [];
-    for (var i = 0; i < str.length; i++) {
-        var c = str.charAt(i);
-        if (!escapeNextChar && c == separator) {
-            slashes.push(i);
-        }
-        escapeNextChar = !escapeNextChar && (c == '\\');
-    }
-    return slashes;
-}
-function translateRegex(str) {
-    var specials = '|(){';
-    var unescape = '}';
-    var escapeNextChar = false;
-    var out = [];
-    for (var i = -1; i < str.length; i++) {
-        var c = str.charAt(i) || '';
-        var n = str.charAt(i + 1) || '';
-        var specialComesNext = (n && specials.indexOf(n) != -1);
-        if (escapeNextChar) {
-            if (c !== '\\' || !specialComesNext) {
-                out.push(c);
-            }
-            escapeNextChar = false;
-        }
-        else {
-            if (c === '\\') {
-                escapeNextChar = true;
-                if (n && unescape.indexOf(n) != -1) {
-                    specialComesNext = true;
-                }
-                if (!specialComesNext || n === '\\') {
-                    out.push(c);
-                }
-            }
-            else {
-                out.push(c);
-                if (specialComesNext && n !== '\\') {
-                    out.push('\\');
-                }
-            }
-        }
-    }
-    return out.join('');
-}
-var charUnescapes = { '\\n': '\n', '\\r': '\r', '\\t': '\t' };
-function translateRegexReplace(str) {
-    var escapeNextChar = false;
-    var out = [];
-    for (var i = -1; i < str.length; i++) {
-        var c = str.charAt(i) || '';
-        var n = str.charAt(i + 1) || '';
-        if (charUnescapes[c + n]) {
-            out.push(charUnescapes[c + n]);
-            i++;
-        }
-        else if (escapeNextChar) {
-            out.push(c);
-            escapeNextChar = false;
-        }
-        else {
-            if (c === '\\') {
-                escapeNextChar = true;
-                if ((isNumber(n) || n === '$')) {
-                    out.push('$');
-                }
-                else if (n !== '/' && n !== '\\') {
-                    out.push('\\');
-                }
-            }
-            else {
-                if (c === '$') {
-                    out.push('$');
-                }
-                out.push(c);
-                if (n === '/') {
-                    out.push('\\');
-                }
-            }
-        }
-    }
-    return out.join('');
-}
-var unescapes = { '\\/': '/', '\\\\': '\\', '\\n': '\n', '\\r': '\r', '\\t': '\t', '\\&': '&' };
-function unescapeRegexReplace(str) {
-    var stream = new CodeMirror.StringStream(str);
-    var output = [];
-    while (!stream.eol()) {
-        while (stream.peek() && stream.peek() != '\\') {
-            output.push(stream.next());
-        }
-        var matched = false;
-        for (var matcher in unescapes) {
-            if (stream.match(matcher, true)) {
-                matched = true;
-                output.push(unescapes[matcher]);
-                break;
-            }
-        }
-        if (!matched) {
-            output.push(stream.next());
-        }
-    }
-    return output.join('');
-}
-function parseQuery(query, ignoreCase, smartCase) {
-    var lastSearchRegister = vimGlobalState.registerController.getRegister('/');
-    lastSearchRegister.setText(query);
-    if (query instanceof RegExp) {
-        return query;
-    }
-    var slashes = findUnescapedSlashes(query);
-    var regexPart;
-    var forceIgnoreCase;
-    if (!slashes.length) {
-        regexPart = query;
-    }
-    else {
-        regexPart = query.substring(0, slashes[0]);
-        var flagsPart = query.substring(slashes[0]);
-        forceIgnoreCase = (flagsPart.indexOf('i') != -1);
-    }
-    if (!regexPart) {
-        return null;
-    }
-    if (!getOption('pcre')) {
-        regexPart = translateRegex(regexPart);
-    }
-    if (smartCase) {
-        ignoreCase = (/^[^A-Z]*$/).test(regexPart);
-    }
-    var regexp = new RegExp(regexPart, (ignoreCase || forceIgnoreCase) ? 'im' : 'm');
-    return regexp;
-}
-function hdom(n) {
-    if (typeof n === 'string')
-        n = document.createElement(n);
-    for (var a, i = 1; i < arguments.length; i++) {
-        if (!(a = arguments[i]))
-            continue;
-        if (typeof a !== 'object')
-            a = document.createTextNode(a);
-        if (a.nodeType)
-            n.appendChild(a);
-        else
-            for (var key in a) {
-                if (!Object.prototype.hasOwnProperty.call(a, key))
-                    continue;
-                if (key[0] === '$')
-                    n.style[key.slice(1)] = a[key];
-                else
-                    n.setAttribute(key, a[key]);
-            }
-    }
-    return n;
-}
-function showConfirm(cm, template) {
-    var pre = hdom('span', { $color: 'red', $whiteSpace: 'pre', class: 'cm-vim-message' }, template); //ace_patch span instead of pre
-    if (cm.openNotification) {
-        cm.openNotification(pre, { bottom: true, duration: 5000 });
-    }
-    else {
-        alert(pre.innerText);
-    }
-}
-function makePrompt(prefix, desc) {
-    return hdom(document.createDocumentFragment(), hdom('span', { $fontFamily: 'monospace', $whiteSpace: 'pre' }, prefix, hdom('input', { type: 'text', autocorrect: 'off',
-        autocapitalize: 'off', spellcheck: 'false' })), desc && hdom('span', { $color: '#888' }, desc));
-}
-function showPrompt(cm, options) {
-    var template = makePrompt(options.prefix, options.desc);
-    if (cm.openDialog) {
-        cm.openDialog(template, options.onClose, {
-            onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp,
-            bottom: true, selectValueOnOpen: false, value: options.value
-        });
-    }
-    else {
-        var shortText = '';
-        if (typeof options.prefix != "string" && options.prefix)
-            shortText += options.prefix.textContent;
-        if (options.desc)
-            shortText += " " + options.desc;
-        options.onClose(prompt(shortText, ''));
-    }
-}
-function regexEqual(r1, r2) {
-    if (r1 instanceof RegExp && r2 instanceof RegExp) {
-        var props = ['global', 'multiline', 'ignoreCase', 'source'];
-        for (var i = 0; i < props.length; i++) {
-            var prop = props[i];
-            if (r1[prop] !== r2[prop]) {
-                return false;
-            }
-        }
-        return true;
-    }
-    return false;
-}
-function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) {
-    if (!rawQuery) {
-        return;
-    }
-    var state = getSearchState(cm);
-    var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase);
-    if (!query) {
-        return;
-    }
-    highlightSearchMatches(cm, query);
-    if (regexEqual(query, state.getQuery())) {
-        return query;
-    }
-    state.setQuery(query);
-    return query;
-}
-function searchOverlay(query) {
-    if (query.source.charAt(0) == '^') {
-        var matchSol = true;
-    }
-    return {
-        token: function (stream) {
-            if (matchSol && !stream.sol()) {
-                stream.skipToEnd();
-                return;
-            }
-            var match = stream.match(query, false);
-            if (match) {
-                if (match[0].length == 0) {
-                    stream.next();
-                    return 'searching';
-                }
-                if (!stream.sol()) {
-                    stream.backUp(1);
-                    if (!query.exec(stream.next() + match[0])) {
-                        stream.next();
-                        return null;
-                    }
-                }
-                stream.match(query);
-                return 'searching';
-            }
-            while (!stream.eol()) {
-                stream.next();
-                if (stream.match(query, false))
-                    break;
-            }
-        },
-        query: query
-    };
-}
-function highlightSearchMatches(cm, query) {
-    var searchState = getSearchState(cm);
-    var overlay = searchState.getOverlay();
-    if (!overlay || query != overlay.query) {
-        if (overlay) {
-            cm.removeOverlay(overlay);
-        }
-        overlay = searchOverlay(query);
-        cm.addOverlay(overlay);
-        if (cm.showMatchesOnScrollbar) {
-            if (searchState.getScrollbarAnnotate()) {
-                searchState.getScrollbarAnnotate().clear();
-            }
-            searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query));
-        }
-        searchState.setOverlay(overlay);
-    }
-}
-function findNext(cm, prev, query, repeat) {
-    if (repeat === undefined) {
-        repeat = 1;
-    }
-    return cm.operation(function () {
-        var pos = cm.getCursor();
-        var cursor = cm.getSearchCursor(query, pos);
-        for (var i = 0; i < repeat; i++) {
-            var found = cursor.find(prev);
-            if (i == 0 && found && cursorEqual(cursor.from(), pos)) {
-                var lastEndPos = prev ? cursor.from() : cursor.to();
-                found = cursor.find(prev);
-                if (found && !found[0] && cursorEqual(cursor.from(), lastEndPos)) {
-                    if (cm.getLine(lastEndPos.line).length == lastEndPos.ch)
-                        found = cursor.find(prev);
-                }
-            }
-            if (!found) {
-                cursor = cm.getSearchCursor(query, (prev) ? new Pos(cm.lastLine()) : new Pos(cm.firstLine(), 0));
-                if (!cursor.find(prev)) {
-                    return;
-                }
-            }
-        }
-        return cursor.from();
-    });
-}
-function findNextFromAndToInclusive(cm, prev, query, repeat, vim) {
-    if (repeat === undefined) {
-        repeat = 1;
-    }
-    return cm.operation(function () {
-        var pos = cm.getCursor();
-        var cursor = cm.getSearchCursor(query, pos);
-        var found = cursor.find(!prev);
-        if (!vim.visualMode && found && cursorEqual(cursor.from(), pos)) {
-            cursor.find(!prev);
-        }
-        for (var i = 0; i < repeat; i++) {
-            found = cursor.find(prev);
-            if (!found) {
-                cursor = cm.getSearchCursor(query, (prev) ? new Pos(cm.lastLine()) : new Pos(cm.firstLine(), 0));
-                if (!cursor.find(prev)) {
-                    return;
-                }
-            }
-        }
-        return [cursor.from(), cursor.to()];
-    });
-}
-function clearSearchHighlight(cm) {
-    var state = getSearchState(cm);
-    cm.removeOverlay(getSearchState(cm).getOverlay());
-    state.setOverlay(null);
-    if (state.getScrollbarAnnotate()) {
-        state.getScrollbarAnnotate().clear();
-        state.setScrollbarAnnotate(null);
-    }
-}
-function isInRange(pos, start, end) {
-    if (typeof pos != 'number') {
-        pos = pos.line;
-    }
-    if (start instanceof Array) {
-        return inArray(pos, start);
-    }
-    else {
-        if (typeof end == 'number') {
-            return (pos >= start && pos <= end);
-        }
-        else {
-            return pos == start;
-        }
-    }
-}
-function getUserVisibleLines(cm) {
-    var renderer = cm.ace.renderer;
-    return {
-        top: renderer.getFirstFullyVisibleRow(),
-        bottom: renderer.getLastFullyVisibleRow()
-    };
-}
-function getMarkPos(cm, vim, markName) {
-    if (markName == '\'' || markName == '`') {
-        return vimGlobalState.jumpList.find(cm, -1) || new Pos(0, 0);
-    }
-    else if (markName == '.') {
-        return getLastEditPos(cm);
-    }
-    var mark = vim.marks[markName];
-    return mark && mark.find();
-}
-function getLastEditPos(cm) {
-    var undoManager = cm.ace.session.$undoManager;
-    if (undoManager && undoManager.$lastDelta)
-        return toCmPos(undoManager.$lastDelta.end);
-}
-var ExCommandDispatcher = function () {
-    this.buildCommandMap_();
-};
-ExCommandDispatcher.prototype = {
-    processCommand: function (cm, input, opt_params) {
-        var that = this;
-        cm.operation(function () {
-            cm.curOp.isVimOp = true;
-            that._processCommand(cm, input, opt_params);
-        });
-    },
-    _processCommand: function (cm, input, opt_params) {
-        var vim = cm.state.vim;
-        var commandHistoryRegister = vimGlobalState.registerController.getRegister(':');
-        var previousCommand = commandHistoryRegister.toString();
-        if (vim.visualMode) {
-            exitVisualMode(cm);
-        }
-        var inputStream = new CodeMirror.StringStream(input);
-        commandHistoryRegister.setText(input);
-        var params = opt_params || {};
-        params.input = input;
-        try {
-            this.parseInput_(cm, inputStream, params);
-        }
-        catch (e) {
-            showConfirm(cm, e.toString());
-            throw e;
-        }
-        var command;
-        var commandName;
-        if (!params.commandName) {
-            if (params.line !== undefined) {
-                commandName = 'move';
-            }
-        }
-        else {
-            command = this.matchCommand_(params.commandName);
-            if (command) {
-                commandName = command.name;
-                if (command.excludeFromCommandHistory) {
-                    commandHistoryRegister.setText(previousCommand);
-                }
-                this.parseCommandArgs_(inputStream, params, command);
-                if (command.type == 'exToKey') {
-                    for (var i = 0; i < command.toKeys.length; i++) {
-                        vimApi.handleKey(cm, command.toKeys[i], 'mapping');
-                    }
-                    return;
-                }
-                else if (command.type == 'exToEx') {
-                    this.processCommand(cm, command.toInput);
-                    return;
-                }
-            }
-        }
-        if (!commandName) {
-            showConfirm(cm, 'Not an editor command ":' + input + '"');
-            return;
-        }
-        try {
-            exCommands[commandName](cm, params);
-            if ((!command || !command.possiblyAsync) && params.callback) {
-                params.callback();
-            }
-        }
-        catch (e) {
-            showConfirm(cm, e.toString());
-            throw e;
-        }
-    },
-    parseInput_: function (cm, inputStream, result) {
-        inputStream.eatWhile(':');
-        if (inputStream.eat('%')) {
-            result.line = cm.firstLine();
-            result.lineEnd = cm.lastLine();
-        }
-        else {
-            result.line = this.parseLineSpec_(cm, inputStream);
-            if (result.line !== undefined && inputStream.eat(',')) {
-                result.lineEnd = this.parseLineSpec_(cm, inputStream);
-            }
-        }
-        var commandMatch = inputStream.match(/^(\w+|!!|@@|[!#&*<=>@~])/);
-        if (commandMatch) {
-            result.commandName = commandMatch[1];
-        }
-        else {
-            result.commandName = inputStream.match(/.*/)[0];
-        }
-        return result;
-    },
-    parseLineSpec_: function (cm, inputStream) {
-        var numberMatch = inputStream.match(/^(\d+)/);
-        if (numberMatch) {
-            return parseInt(numberMatch[1], 10) - 1;
-        }
-        switch (inputStream.next()) {
-            case '.':
-                return this.parseLineSpecOffset_(inputStream, cm.getCursor().line);
-            case '$':
-                return this.parseLineSpecOffset_(inputStream, cm.lastLine());
-            case '\'':
-                var markName = inputStream.next();
-                var markPos = getMarkPos(cm, cm.state.vim, markName);
-                if (!markPos)
-                    throw new Error('Mark not set');
-                return this.parseLineSpecOffset_(inputStream, markPos.line);
-            case '-':
-            case '+':
-                inputStream.backUp(1);
-                return this.parseLineSpecOffset_(inputStream, cm.getCursor().line);
-            default:
-                inputStream.backUp(1);
-                return undefined;
-        }
-    },
-    parseLineSpecOffset_: function (inputStream, line) {
-        var offsetMatch = inputStream.match(/^([+-])?(\d+)/);
-        if (offsetMatch) {
-            var offset = parseInt(offsetMatch[2], 10);
-            if (offsetMatch[1] == "-") {
-                line -= offset;
-            }
-            else {
-                line += offset;
-            }
-        }
-        return line;
-    },
-    parseCommandArgs_: function (inputStream, params, command) {
-        if (inputStream.eol()) {
-            return;
-        }
-        params.argString = inputStream.match(/.*/)[0];
-        var delim = command.argDelimiter || /\s+/;
-        var args = trim(params.argString).split(delim);
-        if (args.length && args[0]) {
-            params.args = args;
-        }
-    },
-    matchCommand_: function (commandName) {
-        for (var i = commandName.length; i > 0; i--) {
-            var prefix = commandName.substring(0, i);
-            if (this.commandMap_[prefix]) {
-                var command = this.commandMap_[prefix];
-                if (command.name.indexOf(commandName) === 0) {
-                    return command;
-                }
-            }
-        }
-        return null;
-    },
-    buildCommandMap_: function () {
-        this.commandMap_ = {};
-        for (var i = 0; i < defaultExCommandMap.length; i++) {
-            var command = defaultExCommandMap[i];
-            var key = command.shortName || command.name;
-            this.commandMap_[key] = command;
-        }
-    },
-    map: function (lhs, rhs, ctx) {
-        if (lhs != ':' && lhs.charAt(0) == ':') {
-            if (ctx) {
-                throw Error('Mode not supported for ex mappings');
-            }
-            var commandName = lhs.substring(1);
-            if (rhs != ':' && rhs.charAt(0) == ':') {
-                this.commandMap_[commandName] = {
-                    name: commandName,
-                    type: 'exToEx',
-                    toInput: rhs.substring(1),
-                    user: true
-                };
-            }
-            else {
-                this.commandMap_[commandName] = {
-                    name: commandName,
-                    type: 'exToKey',
-                    toKeys: rhs,
-                    user: true
-                };
-            }
-        }
-        else {
-            if (rhs != ':' && rhs.charAt(0) == ':') {
-                var mapping = {
-                    keys: lhs,
-                    type: 'keyToEx',
-                    exArgs: { input: rhs.substring(1) }
-                };
-                if (ctx) {
-                    mapping.context = ctx;
-                }
-                defaultKeymap.unshift(mapping);
-            }
-            else {
-                var mapping = {
-                    keys: lhs,
-                    type: 'keyToKey',
-                    toKeys: rhs
-                };
-                if (ctx) {
-                    mapping.context = ctx;
-                }
-                defaultKeymap.unshift(mapping);
-            }
-        }
-    },
-    unmap: function (lhs, ctx) {
-        if (lhs != ':' && lhs.charAt(0) == ':') {
-            if (ctx) {
-                throw Error('Mode not supported for ex mappings');
-            }
-            var commandName = lhs.substring(1);
-            if (this.commandMap_[commandName] && this.commandMap_[commandName].user) {
-                delete this.commandMap_[commandName];
-                return true;
-            }
-        }
-        else {
-            var keys = lhs;
-            for (var i = 0; i < defaultKeymap.length; i++) {
-                if (keys == defaultKeymap[i].keys
-                    && defaultKeymap[i].context === ctx) {
-                    defaultKeymap.splice(i, 1);
-                    return true;
-                }
-            }
-        }
-    }
-};
-var exCommands = {
-    colorscheme: function (cm, params) {
-        if (!params.args || params.args.length < 1) {
-            showConfirm(cm, cm.getOption('theme'));
-            return;
-        }
-        cm.setOption('theme', params.args[0]);
-    },
-    map: function (cm, params, ctx) {
-        var mapArgs = params.args;
-        if (!mapArgs || mapArgs.length < 2) {
-            if (cm) {
-                showConfirm(cm, 'Invalid mapping: ' + params.input);
-            }
-            return;
-        }
-        exCommandDispatcher.map(mapArgs[0], mapArgs[1], ctx);
-    },
-    imap: function (cm, params) { this.map(cm, params, 'insert'); },
-    nmap: function (cm, params) { this.map(cm, params, 'normal'); },
-    vmap: function (cm, params) { this.map(cm, params, 'visual'); },
-    unmap: function (cm, params, ctx) {
-        var mapArgs = params.args;
-        if (!mapArgs || mapArgs.length < 1 || !exCommandDispatcher.unmap(mapArgs[0], ctx)) {
-            if (cm) {
-                showConfirm(cm, 'No such mapping: ' + params.input);
-            }
-        }
-    },
-    move: function (cm, params) {
-        commandDispatcher.processCommand(cm, cm.state.vim, {
-            type: 'motion',
-            motion: 'moveToLineOrEdgeOfDocument',
-            motionArgs: { forward: false, explicitRepeat: true,
-                linewise: true },
-            repeatOverride: params.line + 1
-        });
-    },
-    set: function (cm, params) {
-        var setArgs = params.args;
-        var setCfg = params.setCfg || {};
-        if (!setArgs || setArgs.length < 1) {
-            if (cm) {
-                showConfirm(cm, 'Invalid mapping: ' + params.input);
-            }
-            return;
-        }
-        var expr = setArgs[0].split('=');
-        var optionName = expr[0];
-        var value = expr[1];
-        var forceGet = false;
-        if (optionName.charAt(optionName.length - 1) == '?') {
-            if (value) {
-                throw Error('Trailing characters: ' + params.argString);
-            }
-            optionName = optionName.substring(0, optionName.length - 1);
-            forceGet = true;
-        }
-        if (value === undefined && optionName.substring(0, 2) == 'no') {
-            optionName = optionName.substring(2);
-            value = false;
-        }
-        var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean';
-        if (optionIsBoolean && value == undefined) {
-            value = true;
-        }
-        if (!optionIsBoolean && value === undefined || forceGet) {
-            var oldValue = getOption(optionName, cm, setCfg);
-            if (oldValue instanceof Error) {
-                showConfirm(cm, oldValue.message);
-            }
-            else if (oldValue === true || oldValue === false) {
-                showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName);
-            }
-            else {
-                showConfirm(cm, '  ' + optionName + '=' + oldValue);
-            }
-        }
-        else {
-            var setOptionReturn = setOption(optionName, value, cm, setCfg);
-            if (setOptionReturn instanceof Error) {
-                showConfirm(cm, setOptionReturn.message);
-            }
-        }
-    },
-    setlocal: function (cm, params) {
-        params.setCfg = { scope: 'local' };
-        this.set(cm, params);
-    },
-    setglobal: function (cm, params) {
-        params.setCfg = { scope: 'global' };
-        this.set(cm, params);
-    },
-    registers: function (cm, params) {
-        var regArgs = params.args;
-        var registers = vimGlobalState.registerController.registers;
-        var regInfo = '----------Registers----------\n\n';
-        if (!regArgs) {
-            for (var registerName in registers) {
-                var text = registers[registerName].toString();
-                if (text.length) {
-                    regInfo += '"' + registerName + '    ' + text + '\n';
-                }
-            }
-        }
-        else {
-            var registerName;
-            regArgs = regArgs.join('');
-            for (var i = 0; i < regArgs.length; i++) {
-                registerName = regArgs.charAt(i);
-                if (!vimGlobalState.registerController.isValidRegister(registerName)) {
-                    continue;
-                }
-                var register = registers[registerName] || new Register();
-                regInfo += '"' + registerName + '    ' + register.toString() + '\n';
-            }
-        }
-        showConfirm(cm, regInfo);
-    },
-    sort: function (cm, params) {
-        var reverse, ignoreCase, unique, number, pattern;
-        function parseArgs() {
-            if (params.argString) {
-                var args = new CodeMirror.StringStream(params.argString);
-                if (args.eat('!')) {
-                    reverse = true;
-                }
-                if (args.eol()) {
-                    return;
-                }
-                if (!args.eatSpace()) {
-                    return 'Invalid arguments';
-                }
-                var opts = args.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);
-                if (!opts && !args.eol()) {
-                    return 'Invalid arguments';
-                }
-                if (opts[1]) {
-                    ignoreCase = opts[1].indexOf('i') != -1;
-                    unique = opts[1].indexOf('u') != -1;
-                    var decimal = opts[1].indexOf('d') != -1 || opts[1].indexOf('n') != -1 && 1;
-                    var hex = opts[1].indexOf('x') != -1 && 1;
-                    var octal = opts[1].indexOf('o') != -1 && 1;
-                    if (decimal + hex + octal > 1) {
-                        return 'Invalid arguments';
-                    }
-                    number = decimal && 'decimal' || hex && 'hex' || octal && 'octal';
-                }
-                if (opts[2]) {
-                    pattern = new RegExp(opts[2].substr(1, opts[2].length - 2), ignoreCase ? 'i' : '');
-                }
-            }
-        }
-        var err = parseArgs();
-        if (err) {
-            showConfirm(cm, err + ': ' + params.argString);
-            return;
-        }
-        var lineStart = params.line || cm.firstLine();
-        var lineEnd = params.lineEnd || params.line || cm.lastLine();
-        if (lineStart == lineEnd) {
-            return;
-        }
-        var curStart = new Pos(lineStart, 0);
-        var curEnd = new Pos(lineEnd, lineLength(cm, lineEnd));
-        var text = cm.getRange(curStart, curEnd).split('\n');
-        var numberRegex = pattern ? pattern :
-            (number == 'decimal') ? /(-?)([\d]+)/ :
-                (number == 'hex') ? /(-?)(?:0x)?([0-9a-f]+)/i :
-                    (number == 'octal') ? /([0-7]+)/ : null;
-        var radix = (number == 'decimal') ? 10 : (number == 'hex') ? 16 : (number == 'octal') ? 8 : null;
-        var numPart = [], textPart = [];
-        if (number || pattern) {
-            for (var i = 0; i < text.length; i++) {
-                var matchPart = pattern ? text[i].match(pattern) : null;
-                if (matchPart && matchPart[0] != '') {
-                    numPart.push(matchPart);
-                }
-                else if (!pattern && numberRegex.exec(text[i])) {
-                    numPart.push(text[i]);
-                }
-                else {
-                    textPart.push(text[i]);
-                }
-            }
-        }
-        else {
-            textPart = text;
-        }
-        function compareFn(a, b) {
-            if (reverse) {
-                var tmp;
-                tmp = a;
-                a = b;
-                b = tmp;
-            }
-            if (ignoreCase) {
-                a = a.toLowerCase();
-                b = b.toLowerCase();
-            }
-            var anum = number && numberRegex.exec(a);
-            var bnum = number && numberRegex.exec(b);
-            if (!anum) {
-                return a < b ? -1 : 1;
-            }
-            anum = parseInt((anum[1] + anum[2]).toLowerCase(), radix);
-            bnum = parseInt((bnum[1] + bnum[2]).toLowerCase(), radix);
-            return anum - bnum;
-        }
-        function comparePatternFn(a, b) {
-            if (reverse) {
-                var tmp;
-                tmp = a;
-                a = b;
-                b = tmp;
-            }
-            if (ignoreCase) {
-                a[0] = a[0].toLowerCase();
-                b[0] = b[0].toLowerCase();
-            }
-            return (a[0] < b[0]) ? -1 : 1;
-        }
-        numPart.sort(pattern ? comparePatternFn : compareFn);
-        if (pattern) {
-            for (var i = 0; i < numPart.length; i++) {
-                numPart[i] = numPart[i].input;
-            }
-        }
-        else if (!number) {
-            textPart.sort(compareFn);
-        }
-        text = (!reverse) ? textPart.concat(numPart) : numPart.concat(textPart);
-        if (unique) { // Remove duplicate lines
-            var textOld = text;
-            var lastLine;
-            text = [];
-            for (var i = 0; i < textOld.length; i++) {
-                if (textOld[i] != lastLine) {
-                    text.push(textOld[i]);
-                }
-                lastLine = textOld[i];
-            }
-        }
-        cm.replaceRange(text.join('\n'), curStart, curEnd);
-    },
-    vglobal: function (cm, params) {
-        this.global(cm, params);
-    },
-    global: function (cm, params) {
-        var argString = params.argString;
-        if (!argString) {
-            showConfirm(cm, 'Regular Expression missing from global');
-            return;
-        }
-        var inverted = params.commandName[0] === 'v';
-        var lineStart = (params.line !== undefined) ? params.line : cm.firstLine();
-        var lineEnd = params.lineEnd || params.line || cm.lastLine();
-        var tokens = splitBySlash(argString);
-        var regexPart = argString, cmd;
-        if (tokens.length) {
-            regexPart = tokens[0];
-            cmd = tokens.slice(1, tokens.length).join('/');
-        }
-        if (regexPart) {
-            try {
-                updateSearchQuery(cm, regexPart, true /** ignoreCase */, true /** smartCase */);
-            }
-            catch (e) {
-                showConfirm(cm, 'Invalid regex: ' + regexPart);
-                return;
-            }
-        }
-        var query = getSearchState(cm).getQuery();
-        var matchedLines = [];
-        for (var i = lineStart; i <= lineEnd; i++) {
-            var line = cm.getLineHandle(i);
-            var matched = query.test(line.text);
-            if (matched !== inverted) {
-                matchedLines.push(cmd ? line : line.text);
-            }
-        }
-        if (!cmd) {
-            showConfirm(cm, matchedLines.join('\n'));
-            return;
-        }
-        var index = 0;
-        var nextCommand = function () {
-            if (index < matchedLines.length) {
-                var line = matchedLines[index++];
-                var lineNum = cm.getLineNumber(line);
-                if (lineNum == null) {
-                    nextCommand();
-                    return;
-                }
-                var command = (lineNum + 1) + cmd;
-                exCommandDispatcher.processCommand(cm, command, {
-                    callback: nextCommand
-                });
-            }
-        };
-        nextCommand();
-    },
-    substitute: function (cm, params) {
-        if (!cm.getSearchCursor) {
-            throw new Error('Search feature not available. Requires searchcursor.js or ' +
-                'any other getSearchCursor implementation.');
-        }
-        var argString = params.argString;
-        var tokens = argString ? splitBySeparator(argString, argString[0]) : [];
-        var regexPart, replacePart = '', trailing, flagsPart, count;
-        var confirm = false; // Whether to confirm each replace.
-        var global = false; // True to replace all instances on a line, false to replace only 1.
-        if (tokens.length) {
-            regexPart = tokens[0];
-            if (getOption('pcre') && regexPart !== '') {
-                regexPart = new RegExp(regexPart).source; //normalize not escaped characters
-            }
-            replacePart = tokens[1];
-            if (replacePart !== undefined) {
-                if (getOption('pcre')) {
-                    replacePart = unescapeRegexReplace(replacePart.replace(/([^\\])&/g, "$1$$&"));
-                }
-                else {
-                    replacePart = translateRegexReplace(replacePart);
-                }
-                vimGlobalState.lastSubstituteReplacePart = replacePart;
-            }
-            trailing = tokens[2] ? tokens[2].split(' ') : [];
-        }
-        else {
-            if (argString && argString.length) {
-                showConfirm(cm, 'Substitutions should be of the form ' +
-                    ':s/pattern/replace/');
-                return;
-            }
-        }
-        if (trailing) {
-            flagsPart = trailing[0];
-            count = parseInt(trailing[1]);
-            if (flagsPart) {
-                if (flagsPart.indexOf('c') != -1) {
-                    confirm = true;
-                }
-                if (flagsPart.indexOf('g') != -1) {
-                    global = true;
-                }
-                if (getOption('pcre')) {
-                    regexPart = regexPart + '/' + flagsPart;
-                }
-                else {
-                    regexPart = regexPart.replace(/\//g, "\\/") + '/' + flagsPart;
-                }
-            }
-        }
-        if (regexPart) {
-            try {
-                updateSearchQuery(cm, regexPart, true /** ignoreCase */, true /** smartCase */);
-            }
-            catch (e) {
-                showConfirm(cm, 'Invalid regex: ' + regexPart);
-                return;
-            }
-        }
-        replacePart = replacePart || vimGlobalState.lastSubstituteReplacePart;
-        if (replacePart === undefined) {
-            showConfirm(cm, 'No previous substitute regular expression');
-            return;
-        }
-        var state = getSearchState(cm);
-        var query = state.getQuery();
-        var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line;
-        var lineEnd = params.lineEnd || lineStart;
-        if (lineStart == cm.firstLine() && lineEnd == cm.lastLine()) {
-            lineEnd = Infinity;
-        }
-        if (count) {
-            lineStart = lineEnd;
-            lineEnd = lineStart + count - 1;
-        }
-        var startPos = clipCursorToContent(cm, new Pos(lineStart, 0));
-        var cursor = cm.getSearchCursor(query, startPos);
-        doReplace(cm, confirm, global, lineStart, lineEnd, cursor, query, replacePart, params.callback);
-    },
-    redo: CodeMirror.commands.redo,
-    undo: CodeMirror.commands.undo,
-    write: function (cm) {
-        if (CodeMirror.commands.save) {
-            CodeMirror.commands.save(cm);
-        }
-        else if (cm.save) {
-            cm.save();
-        }
-    },
-    nohlsearch: function (cm) {
-        clearSearchHighlight(cm);
-    },
-    yank: function (cm) {
-        var cur = copyCursor(cm.getCursor());
-        var line = cur.line;
-        var lineText = cm.getLine(line);
-        vimGlobalState.registerController.pushText('0', 'yank', lineText, true, true);
-    },
-    delmarks: function (cm, params) {
-        if (!params.argString || !trim(params.argString)) {
-            showConfirm(cm, 'Argument required');
-            return;
-        }
-        var state = cm.state.vim;
-        var stream = new CodeMirror.StringStream(trim(params.argString));
-        while (!stream.eol()) {
-            stream.eatSpace();
-            var count = stream.pos;
-            if (!stream.match(/[a-zA-Z]/, false)) {
-                showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
-                return;
-            }
-            var sym = stream.next();
-            if (stream.match('-', true)) {
-                if (!stream.match(/[a-zA-Z]/, false)) {
-                    showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
-                    return;
-                }
-                var startMark = sym;
-                var finishMark = stream.next();
-                if (isLowerCase(startMark) && isLowerCase(finishMark) ||
-                    isUpperCase(startMark) && isUpperCase(finishMark)) {
-                    var start = startMark.charCodeAt(0);
-                    var finish = finishMark.charCodeAt(0);
-                    if (start >= finish) {
-                        showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
-                        return;
-                    }
-                    for (var j = 0; j <= finish - start; j++) {
-                        var mark = String.fromCharCode(start + j);
-                        delete state.marks[mark];
-                    }
-                }
-                else {
-                    showConfirm(cm, 'Invalid argument: ' + startMark + '-');
-                    return;
-                }
-            }
-            else {
-                delete state.marks[sym];
-            }
-        }
-    }
-};
-var exCommandDispatcher = new ExCommandDispatcher();
-function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query, replaceWith, callback) {
-    cm.state.vim.exMode = true;
-    var done = false;
-    var lastPos, modifiedLineNumber, joined;
-    function replaceAll() {
-        cm.operation(function () {
-            while (!done) {
-                replace();
-                next();
-            }
-            stop();
-        });
-    }
-    function replace() {
-        var text = cm.getRange(searchCursor.from(), searchCursor.to());
-        var newText = text.replace(query, replaceWith);
-        var unmodifiedLineNumber = searchCursor.to().line;
-        searchCursor.replace(newText);
-        modifiedLineNumber = searchCursor.to().line;
-        lineEnd += modifiedLineNumber - unmodifiedLineNumber;
-        joined = modifiedLineNumber < unmodifiedLineNumber;
-    }
-    function findNextValidMatch() {
-        var lastMatchTo = lastPos && copyCursor(searchCursor.to());
-        var match = searchCursor.findNext();
-        if (match && !match[0] && lastMatchTo && cursorEqual(searchCursor.from(), lastMatchTo)) {
-            match = searchCursor.findNext();
-        }
-        return match;
-    }
-    function next() {
-        while (findNextValidMatch() &&
-            isInRange(searchCursor.from(), lineStart, lineEnd)) {
-            if (!global && searchCursor.from().line == modifiedLineNumber && !joined) {
-                continue;
-            }
-            cm.scrollIntoView(searchCursor.from(), 30);
-            cm.setSelection(searchCursor.from(), searchCursor.to());
-            lastPos = searchCursor.from();
-            done = false;
-            return;
-        }
-        done = true;
-    }
-    function stop(close) {
-        if (close) {
-            close();
-        }
-        cm.focus();
-        if (lastPos) {
-            cm.setCursor(lastPos);
-            var vim = cm.state.vim;
-            vim.exMode = false;
-            vim.lastHPos = vim.lastHSPos = lastPos.ch;
-        }
-        if (callback) {
-            callback();
-        }
-    }
-    function onPromptKeyDown(e, _value, close) {
-        CodeMirror.e_stop(e);
-        var keyName = CodeMirror.keyName(e);
-        switch (keyName) {
-            case 'Y':
-                replace();
-                next();
-                break;
-            case 'N':
-                next();
-                break;
-            case 'A':
-                var savedCallback = callback;
-                callback = undefined;
-                cm.operation(replaceAll);
-                callback = savedCallback;
-                break;
-            case 'L':
-                replace();
-            case 'Q':
-            case 'Esc':
-            case 'Ctrl-C':
-            case 'Ctrl-[':
-                stop(close);
-                break;
-        }
-        if (done) {
-            stop(close);
-        }
-        return true;
-    }
-    next();
-    if (done) {
-        showConfirm(cm, 'No matches for ' + query.source);
-        return;
-    }
-    if (!confirm) {
-        replaceAll();
-        if (callback) {
-            callback();
-        }
-        return;
-    }
-    showPrompt(cm, {
-        prefix: hdom('span', 'replace with ', hdom('strong', replaceWith), ' (y/n/a/q/l)'),
-        onKeyDown: onPromptKeyDown
-    });
-}
-CodeMirror.keyMap.vim = {
-    attach: attachVimMap,
-    detach: detachVimMap,
-    call: cmKey
-};
-function exitInsertMode(cm) {
-    var vim = cm.state.vim;
-    var macroModeState = vimGlobalState.macroModeState;
-    var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.');
-    var isPlaying = macroModeState.isPlaying;
-    var lastChange = macroModeState.lastInsertModeChanges;
-    if (!isPlaying) {
-        cm.off('change', onChange);
-        CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);
-    }
-    if (!isPlaying && vim.insertModeRepeat > 1) {
-        repeatLastEdit(cm, vim, vim.insertModeRepeat - 1, true /** repeatForInsert */);
-        vim.lastEditInputState.repeatOverride = vim.insertModeRepeat;
-    }
-    delete vim.insertModeRepeat;
-    vim.insertMode = false;
-    cm.setCursor(cm.getCursor().line, cm.getCursor().ch - 1);
-    cm.setOption('keyMap', 'vim');
-    cm.setOption('disableInput', true);
-    cm.toggleOverwrite(false); // exit replace mode if we were in it.
-    insertModeChangeRegister.setText(lastChange.changes.join(''));
-    CodeMirror.signal(cm, "vim-mode-change", { mode: "normal" });
-    if (macroModeState.isRecording) {
-        logInsertModeChange(macroModeState);
-    }
-}
-function _mapCommand(command) {
-    defaultKeymap.unshift(command);
-}
-function mapCommand(keys, type, name, args, extra) {
-    var command = { keys: keys, type: type };
-    command[type] = name;
-    command[type + "Args"] = args;
-    for (var key in extra)
-        command[key] = extra[key];
-    _mapCommand(command);
-}
-defineOption('insertModeEscKeysTimeout', 200, 'number');
-CodeMirror.keyMap['vim-insert'] = {
-    fallthrough: ['default'],
-    attach: attachVimMap,
-    detach: detachVimMap,
-    call: cmKey
-};
-CodeMirror.keyMap['vim-replace'] = {
-    'Backspace': 'goCharLeft',
-    fallthrough: ['vim-insert'],
-    attach: attachVimMap,
-    detach: detachVimMap,
-    call: cmKey
-};
-function executeMacroRegister(cm, vim, macroModeState, registerName) {
-    var register = vimGlobalState.registerController.getRegister(registerName);
-    if (registerName == ':') {
-        if (register.keyBuffer[0]) {
-            exCommandDispatcher.processCommand(cm, register.keyBuffer[0]);
-        }
-        macroModeState.isPlaying = false;
-        return;
-    }
-    var keyBuffer = register.keyBuffer;
-    var imc = 0;
-    macroModeState.isPlaying = true;
-    macroModeState.replaySearchQueries = register.searchQueries.slice(0);
-    for (var i = 0; i < keyBuffer.length; i++) {
-        var text = keyBuffer[i];
-        var match, key;
-        while (text) {
-            match = (/<\w+-.+?>|<\w+>|./).exec(text);
-            key = match[0];
-            text = text.substring(match.index + key.length);
-            vimApi.handleKey(cm, key, 'macro');
-            if (vim.insertMode) {
-                var changes = register.insertModeChanges[imc++].changes;
-                vimGlobalState.macroModeState.lastInsertModeChanges.changes =
-                    changes;
-                repeatInsertModeChanges(cm, changes, 1);
-                exitInsertMode(cm);
-            }
-        }
-    }
-    macroModeState.isPlaying = false;
-}
-function logKey(macroModeState, key) {
-    if (macroModeState.isPlaying) {
-        return;
-    }
-    var registerName = macroModeState.latestRegister;
-    var register = vimGlobalState.registerController.getRegister(registerName);
-    if (register) {
-        register.pushText(key);
-    }
-}
-function logInsertModeChange(macroModeState) {
-    if (macroModeState.isPlaying) {
-        return;
-    }
-    var registerName = macroModeState.latestRegister;
-    var register = vimGlobalState.registerController.getRegister(registerName);
-    if (register && register.pushInsertModeChanges) {
-        register.pushInsertModeChanges(macroModeState.lastInsertModeChanges);
-    }
-}
-function logSearchQuery(macroModeState, query) {
-    if (macroModeState.isPlaying) {
-        return;
-    }
-    var registerName = macroModeState.latestRegister;
-    var register = vimGlobalState.registerController.getRegister(registerName);
-    if (register && register.pushSearchQuery) {
-        register.pushSearchQuery(query);
-    }
-}
-function onChange(cm, changeObj) {
-    var macroModeState = vimGlobalState.macroModeState;
-    var lastChange = macroModeState.lastInsertModeChanges;
-    if (!macroModeState.isPlaying) {
-        while (changeObj) {
-            lastChange.expectCursorActivityForChange = true;
-            if (lastChange.ignoreCount > 1) {
-                lastChange.ignoreCount--;
-            }
-            else if (changeObj.origin == '+input' || changeObj.origin == 'paste'
-                || changeObj.origin === undefined /* only in testing */) {
-                var selectionCount = cm.listSelections().length;
-                if (selectionCount > 1)
-                    lastChange.ignoreCount = selectionCount;
-                var text = changeObj.text.join('\n');
-                if (lastChange.maybeReset) {
-                    lastChange.changes = [];
-                    lastChange.maybeReset = false;
-                }
-                if (text) {
-                    if (cm.state.overwrite && !/\n/.test(text)) {
-                        lastChange.changes.push([text]);
-                    }
-                    else {
-                        lastChange.changes.push(text);
-                    }
-                }
-            }
-            changeObj = changeObj.next;
-        }
-    }
-}
-function onCursorActivity(cm) {
-    var vim = cm.state.vim;
-    if (vim.insertMode) {
-        var macroModeState = vimGlobalState.macroModeState;
-        if (macroModeState.isPlaying) {
-            return;
-        }
-        var lastChange = macroModeState.lastInsertModeChanges;
-        if (lastChange.expectCursorActivityForChange) {
-            lastChange.expectCursorActivityForChange = false;
-        }
-        else {
-            lastChange.maybeReset = true;
-        }
-    }
-    else if (!cm.curOp.isVimOp) {
-        handleExternalSelection(cm, vim);
-    }
-}
-function handleExternalSelection(cm, vim, keepHPos) {
-    var anchor = cm.getCursor('anchor');
-    var head = cm.getCursor('head');
-    if (vim.visualMode && !cm.somethingSelected()) {
-        exitVisualMode(cm, false);
-    }
-    else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) {
-        vim.visualMode = true;
-        vim.visualLine = false;
-        CodeMirror.signal(cm, "vim-mode-change", { mode: "visual" });
-    }
-    if (vim.visualMode) {
-        var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0;
-        var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0;
-        head = offsetCursor(head, 0, headOffset);
-        anchor = offsetCursor(anchor, 0, anchorOffset);
-        vim.sel = {
-            anchor: anchor,
-            head: head
-        };
-        updateMark(cm, vim, '<', cursorMin(head, anchor));
-        updateMark(cm, vim, '>', cursorMax(head, anchor));
-    }
-    else if (!vim.insertMode && !keepHPos) {
-        vim.lastHPos = cm.getCursor().ch;
-    }
-}
-function InsertModeKey(keyName) {
-    this.keyName = keyName;
-}
-function onKeyEventTargetKeyDown(e) {
-    var macroModeState = vimGlobalState.macroModeState;
-    var lastChange = macroModeState.lastInsertModeChanges;
-    var keyName = CodeMirror.keyName(e);
-    if (!keyName) {
-        return;
-    }
-    function onKeyFound() {
-        if (lastChange.maybeReset) {
-            lastChange.changes = [];
-            lastChange.maybeReset = false;
-        }
-        lastChange.changes.push(new InsertModeKey(keyName));
-        return true;
-    }
-    if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) {
-        CodeMirror.lookupKey(keyName, 'vim-insert', onKeyFound);
-    }
-}
-function repeatLastEdit(cm, vim, repeat, repeatForInsert) {
-    var macroModeState = vimGlobalState.macroModeState;
-    macroModeState.isPlaying = true;
-    var isAction = !!vim.lastEditActionCommand;
-    var cachedInputState = vim.inputState;
-    function repeatCommand() {
-        if (isAction) {
-            commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand);
-        }
-        else {
-            commandDispatcher.evalInput(cm, vim);
-        }
-    }
-    function repeatInsert(repeat) {
-        if (macroModeState.lastInsertModeChanges.changes.length > 0) {
-            repeat = !vim.lastEditActionCommand ? 1 : repeat;
-            var changeObject = macroModeState.lastInsertModeChanges;
-            repeatInsertModeChanges(cm, changeObject.changes, repeat);
-        }
-    }
-    vim.inputState = vim.lastEditInputState;
-    if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) {
-        for (var i = 0; i < repeat; i++) {
-            repeatCommand();
-            repeatInsert(1);
-        }
-    }
-    else {
-        if (!repeatForInsert) {
-            repeatCommand();
-        }
-        repeatInsert(repeat);
-    }
-    vim.inputState = cachedInputState;
-    if (vim.insertMode && !repeatForInsert) {
-        exitInsertMode(cm);
-    }
-    macroModeState.isPlaying = false;
-}
-function repeatInsertModeChanges(cm, changes, repeat) {
-    function keyHandler(binding) {
-        if (typeof binding == 'string') {
-            CodeMirror.commands[binding](cm);
-        }
-        else {
-            binding(cm);
-        }
-        return true;
-    }
-    var head = cm.getCursor('head');
-    var visualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.visualBlock;
-    if (visualBlock) {
-        selectForInsert(cm, head, visualBlock + 1);
-        repeat = cm.listSelections().length;
-        cm.setCursor(head);
-    }
-    for (var i = 0; i < repeat; i++) {
-        if (visualBlock) {
-            cm.setCursor(offsetCursor(head, i, 0));
-        }
-        for (var j = 0; j < changes.length; j++) {
-            var change = changes[j];
-            if (change instanceof InsertModeKey) {
-                CodeMirror.lookupKey(change.keyName, 'vim-insert', keyHandler);
-            }
-            else if (typeof change == "string") {
-                cm.replaceSelection(change);
-            }
-            else {
-                var start = cm.getCursor();
-                var end = offsetCursor(start, 0, change[0].length);
-                cm.replaceRange(change[0], start, end);
-                cm.setCursor(end);
-            }
-        }
-    }
-    if (visualBlock) {
-        cm.setCursor(offsetCursor(head, 0, 1));
-    }
-}
-resetVimGlobalState();
-CodeMirror.Vim = Vim();
-Vim = CodeMirror.Vim;
-var specialKey = { 'return': 'CR', backspace: 'BS', 'delete': 'Del', esc: 'Esc',
-    left: 'Left', right: 'Right', up: 'Up', down: 'Down', space: 'Space', insert: 'Ins',
-    home: 'Home', end: 'End', pageup: 'PageUp', pagedown: 'PageDown', enter: 'CR'
-};
-function lookupKey(hashId, key, e) {
-    if (key.length > 1 && key[0] == "n") {
-        key = key.replace("numpad", "");
-    }
-    key = specialKey[key] || key;
-    var name = '';
-    if (e.ctrlKey) {
-        name += 'C-';
-    }
-    if (e.altKey) {
-        name += 'A-';
-    }
-    if ((name || key.length > 1) && e.shiftKey) {
-        name += 'S-';
-    }
-    name += key;
-    if (name.length > 1) {
-        name = '<' + name + '>';
-    }
-    return name;
-}
-var handleKey = Vim.handleKey.bind(Vim);
-Vim.handleKey = function (cm, key, origin) {
-    return cm.operation(function () {
-        return handleKey(cm, key, origin);
-    }, true);
-};
-function cloneVimState(state) {
-    var n = new state.constructor();
-    Object.keys(state).forEach(function (key) {
-        var o = state[key];
-        if (Array.isArray(o))
-            o = o.slice();
-        else if (o && typeof o == "object" && o.constructor != Object)
-            o = cloneVimState(o);
-        n[key] = o;
-    });
-    if (state.sel) {
-        n.sel = {
-            head: state.sel.head && copyCursor(state.sel.head),
-            anchor: state.sel.anchor && copyCursor(state.sel.anchor)
-        };
-    }
-    return n;
-}
-function multiSelectHandleKey(cm, key, origin) {
-    var isHandled = false;
-    var vim = Vim.maybeInitVimState_(cm);
-    var visualBlock = vim.visualBlock || vim.wasInVisualBlock;
-    var wasMultiselect = cm.ace.inMultiSelectMode;
-    if (vim.wasInVisualBlock && !wasMultiselect) {
-        vim.wasInVisualBlock = false;
-    }
-    else if (wasMultiselect && vim.visualBlock) {
-        vim.wasInVisualBlock = true;
-    }
-    if (key == '<Esc>' && !vim.insertMode && !vim.visualMode && wasMultiselect) {
-        cm.ace.exitMultiSelectMode();
-    }
-    else if (visualBlock || !wasMultiselect || cm.ace.inVirtualSelectionMode) {
-        isHandled = Vim.handleKey(cm, key, origin);
-    }
-    else {
-        var old = cloneVimState(vim);
-        cm.operation(function () {
-            cm.ace.forEachSelection(function () {
-                var sel = cm.ace.selection;
-                cm.state.vim.lastHPos = sel.$desiredColumn == null ? sel.lead.column : sel.$desiredColumn;
-                var head = cm.getCursor("head");
-                var anchor = cm.getCursor("anchor");
-                var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0;
-                var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0;
-                head = offsetCursor(head, 0, headOffset);
-                anchor = offsetCursor(anchor, 0, anchorOffset);
-                cm.state.vim.sel.head = head;
-                cm.state.vim.sel.anchor = anchor;
-                isHandled = handleKey(cm, key, origin);
-                sel.$desiredColumn = cm.state.vim.lastHPos == -1 ? null : cm.state.vim.lastHPos;
-                if (cm.virtualSelectionMode()) {
-                    cm.state.vim = cloneVimState(old);
-                }
-            });
-            if (cm.curOp.cursorActivity && !isHandled)
-                cm.curOp.cursorActivity = false;
-        }, true);
-    }
-    if (isHandled && !vim.visualMode && !vim.insert && vim.visualMode != cm.somethingSelected()) {
-        handleExternalSelection(cm, vim, true);
-    }
-    return isHandled;
-}
-exports.CodeMirror = CodeMirror;
-var getVim = Vim.maybeInitVimState_;
-exports.handler = {
-    $id: "ace/keyboard/vim",
-    drawCursor: function (element, pixelPos, config, sel, session) {
-        var vim = this.state.vim || {};
-        var w = config.characterWidth;
-        var h = config.lineHeight;
-        var top = pixelPos.top;
-        var left = pixelPos.left;
-        if (!vim.insertMode) {
-            var isbackwards = !sel.cursor
-                ? session.selection.isBackwards() || session.selection.isEmpty()
-                : Range.comparePoints(sel.cursor, sel.start) <= 0;
-            if (!isbackwards && left > w)
-                left -= w;
-        }
-        if (!vim.insertMode && vim.status) {
-            h = h / 2;
-            top += h;
-        }
-        dom.translate(element, left, top);
-        dom.setStyle(element.style, "width", w + "px");
-        dom.setStyle(element.style, "height", h + "px");
-    },
-    handleKeyboard: function (data, hashId, key, keyCode, e) {
-        var editor = data.editor;
-        var cm = editor.state.cm;
-        var vim = getVim(cm);
-        if (keyCode == -1)
-            return;
-        if (!vim.insertMode) {
-            if (hashId == -1) {
-                if (key.charCodeAt(0) > 0xFF) {
-                    if (data.inputKey) {
-                        key = data.inputKey;
-                        if (key && data.inputHash == 4)
-                            key = key.toUpperCase();
-                    }
-                }
-                data.inputChar = key;
-            }
-            else if (hashId == 4 || hashId == 0) {
-                if (data.inputKey == key && data.inputHash == hashId && data.inputChar) {
-                    key = data.inputChar;
-                    hashId = -1;
-                }
-                else {
-                    data.inputChar = null;
-                    data.inputKey = key;
-                    data.inputHash = hashId;
-                }
-            }
-            else {
-                data.inputChar = data.inputKey = null;
-            }
-        }
-        if (cm.state.overwrite && vim.insertMode && key == "backspace" && hashId == 0) {
-            return { command: "gotoleft" };
-        }
-        if (key == "c" && hashId == 1) { // key == "ctrl-c"
-            if (!useragent.isMac && editor.getCopyText()) {
-                editor.once("copy", function () {
-                    if (vim.insertMode)
-                        editor.selection.clearSelection();
-                    else
-                        cm.operation(function () { exitVisualMode(cm); });
-                });
-                return { command: "null", passEvent: true };
-            }
-        }
-        if (key == "esc" && !vim.insertMode && !vim.visualMode && !cm.ace.inMultiSelectMode) {
-            var searchState = getSearchState(cm);
-            var overlay = searchState.getOverlay();
-            if (overlay)
-                cm.removeOverlay(overlay);
-        }
-        if (hashId == -1 || hashId & 1 || hashId === 0 && key.length > 1) {
-            var insertMode = vim.insertMode;
-            var name = lookupKey(hashId, key, e || {});
-            if (vim.status == null)
-                vim.status = "";
-            var isHandled = multiSelectHandleKey(cm, name, 'user');
-            vim = getVim(cm); // may be changed by multiSelectHandleKey
-            if (isHandled && vim.status != null)
-                vim.status += name;
-            else if (vim.status == null)
-                vim.status = "";
-            cm._signal("changeStatus");
-            if (!isHandled && (hashId != -1 || insertMode))
-                return;
-            return { command: "null", passEvent: !isHandled };
-        }
-    },
-    attach: function (editor) {
-        if (!editor.state)
-            editor.state = {};
-        var cm = new CodeMirror(editor);
-        editor.state.cm = cm;
-        editor.$vimModeHandler = this;
-        CodeMirror.keyMap.vim.attach(cm);
-        getVim(cm).status = null;
-        cm.on('vim-command-done', function () {
-            if (cm.virtualSelectionMode())
-                return;
-            getVim(cm).status = null;
-            cm.ace._signal("changeStatus");
-            cm.ace.session.markUndoGroup();
-        });
-        cm.on("changeStatus", function () {
-            cm.ace.renderer.updateCursor();
-            cm.ace._signal("changeStatus");
-        });
-        cm.on("vim-mode-change", function () {
-            if (cm.virtualSelectionMode())
-                return;
-            updateInputMode();
-            cm._signal("changeStatus");
-        });
-        function updateInputMode() {
-            var isIntsert = getVim(cm).insertMode;
-            cm.ace.renderer.setStyle("normal-mode", !isIntsert);
-            editor.textInput.setCommandMode(!isIntsert);
-            editor.renderer.$keepTextAreaAtCursor = isIntsert;
-            editor.renderer.$blockCursor = !isIntsert;
-        }
-        updateInputMode();
-        editor.renderer.$cursorLayer.drawCursor = this.drawCursor.bind(cm);
-    },
-    detach: function (editor) {
-        var cm = editor.state.cm;
-        CodeMirror.keyMap.vim.detach(cm);
-        cm.destroy();
-        editor.state.cm = null;
-        editor.$vimModeHandler = null;
-        editor.renderer.$cursorLayer.drawCursor = null;
-        editor.renderer.setStyle("normal-mode", false);
-        editor.textInput.setCommandMode(false);
-        editor.renderer.$keepTextAreaAtCursor = true;
-    },
-    getStatusText: function (editor) {
-        var cm = editor.state.cm;
-        var vim = getVim(cm);
-        if (vim.insertMode)
-            return "INSERT";
-        var status = "";
-        if (vim.visualMode) {
-            status += "VISUAL";
-            if (vim.visualLine)
-                status += " LINE";
-            if (vim.visualBlock)
-                status += " BLOCK";
-        }
-        if (vim.status)
-            status += (status ? " " : "") + vim.status;
-        return status;
-    }
-};
-Vim.defineOption({
-    name: "wrap",
-    set: function (value, cm) {
-        if (cm) {
-            cm.ace.setOption("wrap", value);
-        }
-    },
-    type: "boolean"
-}, false);
-Vim.defineEx('write', 'w', function () {
-    console.log(':write is not implemented');
-});
-defaultKeymap.push({ keys: 'zc', type: 'action', action: 'fold', actionArgs: { open: false } }, { keys: 'zC', type: 'action', action: 'fold', actionArgs: { open: false, all: true } }, { keys: 'zo', type: 'action', action: 'fold', actionArgs: { open: true } }, { keys: 'zO', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, { keys: 'za', type: 'action', action: 'fold', actionArgs: { toggle: true } }, { keys: 'zA', type: 'action', action: 'fold', actionArgs: { toggle: true, all: true } }, { keys: 'zf', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, { keys: 'zd', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, { keys: '<C-A-k>', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorAbove" } }, { keys: '<C-A-j>', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorBelow" } }, { keys: '<C-A-S-k>', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorAboveSkipCurrent" } }, { keys: '<C-A-S-j>', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorBelowSkipCurrent" } }, { keys: '<C-A-h>', type: 'action', action: 'aceCommand', actionArgs: { name: "selectMoreBefore" } }, { keys: '<C-A-l>', type: 'action', action: 'aceCommand', actionArgs: { name: "selectMoreAfter" } }, { keys: '<C-A-S-h>', type: 'action', action: 'aceCommand', actionArgs: { name: "selectNextBefore" } }, { keys: '<C-A-S-l>', type: 'action', action: 'aceCommand', actionArgs: { name: "selectNextAfter" } });
-defaultKeymap.push({
-    keys: 'gq',
-    type: 'operator',
-    operator: 'hardWrap'
-});
-Vim.defineOperator("hardWrap", function (cm, operatorArgs, ranges, oldAnchor, newHead) {
-    var anchor = ranges[0].anchor.line;
-    var head = ranges[0].head.line;
-    if (operatorArgs.linewise)
-        head--;
-    hardWrap(cm.ace, { startRow: anchor, endRow: head });
-    return Pos(head, 0);
-});
-defineOption('textwidth', undefined, 'number', ['tw'], function (width, cm) {
-    if (cm === undefined) {
-        return;
-    }
-    if (width === undefined) {
-        var value = cm.ace.getOption('printMarginColumn');
-        return value;
-    }
-    else {
-        var column = Math.round(width);
-        if (column > 1) {
-            cm.ace.setOption('printMarginColumn', column);
-        }
-    }
-});
-actions.aceCommand = function (cm, actionArgs, vim) {
-    cm.vimCmd = actionArgs;
-    if (cm.ace.inVirtualSelectionMode)
-        cm.ace.on("beforeEndOperation", delayedExecAceCommand);
-    else
-        delayedExecAceCommand(null, cm.ace);
-};
-function delayedExecAceCommand(op, ace) {
-    ace.off("beforeEndOperation", delayedExecAceCommand);
-    var cmd = ace.state.cm.vimCmd;
-    if (cmd) {
-        ace.execCommand(cmd.exec ? cmd : cmd.name, cmd.args);
-    }
-    ace.curOp = ace.prevOp;
-}
-actions.fold = function (cm, actionArgs, vim) {
-    cm.ace.execCommand(['toggleFoldWidget', 'toggleFoldWidget', 'foldOther', 'unfoldall'
-    ][(actionArgs.all ? 2 : 0) + (actionArgs.open ? 1 : 0)]);
-};
-exports.handler.defaultKeymap = defaultKeymap;
-exports.handler.actions = actions;
-exports.Vim = Vim;
-
-});                (function() {
-                    ace.require(["ace/keyboard/vim"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 123 - 85
web/cfbb8ac8b034c4ecdb1d74d5a0aa997e.js → web/22d4f336d4fbe548273812e6e4cd345e.js

@@ -1,126 +1,163 @@
-ace.define("ace/mode/io_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from tm bundles\io.tmbundle/Syntaxes/io.plist (uuid: ) */
+ace.define("ace/mode/io_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var IoHighlightRules = function () {
-    this.$rules = { start: [{ token: 'keyword.control.io',
-                regex: '\\b(?:if|ifTrue|ifFalse|ifTrueIfFalse|for|loop|reverseForeach|foreach|map|continue|break|while|do|return)\\b' },
-            { token: 'punctuation.definition.comment.io',
-                regex: '/\\*',
-                push: [{ token: 'punctuation.definition.comment.io',
-                        regex: '\\*/',
-                        next: 'pop' },
-                    { defaultToken: 'comment.block.io' }] },
-            { token: 'punctuation.definition.comment.io',
-                regex: '//',
-                push: [{ token: 'comment.line.double-slash.io',
-                        regex: '$',
-                        next: 'pop' },
-                    { defaultToken: 'comment.line.double-slash.io' }] },
-            { token: 'punctuation.definition.comment.io',
-                regex: '#',
-                push: [{ token: 'comment.line.number-sign.io', regex: '$', next: 'pop' },
-                    { defaultToken: 'comment.line.number-sign.io' }] },
-            { token: 'variable.language.io',
-                regex: '\\b(?:self|sender|target|proto|protos|parent)\\b',
-                comment: 'I wonder if some of this isn\'t variable.other.language? --Allan; scoping this as variable.language to match Objective-C\'s handling of \'self\', which is inconsistent with C++\'s handling of \'this\' but perhaps intentionally so -- Rob' },
-            { token: 'keyword.operator.io',
-                regex: '<=|>=|=|:=|\\*|\\||\\|\\||\\+|-|/|&|&&|>|<|\\?|@|@@|\\b(?:and|or)\\b' },
-            { token: 'constant.other.io', regex: '\\bGL[\\w_]+\\b' },
-            { token: 'support.class.io', regex: '\\b[A-Z](?:\\w+)?\\b' },
-            { token: 'support.function.io',
-                regex: '\\b(?:clone|call|init|method|list|vector|block|\\w+(?=\\s*\\())\\b' },
-            { token: 'support.function.open-gl.io',
-                regex: '\\bgl(?:u|ut)?[A-Z]\\w+\\b' },
-            { token: 'punctuation.definition.string.begin.io',
+
+var IoHighlightRules = function() {
+
+    this.$rules = { start: 
+       [ { token: 'keyword.control.io',
+           regex: '\\b(?:if|ifTrue|ifFalse|ifTrueIfFalse|for|loop|reverseForeach|foreach|map|continue|break|while|do|return)\\b' },
+         { token: 'punctuation.definition.comment.io',
+           regex: '/\\*',
+           push: 
+            [ { token: 'punctuation.definition.comment.io',
+                regex: '\\*/',
+                next: 'pop' },
+              { defaultToken: 'comment.block.io' } ] },
+         { token: 'punctuation.definition.comment.io',
+           regex: '//',
+           push: 
+            [ { token: 'comment.line.double-slash.io',
+                regex: '$',
+                next: 'pop' },
+              { defaultToken: 'comment.line.double-slash.io' } ] },
+         { token: 'punctuation.definition.comment.io',
+           regex: '#',
+           push: 
+            [ { token: 'comment.line.number-sign.io', regex: '$', next: 'pop' },
+              { defaultToken: 'comment.line.number-sign.io' } ] },
+         { token: 'variable.language.io',
+           regex: '\\b(?:self|sender|target|proto|protos|parent)\\b',
+           comment: 'I wonder if some of this isn\'t variable.other.language? --Allan; scoping this as variable.language to match Objective-C\'s handling of \'self\', which is inconsistent with C++\'s handling of \'this\' but perhaps intentionally so -- Rob' },
+         { token: 'keyword.operator.io',
+           regex: '<=|>=|=|:=|\\*|\\||\\|\\||\\+|-|/|&|&&|>|<|\\?|@|@@|\\b(?:and|or)\\b' },
+         { token: 'constant.other.io', regex: '\\bGL[\\w_]+\\b' },
+         { token: 'support.class.io', regex: '\\b[A-Z](?:\\w+)?\\b' },
+         { token: 'support.function.io',
+           regex: '\\b(?:clone|call|init|method|list|vector|block|\\w+(?=\\s*\\())\\b' },
+         { token: 'support.function.open-gl.io',
+           regex: '\\bgl(?:u|ut)?[A-Z]\\w+\\b' },
+         { token: 'punctuation.definition.string.begin.io',
+           regex: '"""',
+           push: 
+            [ { token: 'punctuation.definition.string.end.io',
                 regex: '"""',
-                push: [{ token: 'punctuation.definition.string.end.io',
-                        regex: '"""',
-                        next: 'pop' },
-                    { token: 'constant.character.escape.io', regex: '\\\\.' },
-                    { defaultToken: 'string.quoted.triple.io' }] },
-            { token: 'punctuation.definition.string.begin.io',
+                next: 'pop' },
+              { token: 'constant.character.escape.io', regex: '\\\\.' },
+              { defaultToken: 'string.quoted.triple.io' } ] },
+         { token: 'punctuation.definition.string.begin.io',
+           regex: '"',
+           push: 
+            [ { token: 'punctuation.definition.string.end.io',
                 regex: '"',
-                push: [{ token: 'punctuation.definition.string.end.io',
-                        regex: '"',
-                        next: 'pop' },
-                    { token: 'constant.character.escape.io', regex: '\\\\.' },
-                    { defaultToken: 'string.quoted.double.io' }] },
-            { token: 'constant.numeric.io',
-                regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b' },
-            { token: 'variable.other.global.io', regex: 'Lobby\\b' },
-            { token: 'constant.language.io',
-                regex: '\\b(?:TRUE|true|FALSE|false|NULL|null|Null|Nil|nil|YES|NO)\\b' }] };
+                next: 'pop' },
+              { token: 'constant.character.escape.io', regex: '\\\\.' },
+              { defaultToken: 'string.quoted.double.io' } ] },
+         { token: 'constant.numeric.io',
+           regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b' },
+         { token: 'variable.other.global.io', regex: 'Lobby\\b' },
+         { token: 'constant.language.io',
+           regex: '\\b(?:TRUE|true|FALSE|false|NULL|null|Null|Nil|nil|YES|NO)\\b' } ] };
+    
     this.normalizeRules();
 };
-IoHighlightRules.metaData = { fileTypes: ['io'],
-    keyEquivalent: '^~I',
-    name: 'Io',
-    scopeName: 'source.io' };
+
+IoHighlightRules.metaData = { fileTypes: [ 'io' ],
+      keyEquivalent: '^~I',
+      name: 'Io',
+      scopeName: 'source.io' };
+
+
 oop.inherits(IoHighlightRules, TextHighlightRules);
-exports.IoHighlightRules = IoHighlightRules;
 
+exports.IoHighlightRules = IoHighlightRules;
 });
 
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var Range = require("../../range").Range;
 var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
     if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
     }
 };
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
+
+(function() {
+    
     this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
     this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
     this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
     this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
     this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
+    
         if (this.singleLineBlockCommentRe.test(line)) {
             if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
                 return "";
         }
+    
         var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
         if (!fw && this.startRegionRe.test(line))
             return "start"; // lineCommentRegionStart
+    
         return fw;
     };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
         var line = session.getLine(row);
+        
         if (this.startRegionRe.test(line))
             return this.getCommentRegionBlock(session, line, row);
+        
         var match = line.match(this.foldingStartMarker);
         if (match) {
             var i = match.index;
+
             if (match[1])
                 return this.openingBracketBlock(session, match[1], row, i);
+                
             var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
             if (range && !range.isMultiLine()) {
                 if (forceMultiline) {
                     range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
+                } else if (foldStyle != "all")
                     range = null;
             }
+            
             return range;
         }
+
         if (foldStyle === "markbegin")
             return;
+
         var match = line.match(this.foldingStopMarker);
         if (match) {
             var i = match.index + match[0].length;
+
             if (match[1])
                 return this.closingBracketBlock(session, match[1], row, i);
+
             return session.getCommentFoldRange(row, i, -1);
         }
     };
-    this.getSectionRange = function (session, row) {
+    
+    this.getSectionRange = function(session, row) {
         var line = session.getLine(row);
         var startIndent = line.search(/\S/);
         var startRow = row;
@@ -133,73 +170,74 @@ oop.inherits(FoldMode, BaseFoldMode);
             var indent = line.search(/\S/);
             if (indent === -1)
                 continue;
-            if (startIndent > indent)
+            if  (startIndent > indent)
                 break;
             var subRange = this.getFoldWidgetRange(session, "all", row);
+            
             if (subRange) {
                 if (subRange.start.row <= startRow) {
                     break;
-                }
-                else if (subRange.isMultiLine()) {
+                } else if (subRange.isMultiLine()) {
                     row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
+                } else if (startIndent == indent) {
                     break;
                 }
             }
             endRow = row;
         }
+        
         return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
     };
-    this.getCommentRegionBlock = function (session, line, row) {
+    this.getCommentRegionBlock = function(session, line, row) {
         var startColumn = line.search(/\s*$/);
         var maxRow = session.getLength();
         var startRow = row;
+        
         var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
         var depth = 1;
         while (++row < maxRow) {
             line = session.getLine(row);
             var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
         }
+
         var endRow = row;
         if (endRow > startRow) {
             return new Range(startRow, startColumn, endRow, line.length);
         }
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/io",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/io_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
-*/
+ace.define("ace/mode/io",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/io_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {
 "use strict";
+
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var IoHighlightRules = require("./io_highlight_rules").IoHighlightRules;
 var FoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
+
+var Mode = function() {
     this.HighlightRules = IoHighlightRules;
     this.foldingRules = new FoldMode();
     this.$behaviour = this.$defaultBehaviour;
 };
 oop.inherits(Mode, TextMode);
-(function () {
+
+(function() {
     this.lineCommentStart = "//";
-    this.blockComment = { start: "/*", end: "*/" };
+    this.blockComment = {start: "/*", end: "*/"};
     this.$id = "ace/mode/io";
     this.snippetFileId = "ace/snippets/io";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });                (function() {
                     ace.require(["ace/mode/io"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

文件差异内容过多而无法显示
+ 0 - 0
web/23ad6224fd6059c31c199b6d6d420628.js


+ 109 - 0
web/243d8101969c933d25388b5287bb3425.js

@@ -0,0 +1,109 @@
+ace.define("ace/snippets/coffee",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+exports.snippetText = "# Closure loop\n\
+snippet forindo\n\
+	for ${1:name} in ${2:array}\n\
+		do ($1) ->\n\
+			${3:// body}\n\
+# Array comprehension\n\
+snippet fora\n\
+	for ${1:name} in ${2:array}\n\
+		${3:// body...}\n\
+# Object comprehension\n\
+snippet foro\n\
+	for ${1:key}, ${2:value} of ${3:object}\n\
+		${4:// body...}\n\
+# Range comprehension (inclusive)\n\
+snippet forr\n\
+	for ${1:name} in [${2:start}..${3:finish}]\n\
+		${4:// body...}\n\
+snippet forrb\n\
+	for ${1:name} in [${2:start}..${3:finish}] by ${4:step}\n\
+		${5:// body...}\n\
+# Range comprehension (exclusive)\n\
+snippet forrex\n\
+	for ${1:name} in [${2:start}...${3:finish}]\n\
+		${4:// body...}\n\
+snippet forrexb\n\
+	for ${1:name} in [${2:start}...${3:finish}] by ${4:step}\n\
+		${5:// body...}\n\
+# Function\n\
+snippet fun\n\
+	(${1:args}) ->\n\
+		${2:// body...}\n\
+# Function (bound)\n\
+snippet bfun\n\
+	(${1:args}) =>\n\
+		${2:// body...}\n\
+# Class\n\
+snippet cla class ..\n\
+	class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\
+		${2}\n\
+snippet cla class .. constructor: ..\n\
+	class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`}\n\
+		constructor: (${2:args}) ->\n\
+			${3}\n\
+\n\
+		${4}\n\
+snippet cla class .. extends ..\n\
+	class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`} extends ${2:ParentClass}\n\
+		${3}\n\
+snippet cla class .. extends .. constructor: ..\n\
+	class ${1:`substitute(Filename(), '\\(_\\|^\\)\\(.\\)', '\\u\\2', 'g')`} extends ${2:ParentClass}\n\
+		constructor: (${3:args}) ->\n\
+			${4}\n\
+\n\
+		${5}\n\
+# If\n\
+snippet if\n\
+	if ${1:condition}\n\
+		${2:// body...}\n\
+# If __ Else\n\
+snippet ife\n\
+	if ${1:condition}\n\
+		${2:// body...}\n\
+	else\n\
+		${3:// body...}\n\
+# Else if\n\
+snippet elif\n\
+	else if ${1:condition}\n\
+		${2:// body...}\n\
+# Ternary If\n\
+snippet ifte\n\
+	if ${1:condition} then ${2:value} else ${3:other}\n\
+# Unless\n\
+snippet unl\n\
+	${1:action} unless ${2:condition}\n\
+# Switch\n\
+snippet swi\n\
+	switch ${1:object}\n\
+		when ${2:value}\n\
+			${3:// body...}\n\
+\n\
+# Log\n\
+snippet log\n\
+	console.log ${1}\n\
+# Try __ Catch\n\
+snippet try\n\
+	try\n\
+		${1}\n\
+	catch ${2:error}\n\
+		${3}\n\
+# Require\n\
+snippet req\n\
+	${2:$1} = require '${1:sys}'${3}\n\
+# Export\n\
+snippet exp\n\
+	${1:root} = exports ? this\n\
+";
+exports.scope = "coffee";
+
+});                (function() {
+                    ace.require(["ace/snippets/coffee"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 111 - 0
web/2487e54390024553d757b9bd73dd1647.js

@@ -0,0 +1,111 @@
+ace.define("ace/mode/sql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+
+var SqlHighlightRules = function() {
+
+    var keywords = (
+        "select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|" +
+        "when|then|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|" +
+        "foreign|not|references|default|null|inner|cross|natural|database|drop|grant"
+    );
+
+    var builtinConstants = (
+        "true|false"
+    );
+
+    var builtinFunctions = (
+        "avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|" + 
+        "coalesce|ifnull|isnull|nvl"
+    );
+
+    var dataTypes = (
+        "int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|" +
+        "money|real|number|integer"
+    );
+
+    var keywordMapper = this.createKeywordMapper({
+        "support.function": builtinFunctions,
+        "keyword": keywords,
+        "constant.language": builtinConstants,
+        "storage.type": dataTypes
+    }, "identifier", true);
+
+    this.$rules = {
+        "start" : [ {
+            token : "comment",
+            regex : "--.*$"
+        },  {
+            token : "comment",
+            start : "/\\*",
+            end : "\\*/"
+        }, {
+            token : "string",           // " string
+            regex : '".*?"'
+        }, {
+            token : "string",           // ' string
+            regex : "'.*?'"
+        }, {
+            token : "string",           // ` string (apache drill)
+            regex : "`.*?`"
+        }, {
+            token : "constant.numeric", // float
+            regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+        }, {
+            token : keywordMapper,
+            regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+        }, {
+            token : "keyword.operator",
+            regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="
+        }, {
+            token : "paren.lparen",
+            regex : "[\\(]"
+        }, {
+            token : "paren.rparen",
+            regex : "[\\)]"
+        }, {
+            token : "text",
+            regex : "\\s+"
+        } ]
+    };
+    this.normalizeRules();
+};
+
+oop.inherits(SqlHighlightRules, TextHighlightRules);
+
+exports.SqlHighlightRules = SqlHighlightRules;
+});
+
+ace.define("ace/mode/sql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sql_highlight_rules"], function(require, exports, module) {
+"use strict";
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var SqlHighlightRules = require("./sql_highlight_rules").SqlHighlightRules;
+
+var Mode = function() {
+    this.HighlightRules = SqlHighlightRules;
+    this.$behaviour = this.$defaultBehaviour;
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+
+    this.lineCommentStart = "--";
+
+    this.$id = "ace/mode/sql";
+    this.snippetFileId = "ace/snippets/sql";
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+
+});                (function() {
+                    ace.require(["ace/mode/sql"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 0 - 16
web/26916d87ee46ad72f432b9a59e6fd198.js

@@ -1,16 +0,0 @@
-ace.define("ace/snippets/robot.snippets",["require","exports","module"], function(require, exports, module){module.exports = "# scope: robot\n### Sections\nsnippet settingssection\ndescription *** Settings *** section\n\t*** Settings ***\n\tLibrary    ${1}\n\nsnippet keywordssection\ndescription *** Keywords *** section\n\t*** Keywords ***\n\t${1:Keyword Name}\n\t    [Arguments]    \\${${2:Example Arg 1}}\n\t\nsnippet testcasessection\ndescription *** Test Cases *** section\n\t*** Test Cases ***\n\t${1:First Test Case}\n\t    ${2:Log    Example Arg}\n\nsnippet variablessection\ndescription *** Variables *** section\n\t*** Variables ***\n\t\\${${1:Variable Name}}=    ${2:Variable Value}\n\n### Helpful keywords\nsnippet testcase\ndescription A test case\n\t${1:Test Case Name}\n\t    ${2:Log    Example log message}\n\t\nsnippet keyword\ndescription A keyword\n\t${1:Example Keyword}\n\t    [Arguments]    \\${${2:Example Arg 1}}\n\n### Built Ins\nsnippet forinr\ndescription For In Range Loop\n\tFOR    \\${${1:Index}}    IN RANGE     \\${${2:10}}\n\t    Log     \\${${1:Index}}\n\tEND\n\nsnippet forin\ndescription For In Loop\n\tFOR    \\${${1:Item}}    IN     @{${2:List Variable}}\n\t    Log     \\${${1:Item}}\n\tEND\n\nsnippet if\ndescription If Statement\n\tIF    ${1:condition}\n\t    ${2:Do something}\n\tEND\n\nsnippet else\ndescription If Statement\n\tIF    ${1:Condition}\n\t    ${2:Do something}\n\tELSE\n\t    ${3:Otherwise do this}\n\tEND\n\nsnippet elif\ndescription Else-If Statement\n\tIF    ${1:Condition 1}\n\t    ${2:Do something}\n\tELSE IF    ${3:Condition 2}\n\t    ${4:Do something else}\n\tEND\n";
-
-});
-
-ace.define("ace/snippets/robot",["require","exports","module","ace/snippets/robot.snippets"], function(require, exports, module){"use strict";
-exports.snippetText = require("./robot.snippets");
-exports.scope = "robot";
-
-});                (function() {
-                    ace.require(["ace/snippets/robot"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 280 - 105
web/d19b415a0279064ddfa890d0a7b3f78c.js → web/280ba139ff95428f262adbf81b77aeb4.js

@@ -1,45 +1,185 @@
-ace.define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/net","ace/ace"], function(require, exports, module){"use strict";
+ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
+"use strict";
+
+exports.isDark = false;
+exports.cssClass = "ace-tm";
+exports.cssText = ".ace-tm .ace_gutter {\
+background: #f0f0f0;\
+color: #333;\
+}\
+.ace-tm .ace_print-margin {\
+width: 1px;\
+background: #e8e8e8;\
+}\
+.ace-tm .ace_fold {\
+background-color: #6B72E6;\
+}\
+.ace-tm {\
+background-color: #FFFFFF;\
+color: black;\
+}\
+.ace-tm .ace_cursor {\
+color: black;\
+}\
+.ace-tm .ace_invisible {\
+color: rgb(191, 191, 191);\
+}\
+.ace-tm .ace_storage,\
+.ace-tm .ace_keyword {\
+color: blue;\
+}\
+.ace-tm .ace_constant {\
+color: rgb(197, 6, 11);\
+}\
+.ace-tm .ace_constant.ace_buildin {\
+color: rgb(88, 72, 246);\
+}\
+.ace-tm .ace_constant.ace_language {\
+color: rgb(88, 92, 246);\
+}\
+.ace-tm .ace_constant.ace_library {\
+color: rgb(6, 150, 14);\
+}\
+.ace-tm .ace_invalid {\
+background-color: rgba(255, 0, 0, 0.1);\
+color: red;\
+}\
+.ace-tm .ace_support.ace_function {\
+color: rgb(60, 76, 114);\
+}\
+.ace-tm .ace_support.ace_constant {\
+color: rgb(6, 150, 14);\
+}\
+.ace-tm .ace_support.ace_type,\
+.ace-tm .ace_support.ace_class {\
+color: rgb(109, 121, 222);\
+}\
+.ace-tm .ace_keyword.ace_operator {\
+color: rgb(104, 118, 135);\
+}\
+.ace-tm .ace_string {\
+color: rgb(3, 106, 7);\
+}\
+.ace-tm .ace_comment {\
+color: rgb(76, 136, 107);\
+}\
+.ace-tm .ace_comment.ace_doc {\
+color: rgb(0, 102, 255);\
+}\
+.ace-tm .ace_comment.ace_doc.ace_tag {\
+color: rgb(128, 159, 191);\
+}\
+.ace-tm .ace_constant.ace_numeric {\
+color: rgb(0, 0, 205);\
+}\
+.ace-tm .ace_variable {\
+color: rgb(49, 132, 149);\
+}\
+.ace-tm .ace_xml-pe {\
+color: rgb(104, 104, 91);\
+}\
+.ace-tm .ace_entity.ace_name.ace_function {\
+color: #0000A2;\
+}\
+.ace-tm .ace_heading {\
+color: rgb(12, 7, 255);\
+}\
+.ace-tm .ace_list {\
+color:rgb(185, 6, 144);\
+}\
+.ace-tm .ace_meta.ace_tag {\
+color:rgb(0, 22, 142);\
+}\
+.ace-tm .ace_string.ace_regex {\
+color: rgb(255, 0, 0)\
+}\
+.ace-tm .ace_marker-layer .ace_selection {\
+background: rgb(181, 213, 255);\
+}\
+.ace-tm.ace_multiselect .ace_selection.ace_start {\
+box-shadow: 0 0 3px 0px white;\
+}\
+.ace-tm .ace_marker-layer .ace_step {\
+background: rgb(252, 255, 0);\
+}\
+.ace-tm .ace_marker-layer .ace_stack {\
+background: rgb(164, 229, 101);\
+}\
+.ace-tm .ace_marker-layer .ace_bracket {\
+margin: -1px 0 0 -1px;\
+border: 1px solid rgb(192, 192, 192);\
+}\
+.ace-tm .ace_marker-layer .ace_active-line {\
+background: rgba(0, 0, 0, 0.07);\
+}\
+.ace-tm .ace_gutter-active-line {\
+background-color : #dcdcdc;\
+}\
+.ace-tm .ace_marker-layer .ace_selected-word {\
+background: rgb(250, 250, 255);\
+border: 1px solid rgb(200, 200, 250);\
+}\
+.ace-tm .ace_indent-guide {\
+background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
+}\
+";
+exports.$id = "ace/theme/textmate";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});
+
+ace.define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/net","ace/ace","ace/theme/textmate"], function(require, exports, module) {
+"use strict";
+
 var event = require("../lib/event");
 var UA = require("../lib/useragent");
 var net = require("../lib/net");
 var ace = require("../ace");
+
+require("../theme/textmate");
+
 module.exports = exports = ace;
-var getCSSProperty = function (element, container, property) {
+var getCSSProperty = function(element, container, property) {
     var ret = element.style[property];
+
     if (!ret) {
         if (window.getComputedStyle) {
             ret = window.getComputedStyle(element, '').getPropertyValue(property);
-        }
-        else {
+        } else {
             ret = element.currentStyle[property];
         }
     }
+
     if (!ret || ret == 'auto' || ret == 'intrinsic') {
         ret = container.style[property];
     }
     return ret;
 };
+
 function applyStyles(elm, styles) {
     for (var style in styles) {
         elm.style[style] = styles[style];
     }
 }
+
 function setupContainer(element, getValue) {
     if (element.type != 'textarea') {
         throw new Error("Textarea required!");
     }
+
     var parentNode = element.parentNode;
     var container = document.createElement('div');
-    var resizeEvent = function () {
+    var resizeEvent = function() {
         var style = 'position:relative;';
         [
             'margin-top', 'margin-left', 'margin-right', 'margin-bottom'
-        ].forEach(function (item) {
+        ].forEach(function(item) {
             style += item + ':' +
-                getCSSProperty(element, container, item) + ';';
+                        getCSSProperty(element, container, item) + ';';
         });
         var width = getCSSProperty(element, container, 'width') || (element.clientWidth + "px");
-        var height = getCSSProperty(element, container, 'height') || (element.clientHeight + "px");
+        var height = getCSSProperty(element, container, 'height')  || (element.clientHeight + "px");
         style += 'height:' + height + ';width:' + width + ';';
         style += 'display:inline-block;';
         container.setAttribute('style', style);
@@ -50,7 +190,7 @@ function setupContainer(element, getValue) {
     while (parentNode !== document) {
         if (parentNode.tagName.toUpperCase() === 'FORM') {
             var oldSumit = parentNode.onsubmit;
-            parentNode.onsubmit = function (evt) {
+            parentNode.onsubmit = function(evt) {
                 element.value = getValue();
                 if (oldSumit) {
                     oldSumit.call(this, evt);
@@ -62,10 +202,11 @@ function setupContainer(element, getValue) {
     }
     return container;
 }
-exports.transformTextarea = function (element, options) {
+
+exports.transformTextarea = function(element, options) {
     var isFocused = element.autofocus || document.activeElement == element;
     var session;
-    var container = setupContainer(element, function () {
+    var container = setupContainer(element, function() {
         return session.getValue();
     });
     element.style.display = 'none';
@@ -80,6 +221,7 @@ exports.transformTextarea = function (element, options) {
         position: "absolute"
     });
     container.appendChild(editorDiv);
+
     var settingOpener = document.createElement("div");
     applyStyles(settingOpener, {
         position: "absolute",
@@ -90,6 +232,7 @@ exports.transformTextarea = function (element, options) {
         borderColor: "lightblue gray gray #ceade6",
         zIndex: 101
     });
+
     var settingDiv = document.createElement("div");
     var settingDivStyles = {
         top: "0px",
@@ -107,35 +250,38 @@ exports.transformTextarea = function (element, options) {
     };
     if (!UA.isOldIE) {
         settingDivStyles.backgroundColor = "rgba(0, 0, 0, 0.6)";
-    }
-    else {
+    } else {
         settingDivStyles.backgroundColor = "#333";
     }
+
     applyStyles(settingDiv, settingDivStyles);
     container.appendChild(settingDiv);
+
     options = options || exports.defaultOptions;
     var editor = ace.edit(editorDiv);
     session = editor.getSession();
+
     session.setValue(element.value || element.innerHTML);
     if (isFocused)
         editor.focus();
     container.appendChild(settingOpener);
     setupApi(editor, editorDiv, settingDiv, ace, options);
     setupSettingPanel(settingDiv, settingOpener, editor);
+
     var state = "";
-    event.addListener(settingOpener, "mousemove", function (e) {
+    event.addListener(settingOpener, "mousemove", function(e) {
         var rect = this.getBoundingClientRect();
         var x = e.clientX - rect.left, y = e.clientY - rect.top;
-        if (x + y < (rect.width + rect.height) / 2) {
+        if (x + y < (rect.width + rect.height)/2) {
             this.style.cursor = "pointer";
             state = "toggle";
-        }
-        else {
+        } else {
             state = "resize";
             this.style.cursor = "nw-resize";
         }
     });
-    event.addListener(settingOpener, "mousedown", function (e) {
+
+    event.addListener(settingOpener, "mousedown", function(e) {
         e.preventDefault();
         if (state == "toggle") {
             editor.setDisplaySettings();
@@ -143,28 +289,33 @@ exports.transformTextarea = function (element, options) {
         }
         container.style.zIndex = 100000;
         var rect = container.getBoundingClientRect();
-        var startX = rect.width + rect.left - e.clientX;
-        var startY = rect.height + rect.top - e.clientY;
-        event.capture(settingOpener, function (e) {
+        var startX = rect.width  + rect.left - e.clientX;
+        var startY = rect.height  + rect.top - e.clientY;
+        event.capture(settingOpener, function(e) {
             container.style.width = e.clientX - rect.left + startX + "px";
             container.style.height = e.clientY - rect.top + startY + "px";
             editor.resize();
-        }, function () { });
+        }, function() {});
     });
+
     return editor;
 };
+
 function load(url, module, callback) {
-    net.loadScript(url, function () {
+    net.loadScript(url, function() {
         require([module], callback);
     });
 }
+
 function setupApi(editor, editorDiv, settingDiv, ace, options) {
     var session = editor.getSession();
     var renderer = editor.renderer;
+
     function toBool(value) {
         return value === "true" || value == true;
     }
-    editor.setDisplaySettings = function (display) {
+
+    editor.setDisplaySettings = function(display) {
         if (display == null)
             display = settingDiv.style.display == "none";
         if (display) {
@@ -174,21 +325,21 @@ function setupApi(editor, editorDiv, settingDiv, ace, options) {
                 editor.removeListener("focus", onFocus);
                 settingDiv.style.display = "none";
             });
-        }
-        else {
+        } else {
             editor.focus();
         }
     };
+
     editor.$setOption = editor.setOption;
     editor.$getOption = editor.getOption;
-    editor.setOption = function (key, value) {
+    editor.setOption = function(key, value) {
         switch (key) {
             case "mode":
                 editor.$setOption("mode", "ace/mode/" + value);
-                break;
+            break;
             case "theme":
                 editor.$setOption("theme", "ace/theme/" + value);
-                break;
+            break;
             case "keybindings":
                 switch (value) {
                     case "vim":
@@ -200,23 +351,28 @@ function setupApi(editor, editorDiv, settingDiv, ace, options) {
                     default:
                         editor.setKeyboardHandler(null);
                 }
-                break;
+            break;
+
             case "wrap":
             case "fontSize":
                 editor.$setOption(key, value);
-                break;
+            break;
+            
             default:
                 editor.$setOption(key, toBool(value));
         }
     };
-    editor.getOption = function (key) {
+
+    editor.getOption = function(key) {
         switch (key) {
             case "mode":
                 return editor.$getOption("mode").substr("ace/mode/".length);
-                break;
+            break;
+
             case "theme":
                 return editor.$getOption("theme").substr("ace/theme/".length);
-                break;
+            break;
+
             case "keybindings":
                 var value = editor.getKeyboardHandler();
                 switch (value && value.$id) {
@@ -227,73 +383,78 @@ function setupApi(editor, editorDiv, settingDiv, ace, options) {
                     default:
                         return "ace";
                 }
-                break;
+            break;
+
             default:
                 return editor.$getOption(key);
         }
     };
+
     editor.setOptions(options);
     return editor;
 }
+
 function setupSettingPanel(settingDiv, settingOpener, editor) {
     var BOOL = null;
+
     var desc = {
-        mode: "Mode:",
-        wrap: "Soft Wrap:",
-        theme: "Theme:",
-        fontSize: "Font Size:",
-        showGutter: "Display Gutter:",
-        keybindings: "Keyboard",
+        mode:            "Mode:",
+        wrap:            "Soft Wrap:",
+        theme:           "Theme:",
+        fontSize:        "Font Size:",
+        showGutter:      "Display Gutter:",
+        keybindings:     "Keyboard",
         showPrintMargin: "Show Print Margin:",
-        useSoftTabs: "Use Soft Tabs:",
-        showInvisibles: "Show Invisibles"
+        useSoftTabs:     "Use Soft Tabs:",
+        showInvisibles:  "Show Invisibles"
     };
+
     var optionValues = {
         mode: {
-            text: "Plain",
+            text:       "Plain",
             javascript: "JavaScript",
-            xml: "XML",
-            html: "HTML",
-            css: "CSS",
-            scss: "SCSS",
-            python: "Python",
-            php: "PHP",
-            java: "Java",
-            ruby: "Ruby",
-            c_cpp: "C/C++",
-            coffee: "CoffeeScript",
-            json: "json",
-            perl: "Perl",
-            clojure: "Clojure",
-            ocaml: "OCaml",
-            csharp: "C#",
-            haxe: "haXe",
-            svg: "SVG",
-            textile: "Textile",
-            groovy: "Groovy",
-            liquid: "Liquid",
-            Scala: "Scala"
+            xml:        "XML",
+            html:       "HTML",
+            css:        "CSS",
+            scss:       "SCSS",
+            python:     "Python",
+            php:        "PHP",
+            java:       "Java",
+            ruby:       "Ruby",
+            c_cpp:      "C/C++",
+            coffee:     "CoffeeScript",
+            json:       "json",
+            perl:       "Perl",
+            clojure:    "Clojure",
+            ocaml:      "OCaml",
+            csharp:     "C#",
+            haxe:       "haXe",
+            svg:        "SVG",
+            textile:    "Textile",
+            groovy:     "Groovy",
+            liquid:     "Liquid",
+            Scala:      "Scala"
         },
         theme: {
-            clouds: "Clouds",
-            clouds_midnight: "Clouds Midnight",
-            cobalt: "Cobalt",
-            crimson_editor: "Crimson Editor",
-            dawn: "Dawn",
-            gob: "Green on Black",
-            eclipse: "Eclipse",
-            idle_fingers: "Idle Fingers",
-            kr_theme: "Kr Theme",
-            merbivore: "Merbivore",
-            merbivore_soft: "Merbivore Soft",
-            mono_industrial: "Mono Industrial",
-            monokai: "Monokai",
-            pastel_on_dark: "Pastel On Dark",
-            solarized_dark: "Solarized Dark",
-            solarized_light: "Solarized Light",
-            textmate: "Textmate",
-            twilight: "Twilight",
-            vibrant_ink: "Vibrant Ink"
+            clouds:           "Clouds",
+            clouds_midnight:  "Clouds Midnight",
+            cobalt:           "Cobalt",
+            crimson_editor:   "Crimson Editor",
+            dawn:             "Dawn",
+            gob:              "Green on Black",
+            eclipse:          "Eclipse",
+            idle_fingers:     "Idle Fingers",
+            kr_theme:         "Kr Theme",
+            merbivore:        "Merbivore",
+            merbivore_soft:   "Merbivore Soft",
+            mono_industrial:  "Mono Industrial",
+            monokai:          "Monokai",
+            pastel_on_dark:   "Pastel On Dark",
+            solarized_dark:   "Solarized Dark",
+            solarized_light:  "Solarized Light",
+            textmate:         "Textmate",
+            twilight:         "Twilight",
+            vibrant_ink:      "Vibrant Ink"
         },
         showGutter: BOOL,
         fontSize: {
@@ -304,37 +465,48 @@ function setupSettingPanel(settingDiv, settingOpener, editor) {
             "16px": "16px"
         },
         wrap: {
-            off: "Off",
-            40: "40",
-            80: "80",
-            free: "Free"
+            off:    "Off",
+            40:     "40",
+            80:     "80",
+            free:   "Free"
         },
         keybindings: {
             ace: "ace",
             vim: "vim",
             emacs: "emacs"
         },
-        showPrintMargin: BOOL,
-        useSoftTabs: BOOL,
-        showInvisibles: BOOL
+        showPrintMargin:    BOOL,
+        useSoftTabs:        BOOL,
+        showInvisibles:     BOOL
     };
+
     var table = [];
     table.push("<table><tr><th>Setting</th><th>Value</th></tr>");
+
     function renderOption(builder, option, obj, cValue) {
         if (!obj) {
-            builder.push("<input type='checkbox' title='", option, "' ", cValue + "" == "true" ? "checked='true'" : "", "'></input>");
+            builder.push(
+                "<input type='checkbox' title='", option, "' ",
+                    cValue + "" == "true" ? "checked='true'" : "",
+               "'></input>"
+            );
             return;
         }
         builder.push("<select title='" + option + "'>");
         for (var value in obj) {
             builder.push("<option value='" + value + "' ");
+
             if (cValue == value) {
                 builder.push(" selected ");
             }
-            builder.push(">", obj[value], "</option>");
+
+            builder.push(">",
+                obj[value],
+                "</option>");
         }
         builder.push("</select>");
     }
+
     for (var option in exports.defaultOptions) {
         table.push("<tr><td>", desc[option], "</td>");
         table.push("<td>");
@@ -343,11 +515,12 @@ function setupSettingPanel(settingDiv, settingOpener, editor) {
     }
     table.push("</table>");
     settingDiv.innerHTML = table.join("");
-    var onChange = function (e) {
+
+    var onChange = function(e) {
         var select = e.currentTarget;
         editor.setOption(select.title, select.value);
     };
-    var onClick = function (e) {
+    var onClick = function(e) {
         var cb = e.currentTarget;
         editor.setOption(cb.title, cb.checked);
     };
@@ -357,25 +530,27 @@ function setupSettingPanel(settingDiv, settingOpener, editor) {
     var cbs = settingDiv.getElementsByTagName("input");
     for (var i = 0; i < cbs.length; i++)
         cbs[i].onclick = onClick;
+
+
     var button = document.createElement("input");
     button.type = "button";
     button.value = "Hide";
-    event.addListener(button, "click", function () {
+    event.addListener(button, "click", function() {
         editor.setDisplaySettings(false);
     });
     settingDiv.appendChild(button);
     settingDiv.hideButton = button;
 }
 exports.defaultOptions = {
-    mode: "javascript",
-    theme: "textmate",
-    wrap: "off",
-    fontSize: "12px",
-    showGutter: "false",
-    keybindings: "ace",
-    showPrintMargin: "false",
-    useSoftTabs: "true",
-    showInvisibles: "false"
+    mode:               "javascript",
+    theme:              "textmate",
+    wrap:               "off",
+    fontSize:           "12px",
+    showGutter:         "false",
+    keybindings:        "ace",
+    showPrintMargin:    "false",
+    useSoftTabs:        "true",
+    showInvisibles:     "false"
 };
 
 });                (function() {

文件差异内容过多而无法显示
+ 6 - 0
web/2839e845bd0cf60f35f3a8ca90a5ee22.js


+ 254 - 0
web/294fbc5b00264d6215dd8ff838dc2999.js

@@ -0,0 +1,254 @@
+ace.define("ace/snippets/edifact",["require","exports","module"], function(require, exports, module) {
+    "use strict";
+    
+    exports.snippetText = "## Access Modifiers\n\
+snippet u\n\
+	UN\n\
+snippet un\n\
+	UNB\n\
+snippet pr\n\
+	private\n\
+##\n\
+## Annotations\n\
+snippet before\n\
+	@Before\n\
+	static void ${1:intercept}(${2:args}) { ${3} }\n\
+snippet mm\n\
+	@ManyToMany\n\
+	${1}\n\
+snippet mo\n\
+	@ManyToOne\n\
+	${1}\n\
+snippet om\n\
+	@OneToMany${1:(cascade=CascadeType.ALL)}\n\
+	${2}\n\
+snippet oo\n\
+	@OneToOne\n\
+	${1}\n\
+##\n\
+## Basic Java packages and import\n\
+snippet im\n\
+	import\n\
+snippet j.b\n\
+	java.beans.\n\
+snippet j.i\n\
+	java.io.\n\
+snippet j.m\n\
+	java.math.\n\
+snippet j.n\n\
+	java.net.\n\
+snippet j.u\n\
+	java.util.\n\
+##\n\
+## Class\n\
+snippet cl\n\
+	class ${1:`Filename(\"\", \"untitled\")`} ${2}\n\
+snippet in\n\
+	interface ${1:`Filename(\"\", \"untitled\")`} ${2:extends Parent}${3}\n\
+snippet tc\n\
+	public class ${1:`Filename()`} extends ${2:TestCase}\n\
+##\n\
+## Class Enhancements\n\
+snippet ext\n\
+	extends \n\
+snippet imp\n\
+	implements\n\
+##\n\
+## Comments\n\
+snippet /*\n\
+	/*\n\
+	 * ${1}\n\
+	 */\n\
+##\n\
+## Constants\n\
+snippet co\n\
+	static public final ${1:String} ${2:var} = ${3};${4}\n\
+snippet cos\n\
+	static public final String ${1:var} = \"${2}\";${3}\n\
+##\n\
+## Control Statements\n\
+snippet case\n\
+	case ${1}:\n\
+		${2}\n\
+snippet def\n\
+	default:\n\
+		${2}\n\
+snippet el\n\
+	else\n\
+snippet elif\n\
+	else if (${1}) ${2}\n\
+snippet if\n\
+	if (${1}) ${2}\n\
+snippet sw\n\
+	switch (${1}) {\n\
+		${2}\n\
+	}\n\
+##\n\
+## Create a Method\n\
+snippet m\n\
+	${1:void} ${2:method}(${3}) ${4:throws }${5}\n\
+##\n\
+## Create a Variable\n\
+snippet v\n\
+	${1:String} ${2:var}${3: = null}${4};${5}\n\
+##\n\
+## Enhancements to Methods, variables, classes, etc.\n\
+snippet ab\n\
+	abstract\n\
+snippet fi\n\
+	final\n\
+snippet st\n\
+	static\n\
+snippet sy\n\
+	synchronized\n\
+##\n\
+## Error Methods\n\
+snippet err\n\
+	System.err.print(\"${1:Message}\");\n\
+snippet errf\n\
+	System.err.printf(\"${1:Message}\", ${2:exception});\n\
+snippet errln\n\
+	System.err.println(\"${1:Message}\");\n\
+##\n\
+## Exception Handling\n\
+snippet as\n\
+	assert ${1:test} : \"${2:Failure message}\";${3}\n\
+snippet ca\n\
+	catch(${1:Exception} ${2:e}) ${3}\n\
+snippet thr\n\
+	throw\n\
+snippet ths\n\
+	throws\n\
+snippet try\n\
+	try {\n\
+		${3}\n\
+	} catch(${1:Exception} ${2:e}) {\n\
+	}\n\
+snippet tryf\n\
+	try {\n\
+		${3}\n\
+	} catch(${1:Exception} ${2:e}) {\n\
+	} finally {\n\
+	}\n\
+##\n\
+## Find Methods\n\
+snippet findall\n\
+	List<${1:listName}> ${2:items} = ${1}.findAll();${3}\n\
+snippet findbyid\n\
+	${1:var} ${2:item} = ${1}.findById(${3});${4}\n\
+##\n\
+## Javadocs\n\
+snippet /**\n\
+	/**\n\
+	 * ${1}\n\
+	 */\n\
+snippet @au\n\
+	@author `system(\"grep \\`id -un\\` /etc/passwd | cut -d \\\":\\\" -f5 | cut -d \\\",\\\" -f1\")`\n\
+snippet @br\n\
+	@brief ${1:Description}\n\
+snippet @fi\n\
+	@file ${1:`Filename()`}.java\n\
+snippet @pa\n\
+	@param ${1:param}\n\
+snippet @re\n\
+	@return ${1:param}\n\
+##\n\
+## Logger Methods\n\
+snippet debug\n\
+	Logger.debug(${1:param});${2}\n\
+snippet error\n\
+	Logger.error(${1:param});${2}\n\
+snippet info\n\
+	Logger.info(${1:param});${2}\n\
+snippet warn\n\
+	Logger.warn(${1:param});${2}\n\
+##\n\
+## Loops\n\
+snippet enfor\n\
+	for (${1} : ${2}) ${3}\n\
+snippet for\n\
+	for (${1}; ${2}; ${3}) ${4}\n\
+snippet wh\n\
+	while (${1}) ${2}\n\
+##\n\
+## Main method\n\
+snippet main\n\
+	public static void main (String[] args) {\n\
+		${1:/* code */}\n\
+	}\n\
+##\n\
+## Print Methods\n\
+snippet print\n\
+	System.out.print(\"${1:Message}\");\n\
+snippet printf\n\
+	System.out.printf(\"${1:Message}\", ${2:args});\n\
+snippet println\n\
+	System.out.println(${1});\n\
+##\n\
+## Render Methods\n\
+snippet ren\n\
+	render(${1:param});${2}\n\
+snippet rena\n\
+	renderArgs.put(\"${1}\", ${2});${3}\n\
+snippet renb\n\
+	renderBinary(${1:param});${2}\n\
+snippet renj\n\
+	renderJSON(${1:param});${2}\n\
+snippet renx\n\
+	renderXml(${1:param});${2}\n\
+##\n\
+## Setter and Getter Methods\n\
+snippet set\n\
+	${1:public} void set${3:}(${2:String} ${4:}){\n\
+		this.$4 = $4;\n\
+	}\n\
+snippet get\n\
+	${1:public} ${2:String} get${3:}(){\n\
+		return this.${4:};\n\
+	}\n\
+##\n\
+## Terminate Methods or Loops\n\
+snippet re\n\
+	return\n\
+snippet br\n\
+	break;\n\
+##\n\
+## Test Methods\n\
+snippet t\n\
+	public void test${1:Name}() throws Exception {\n\
+		${2}\n\
+	}\n\
+snippet test\n\
+	@Test\n\
+	public void test${1:Name}() throws Exception {\n\
+		${2}\n\
+	}\n\
+##\n\
+## Utils\n\
+snippet Sc\n\
+	Scanner\n\
+##\n\
+## Miscellaneous\n\
+snippet action\n\
+	public static void ${1:index}(${2:args}) { ${3} }\n\
+snippet rnf\n\
+	notFound(${1:param});${2}\n\
+snippet rnfin\n\
+	notFoundIfNull(${1:param});${2}\n\
+snippet rr\n\
+	redirect(${1:param});${2}\n\
+snippet ru\n\
+	unauthorized(${1:param});${2}\n\
+snippet unless\n\
+	(unless=${1:param});${2}\n\
+";
+    exports.scope = "edifact";
+    
+});                (function() {
+                    ace.require(["ace/snippets/edifact"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 131 - 92
web/d37f0f78c06e883be0e04a3be861fb68.js → web/29a4e3548d286388c4d5e8f0670a4381.js

@@ -1,7 +1,10 @@
-ace.define("ace/mode/fsharp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+ace.define("ace/mode/fsharp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function (require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
 var FSharpHighlightRules = function () {
+
     var keywordMapper = this.createKeywordMapper({
         "variable": "this",
         "keyword": 'abstract|assert|base|begin|class|default|delegate|done|downcast|downto|elif\
@@ -13,12 +16,14 @@ var FSharpHighlightRules = function () {
 |trait|virtual|volatile|and|do|end|for|fun|if|in|let|let!|new|not|null|of|endif',
         "constant": "true|false"
     }, "identifier");
+
     var floatNumber = "(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))";
+
     this.$rules = {
         "start": [
             {
-                token: "variable.classes",
-                regex: '\\[\\<[.]*\\>\\]'
+              token: "variable.classes",
+              regex: '\\[\\<[.]*\\>\\]'
             },
             {
                 token: "comment",
@@ -36,47 +41,47 @@ var FSharpHighlightRules = function () {
             {
                 token: "string",
                 regex: '"""',
-                next: [{
-                        token: "constant.language.escape",
-                        regex: /\\./,
-                        next: "qqstring"
-                    }, {
-                        token: "string",
-                        regex: '"""',
-                        next: "start"
-                    }, {
-                        defaultToken: "string"
-                    }]
+                next  : [{
+                    token : "constant.language.escape",
+                    regex : /\\./,
+                    next  : "qqstring"
+                }, {
+                    token : "string",
+                    regex : '"""',
+                    next  : "start"
+                }, {
+                    defaultToken: "string"
+                }]
             },
             {
                 token: "string",
                 regex: '"',
-                next: [{
-                        token: "constant.language.escape",
-                        regex: /\\./,
-                        next: "qqstring"
-                    }, {
-                        token: "string",
-                        regex: '"',
-                        next: "start"
-                    }, {
-                        defaultToken: "string"
-                    }]
+                next  : [{
+                    token : "constant.language.escape",
+                    regex : /\\./,
+                    next  : "qqstring"
+                }, {
+                    token : "string",
+                    regex : '"',
+                    next  : "start"
+                }, {
+                    defaultToken: "string"
+                }]
             },
             {
                 token: ["verbatim.string", "string"],
                 regex: '(@?)(")',
-                stateName: "qqstring",
-                next: [{
-                        token: "constant.language.escape",
-                        regex: '""'
-                    }, {
-                        token: "string",
-                        regex: '"',
-                        next: "start"
-                    }, {
-                        defaultToken: "string"
-                    }]
+                stateName : "qqstring",
+                next  : [{
+                    token : "constant.language.escape",
+                    regex : '""'
+                }, {
+                    token : "string",
+                    regex : '"',
+                    next  : "start"
+                }, {
+                    defaultToken: "string"
+                }]
             },
             {
                 token: "constant.float",
@@ -112,86 +117,112 @@ var FSharpHighlightRules = function () {
             }
         ],
         blockComment: [{
-                regex: /\(\*\)/,
-                token: "comment"
-            }, {
-                regex: /\(\*(?!\))/,
-                token: "comment.start",
-                push: "blockComment"
-            }, {
-                regex: /\*\)/,
-                token: "comment.end",
-                next: "pop"
-            }, {
-                defaultToken: "comment"
-            }]
+            regex: /\(\*\)/,
+            token: "comment"
+        }, {
+            regex: /\(\*(?!\))/,
+            token: "comment.start",
+            push: "blockComment"
+        }, {
+            regex: /\*\)/,
+            token: "comment.end",
+            next: "pop"
+        }, {
+            defaultToken: "comment"
+        }]
     };
     this.normalizeRules();
 };
+
+
 oop.inherits(FSharpHighlightRules, TextHighlightRules);
-exports.FSharpHighlightRules = FSharpHighlightRules;
 
+exports.FSharpHighlightRules = FSharpHighlightRules;
 });
 
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var Range = require("../../range").Range;
 var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
     if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
     }
 };
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
+
+(function() {
+    
     this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
     this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
     this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
     this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
     this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
+    
         if (this.singleLineBlockCommentRe.test(line)) {
             if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
                 return "";
         }
+    
         var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
         if (!fw && this.startRegionRe.test(line))
             return "start"; // lineCommentRegionStart
+    
         return fw;
     };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
         var line = session.getLine(row);
+        
         if (this.startRegionRe.test(line))
             return this.getCommentRegionBlock(session, line, row);
+        
         var match = line.match(this.foldingStartMarker);
         if (match) {
             var i = match.index;
+
             if (match[1])
                 return this.openingBracketBlock(session, match[1], row, i);
+                
             var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
             if (range && !range.isMultiLine()) {
                 if (forceMultiline) {
                     range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
+                } else if (foldStyle != "all")
                     range = null;
             }
+            
             return range;
         }
+
         if (foldStyle === "markbegin")
             return;
+
         var match = line.match(this.foldingStopMarker);
         if (match) {
             var i = match.index + match[0].length;
+
             if (match[1])
                 return this.closingBracketBlock(session, match[1], row, i);
+
             return session.getCommentFoldRange(row, i, -1);
         }
     };
-    this.getSectionRange = function (session, row) {
+    
+    this.getSectionRange = function(session, row) {
         var line = session.getLine(row);
         var startIndent = line.search(/\S/);
         var startRow = row;
@@ -204,69 +235,77 @@ oop.inherits(FoldMode, BaseFoldMode);
             var indent = line.search(/\S/);
             if (indent === -1)
                 continue;
-            if (startIndent > indent)
+            if  (startIndent > indent)
                 break;
             var subRange = this.getFoldWidgetRange(session, "all", row);
+            
             if (subRange) {
                 if (subRange.start.row <= startRow) {
                     break;
-                }
-                else if (subRange.isMultiLine()) {
+                } else if (subRange.isMultiLine()) {
                     row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
+                } else if (startIndent == indent) {
                     break;
                 }
             }
             endRow = row;
         }
+        
         return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
     };
-    this.getCommentRegionBlock = function (session, line, row) {
+    this.getCommentRegionBlock = function(session, line, row) {
         var startColumn = line.search(/\s*$/);
         var maxRow = session.getLength();
         var startRow = row;
+        
         var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
         var depth = 1;
         while (++row < maxRow) {
             line = session.getLine(row);
             var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
         }
+
         var endRow = row;
         if (endRow > startRow) {
             return new Range(startRow, startColumn, endRow, line.length);
         }
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/fsharp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/fsharp_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var FSharpHighlightRules = require("./fsharp_highlight_rules").FSharpHighlightRules;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
-    TextMode.call(this);
-    this.HighlightRules = FSharpHighlightRules;
-    this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.lineCommentStart = "//";
-    this.blockComment = { start: "(*", end: "*)", nestable: true };
-    this.$id = "ace/mode/fsharp";
-}).call(Mode.prototype);
-exports.Mode = Mode;
+ace.define("ace/mode/fsharp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/fsharp_highlight_rules","ace/mode/folding/cstyle"], function (require, exports, module) {
+    "use strict";
+
+    var oop = require("../lib/oop");
+    var TextMode = require("./text").Mode;
+    var FSharpHighlightRules = require("./fsharp_highlight_rules").FSharpHighlightRules;
+    var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
+    var Mode = function () {
+        TextMode.call(this);
+        this.HighlightRules = FSharpHighlightRules;
+        this.foldingRules = new CStyleFoldMode();
+    };
+
+    oop.inherits(Mode, TextMode);
+
+
+    (function () {
+        this.lineCommentStart = "//";
+        this.blockComment = {start: "(*", end: "*)", nestable: true};
+
+
+        this.$id = "ace/mode/fsharp";
+    }).call(Mode.prototype);
 
+    exports.Mode = Mode;
 });                (function() {
                     ace.require(["ace/mode/fsharp"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

文件差异内容过多而无法显示
+ 0 - 0
web/2a4c96bd91c25806d68325751fb0c958.js


+ 197 - 159
web/30335c579bfc2de8dcf574523ef13020.js → web/2a7b2ac7dc47105609001b93c25190b8.js

@@ -1,7 +1,10 @@
-ace.define("ace/mode/nim_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+ace.define("ace/mode/nim_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function (require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
 var NimHighlightRules = function () {
+
     var keywordMapper = this.createKeywordMapper({
         "variable": "var|let|const",
         "keyword": "assert|parallel|spawn|export|include|from|template|mixin|bind|import|concept|raise|defer|try|finally|except|converter|proc|func|macro|method|and|or|not|xor|shl|shr|div|mod|in|notin|is|isnot|of|static|if|elif|else|case|of|discard|when|return|yield|block|break|while|echo|continue|asm|using|cast|addr|unsafeAddr|type|ref|ptr|do|declared|defined|definedInScope|compiles|sizeOf|is|shallowCopy|getAst|astToStr|spawn|procCall|for|iterator|as",
@@ -9,6 +12,7 @@ var NimHighlightRules = function () {
         "support.function": "lock|ze|toU8|toU16|toU32|ord|low|len|high|add|pop|contains|card|incl|excl|dealloc|inc",
         "constant.language": "nil|true|false"
     }, "identifier");
+
     var hexNumber = "(?:0[xX][\\dA-Fa-f][\\dA-Fa-f_]*)";
     var decNumber = "(?:[0-9][\\d_]*)";
     var octNumber = "(?:0o[0-7][0-7_]*)";
@@ -21,224 +25,250 @@ var NimHighlightRules = function () {
     var identifier = '[a-zA-Z][a-zA-Z0-9_]*';
     this.$rules = {
         "start": [{
-                token: ["identifier", "keyword.operator", "support.function"],
-                regex: "(" + identifier + ")([.]{1})(" + identifier + ")(?=\\()"
-            }, {
-                token: "paren.lparen",
-                regex: "(\\{\\.)",
-                next: [{
-                        token: "paren.rparen",
-                        regex: '(\\.\\}|\\})',
-                        next: "start"
-                    }, {
-                        include: "methods"
-                    }, {
-                        token: "identifier",
-                        regex: identifier
-                    }, {
-                        token: "punctuation",
-                        regex: /[,]/
-                    }, {
-                        token: "keyword.operator",
-                        regex: /[=:.]/
-                    }, {
-                        token: "paren.lparen",
-                        regex: /[[(]/
-                    }, {
-                        token: "paren.rparen",
-                        regex: /[\])]/
-                    }, {
-                        include: "math"
-                    }, {
-                        include: "strings"
-                    }, {
-                        defaultToken: "text"
-                    }]
-            }, {
-                token: "comment.doc.start",
-                regex: /##\[(?!])/,
-                push: "docBlockComment"
-            }, {
-                token: "comment.start",
-                regex: /#\[(?!])/,
-                push: "blockComment"
-            }, {
-                token: "comment.doc",
-                regex: '##.*$'
-            }, {
-                token: "comment",
-                regex: '#.*$'
-            }, {
-                include: "strings"
-            }, {
-                token: "string",
-                regex: "'(?:\\\\(?:[abercnlftv]|x[0-9A-Fa-f]{2}|[0-2][0-9]{2}|u[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})|.{1})?'"
+            token: ["identifier", "keyword.operator", "support.function"],
+            regex: "(" + identifier + ")([.]{1})(" + identifier + ")(?=\\()"
+        }, {//pragmas
+            token: "paren.lparen",
+            regex: "(\\{\\.)",
+            next: [{
+                token: "paren.rparen",
+                regex: '(\\.\\}|\\})',
+                next: "start"
             }, {
                 include: "methods"
             }, {
-                token: keywordMapper,
-                regex: "[a-zA-Z][a-zA-Z0-9_]*\\b"
+                token: "identifier",
+                regex: identifier
             }, {
-                token: ["keyword.operator", "text", "storage.type"],
-                regex: "([:])(\\s+)(" + identifier + ")(?=$|\\)|\\[|,|\\s+=|;|\\s+\\{)"
+                token: "punctuation",
+                regex: /[,]/
+            }, {
+                token: "keyword.operator",
+                regex: /[=:.]/
             }, {
                 token: "paren.lparen",
-                regex: /\[\.|{\||\(\.|\[:|[[({`]/
+                regex: /[[(]/
             }, {
                 token: "paren.rparen",
-                regex: /\.\)|\|}|\.]|[\])}]/
-            }, {
-                token: "keyword.operator",
-                regex: /[=+\-*\/<>@$~&%|!?^.:\\]/
-            }, {
-                token: "punctuation",
-                regex: /[,;]/
+                regex: /[\])]/
             }, {
                 include: "math"
-            }],
-        blockComment: [{
-                regex: /#\[]/,
-                token: "comment"
-            }, {
-                regex: /#\[(?!])/,
-                token: "comment.start",
-                push: "blockComment"
             }, {
-                regex: /]#/,
-                token: "comment.end",
-                next: "pop"
+                include: "strings"
             }, {
-                defaultToken: "comment"
-            }],
+                defaultToken: "text"
+            }]
+        }, {
+            token: "comment.doc.start",
+            regex: /##\[(?!])/,
+            push: "docBlockComment"
+        }, {
+            token: "comment.start",
+            regex: /#\[(?!])/,
+            push: "blockComment"
+        }, {
+            token: "comment.doc",
+            regex: '##.*$'
+        }, {
+            token: "comment",
+            regex: '#.*$'
+        }, {
+            include: "strings"
+        }, {// character
+            token: "string",
+            regex: "'(?:\\\\(?:[abercnlftv]|x[0-9A-Fa-f]{2}|[0-2][0-9]{2}|u[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})|.{1})?'"
+        }, {
+            include: "methods"
+        }, {
+            token: keywordMapper,
+            regex: "[a-zA-Z][a-zA-Z0-9_]*\\b"
+        }, {
+            token: ["keyword.operator", "text", "storage.type"],
+            regex: "([:])(\\s+)(" + identifier + ")(?=$|\\)|\\[|,|\\s+=|;|\\s+\\{)"
+        }, {
+            token: "paren.lparen",
+            regex: /\[\.|{\||\(\.|\[:|[[({`]/
+        }, {
+            token: "paren.rparen",
+            regex: /\.\)|\|}|\.]|[\])}]/
+        }, {
+            token: "keyword.operator",
+            regex: /[=+\-*\/<>@$~&%|!?^.:\\]/
+        }, {
+            token: "punctuation",
+            regex: /[,;]/
+        }, {
+            include: "math"
+        }],
+        blockComment: [{
+            regex: /#\[]/,
+            token: "comment"
+        }, {
+            regex: /#\[(?!])/,
+            token: "comment.start",
+            push: "blockComment"
+        }, {
+            regex: /]#/,
+            token: "comment.end",
+            next: "pop"
+        }, {
+            defaultToken: "comment"
+        }],
         docBlockComment: [{
-                regex: /##\[]/,
-                token: "comment.doc"
-            }, {
-                regex: /##\[(?!])/,
-                token: "comment.doc.start",
-                push: "docBlockComment"
-            }, {
-                regex: /]##/,
-                token: "comment.doc.end",
-                next: "pop"
-            }, {
-                defaultToken: "comment.doc"
-            }],
+            regex: /##\[]/,
+            token: "comment.doc"
+        }, {
+            regex: /##\[(?!])/,
+            token: "comment.doc.start",
+            push: "docBlockComment"
+        }, {
+            regex: /]##/,
+            token: "comment.doc.end",
+            next: "pop"
+        }, {
+            defaultToken: "comment.doc"
+        }],
         math: [{
-                token: "constant.float",
-                regex: floatNumberExt
-            }, {
-                token: "constant.float",
-                regex: floatNumber
-            }, {
-                token: "constant.integer",
-                regex: intNumber
-            }],
+            token: "constant.float",
+            regex: floatNumberExt
+        }, {
+            token: "constant.float",
+            regex: floatNumber
+        }, {
+            token: "constant.integer",
+            regex: intNumber
+        }],
         methods: [{
-                token: "support.function",
-                regex: "(\\w+)(?=\\()"
-            }],
+            token: "support.function",
+            regex: "(\\w+)(?=\\()"
+        }],
         strings: [{
+            token: "string",
+            regex: '(\\b' + identifier + ')?"""',
+            push: [{
                 token: "string",
-                regex: '(\\b' + identifier + ')?"""',
-                push: [{
-                        token: "string",
-                        regex: '"""',
-                        next: "pop"
-                    }, {
-                        defaultToken: "string"
-                    }]
+                regex: '"""',
+                next: "pop"
             }, {
+                defaultToken: "string"
+            }]
+        }, {
+            token: "string",
+            regex: "\\b" + identifier + '"(?=.)',
+            push: [{
                 token: "string",
-                regex: "\\b" + identifier + '"(?=.)',
-                push: [{
-                        token: "string",
-                        regex: '"|$',
-                        next: "pop"
-                    }, {
-                        defaultToken: "string"
-                    }]
+                regex: '"|$',
+                next: "pop"
             }, {
+                defaultToken: "string"
+            }]
+        }, {
+            token: "string",
+            regex: '"',
+            push: [{
                 token: "string",
-                regex: '"',
-                push: [{
-                        token: "string",
-                        regex: '"|$',
-                        next: "pop"
-                    }, {
-                        token: "constant.language.escape",
-                        regex: stringEscape
-                    }, {
-                        defaultToken: "string"
-                    }]
+                regex: '"|$',
+                next: "pop"
+            }, {
+                token: "constant.language.escape",
+                regex: stringEscape
+            }, {
+                defaultToken: "string"
             }]
+        }]
     };
     this.normalizeRules();
 };
+
+
 oop.inherits(NimHighlightRules, TextHighlightRules);
-exports.NimHighlightRules = NimHighlightRules;
 
+exports.NimHighlightRules = NimHighlightRules;
 });
 
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var Range = require("../../range").Range;
 var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
     if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
     }
 };
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
+
+(function() {
+    
     this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
     this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
     this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
     this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
     this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
+    
         if (this.singleLineBlockCommentRe.test(line)) {
             if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
                 return "";
         }
+    
         var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
         if (!fw && this.startRegionRe.test(line))
             return "start"; // lineCommentRegionStart
+    
         return fw;
     };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
         var line = session.getLine(row);
+        
         if (this.startRegionRe.test(line))
             return this.getCommentRegionBlock(session, line, row);
+        
         var match = line.match(this.foldingStartMarker);
         if (match) {
             var i = match.index;
+
             if (match[1])
                 return this.openingBracketBlock(session, match[1], row, i);
+                
             var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
             if (range && !range.isMultiLine()) {
                 if (forceMultiline) {
                     range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
+                } else if (foldStyle != "all")
                     range = null;
             }
+            
             return range;
         }
+
         if (foldStyle === "markbegin")
             return;
+
         var match = line.match(this.foldingStopMarker);
         if (match) {
             var i = match.index + match[0].length;
+
             if (match[1])
                 return this.closingBracketBlock(session, match[1], row, i);
+
             return session.getCommentFoldRange(row, i, -1);
         }
     };
-    this.getSectionRange = function (session, row) {
+    
+    this.getSectionRange = function(session, row) {
         var line = session.getLine(row);
         var startIndent = line.search(/\S/);
         var startRow = row;
@@ -251,70 +281,78 @@ oop.inherits(FoldMode, BaseFoldMode);
             var indent = line.search(/\S/);
             if (indent === -1)
                 continue;
-            if (startIndent > indent)
+            if  (startIndent > indent)
                 break;
             var subRange = this.getFoldWidgetRange(session, "all", row);
+            
             if (subRange) {
                 if (subRange.start.row <= startRow) {
                     break;
-                }
-                else if (subRange.isMultiLine()) {
+                } else if (subRange.isMultiLine()) {
                     row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
+                } else if (startIndent == indent) {
                     break;
                 }
             }
             endRow = row;
         }
+        
         return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
     };
-    this.getCommentRegionBlock = function (session, line, row) {
+    this.getCommentRegionBlock = function(session, line, row) {
         var startColumn = line.search(/\s*$/);
         var maxRow = session.getLength();
         var startRow = row;
+        
         var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
         var depth = 1;
         while (++row < maxRow) {
             line = session.getLine(row);
             var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
         }
+
         var endRow = row;
         if (endRow > startRow) {
             return new Range(startRow, startColumn, endRow, line.length);
         }
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/nim",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/nim_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/nim",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/nim_highlight_rules","ace/mode/folding/cstyle"], function (require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var NimHighlightRules = require("./nim_highlight_rules").NimHighlightRules;
 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
+
 var Mode = function () {
     TextMode.call(this);
     this.HighlightRules = NimHighlightRules;
     this.foldingRules = new CStyleFoldMode();
     this.$behaviour = this.$defaultBehaviour;
 };
+
 oop.inherits(Mode, TextMode);
+
+
 (function () {
     this.lineCommentStart = "#";
-    this.blockComment = { start: "#[", end: "]#", nestable: true };
+    this.blockComment = {start: "#[", end: "]#", nestable: true};
+
+
     this.$id = "ace/mode/nim";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });                (function() {
                     ace.require(["ace/mode/nim"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 0 - 133
web/2b1eed411f531a271f0e47693c82216a.js

@@ -1,133 +0,0 @@
-ace.define("ace/ext/menu_tools/settings_menu.css",["require","exports","module"], function(require, exports, module){module.exports = "#ace_settingsmenu, #kbshortcutmenu {\n    background-color: #F7F7F7;\n    color: black;\n    box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\n    padding: 1em 0.5em 2em 1em;\n    overflow: auto;\n    position: absolute;\n    margin: 0;\n    bottom: 0;\n    right: 0;\n    top: 0;\n    z-index: 9991;\n    cursor: default;\n}\n\n.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\n    box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\n    background-color: rgba(255, 255, 255, 0.6);\n    color: black;\n}\n\n.ace_optionsMenuEntry:hover {\n    background-color: rgba(100, 100, 100, 0.1);\n    transition: all 0.3s\n}\n\n.ace_closeButton {\n    background: rgba(245, 146, 146, 0.5);\n    border: 1px solid #F48A8A;\n    border-radius: 50%;\n    padding: 7px;\n    position: absolute;\n    right: -8px;\n    top: -8px;\n    z-index: 100000;\n}\n.ace_closeButton{\n    background: rgba(245, 146, 146, 0.9);\n}\n.ace_optionsMenuKey {\n    color: darkslateblue;\n    font-weight: bold;\n}\n.ace_optionsMenuCommand {\n    color: darkcyan;\n    font-weight: normal;\n}\n.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {\n    vertical-align: middle;\n}\n\n.ace_optionsMenuEntry button[ace_selected_button=true] {\n    background: #e7e7e7;\n    box-shadow: 1px 0px 2px 0px #adadad inset;\n    border-color: #adadad;\n}\n.ace_optionsMenuEntry button {\n    background: white;\n    border: 1px solid lightgray;\n    margin: 0px;\n}\n.ace_optionsMenuEntry button:hover{\n    background: #f0f0f0;\n}";
-
-});
-
-ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom","ace/ext/menu_tools/settings_menu.css"], function(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
-'use strict';
-var dom = require("../../lib/dom");
-var cssText = require("./settings_menu.css");
-dom.importCssString(cssText, "settings_menu.css", false);
-module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
-    var closer = document.createElement('div');
-    var ignoreFocusOut = false;
-    function documentEscListener(e) {
-        if (e.keyCode === 27) {
-            close();
-        }
-    }
-    function close() {
-        if (!closer)
-            return;
-        document.removeEventListener('keydown', documentEscListener);
-        closer.parentNode.removeChild(closer);
-        if (editor) {
-            editor.focus();
-        }
-        closer = null;
-        callback && callback();
-    }
-    function setIgnoreFocusOut(ignore) {
-        ignoreFocusOut = ignore;
-        if (ignore) {
-            closer.style.pointerEvents = "none";
-            contentElement.style.pointerEvents = "auto";
-        }
-    }
-    closer.style.cssText = 'margin: 0; padding: 0; ' +
-        'position: fixed; top:0; bottom:0; left:0; right:0;' +
-        'z-index: 9990; ' +
-        (editor ? 'background-color: rgba(0, 0, 0, 0.3);' : '');
-    closer.addEventListener('click', function (e) {
-        if (!ignoreFocusOut) {
-            close();
-        }
-    });
-    document.addEventListener('keydown', documentEscListener);
-    contentElement.addEventListener('click', function (e) {
-        e.stopPropagation();
-    });
-    closer.appendChild(contentElement);
-    document.body.appendChild(closer);
-    if (editor) {
-        editor.blur();
-    }
-    return {
-        close: close,
-        setIgnoreFocusOut: setIgnoreFocusOut
-    };
-};
-
-});
-
-ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"], function(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
-"use strict";
-var keys = require("../../lib/keys");
-module.exports.getEditorKeybordShortcuts = function (editor) {
-    var KEY_MODS = keys.KEY_MODS;
-    var keybindings = [];
-    var commandMap = {};
-    editor.keyBinding.$handlers.forEach(function (handler) {
-        var ckb = handler.commandKeyBinding;
-        for (var i in ckb) {
-            var key = i.replace(/(^|-)\w/g, function (x) { return x.toUpperCase(); });
-            var commands = ckb[i];
-            if (!Array.isArray(commands))
-                commands = [commands];
-            commands.forEach(function (command) {
-                if (typeof command != "string")
-                    command = command.name;
-                if (commandMap[command]) {
-                    commandMap[command].key += "|" + key;
-                }
-                else {
-                    commandMap[command] = { key: key, command: command };
-                    keybindings.push(commandMap[command]);
-                }
-            });
-        }
-    });
-    return keybindings;
-};
-
-});
-
-ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"], function(require, exports, module){/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/
-"use strict";
-var Editor = require("../editor").Editor;
-function showKeyboardShortcuts(editor) {
-    if (!document.getElementById('kbshortcutmenu')) {
-        var overlayPage = require('./menu_tools/overlay_page').overlayPage;
-        var getEditorKeybordShortcuts = require('./menu_tools/get_editor_keyboard_shortcuts').getEditorKeybordShortcuts;
-        var kb = getEditorKeybordShortcuts(editor);
-        var el = document.createElement('div');
-        var commands = kb.reduce(function (previous, current) {
-            return previous + '<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'
-                + current.command + '</span> : '
-                + '<span class="ace_optionsMenuKey">' + current.key + '</span></div>';
-        }, '');
-        el.id = 'kbshortcutmenu';
-        el.innerHTML = '<h1>Keyboard Shortcuts</h1>' + commands + '</div>';
-        overlayPage(editor, el);
-    }
-}
-module.exports.init = function (editor) {
-    Editor.prototype.showKeyboardShortcuts = function () {
-        showKeyboardShortcuts(this);
-    };
-    editor.commands.addCommands([{
-            name: "showKeyboardShortcuts",
-            bindKey: { win: "Ctrl-Alt-h", mac: "Command-Alt-h" },
-            exec: function (editor, line) {
-                editor.showKeyboardShortcuts();
-            }
-        }]);
-};
-
-});                (function() {
-                    ace.require(["ace/ext/keybinding_menu"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 0 - 16
web/2d53cfacb6a695f378ca997fcee7efb3.js

@@ -1,16 +0,0 @@
-ace.define("ace/snippets/csound_orchestra.snippets",["require","exports","module"], function(require, exports, module){module.exports = "# else\nsnippet else\n\telse\n\t\t${1:/* statements */}\n# elseif\nsnippet elseif\n\telseif ${1:/* condition */} then\n\t\t${2:/* statements */}\n# if\nsnippet if\n\tif ${1:/* condition */} then\n\t\t${2:/* statements */}\n\tendif\n# instrument block\nsnippet instr\n\tinstr ${1:name}\n\t\t${2:/* statements */}\n\tendin\n# i-time while loop\nsnippet iwhile\n\ti${1:Index} = ${2:0}\n\twhile i${1:Index} < ${3:/* count */} do\n\t\t${4:/* statements */}\n\t\ti${1:Index} += 1\n\tod\n# k-rate while loop\nsnippet kwhile\n\tk${1:Index} = ${2:0}\n\twhile k${1:Index} < ${3:/* count */} do\n\t\t${4:/* statements */}\n\t\tk${1:Index} += 1\n\tod\n# opcode\nsnippet opcode\n\topcode ${1:name}, ${2:/* output types */ 0}, ${3:/* input types */ 0}\n\t\t${4:/* statements */}\n\tendop\n# until loop\nsnippet until\n\tuntil ${1:/* condition */} do\n\t\t${2:/* statements */}\n\tod\n# while loop\nsnippet while\n\twhile ${1:/* condition */} do\n\t\t${2:/* statements */}\n\tod\n";
-
-});
-
-ace.define("ace/snippets/csound_orchestra",["require","exports","module","ace/snippets/csound_orchestra.snippets"], function(require, exports, module){"use strict";
-exports.snippetText = require("./csound_orchestra.snippets");
-exports.scope = "csound_orchestra";
-
-});                (function() {
-                    ace.require(["ace/snippets/csound_orchestra"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 0 - 305
web/2dcf359bda4d96fcd06e8b0b7bc039bf.js

@@ -1,305 +0,0 @@
-ace.define("ace/mode/prolog_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from https://raw.github.com/stephenroller/prolog-tmbundle/master/Syntaxes/Prolog.tmLanguage (uuid: ) */
-"use strict";
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var PrologHighlightRules = function () {
-    this.$rules = { start: [{ include: '#comment' },
-            { include: '#basic_fact' },
-            { include: '#rule' },
-            { include: '#directive' },
-            { include: '#fact' }],
-        '#atom': [{ token: 'constant.other.atom.prolog',
-                regex: '\\b[a-z][a-zA-Z0-9_]*\\b' },
-            { token: 'constant.numeric.prolog',
-                regex: '-?\\d+(?:\\.\\d+)?' },
-            { include: '#string' }],
-        '#basic_elem': [{ include: '#comment' },
-            { include: '#statement' },
-            { include: '#constants' },
-            { include: '#operators' },
-            { include: '#builtins' },
-            { include: '#list' },
-            { include: '#atom' },
-            { include: '#variable' }],
-        '#basic_fact': [{ token: ['entity.name.function.fact.basic.prolog',
-                    'punctuation.end.fact.basic.prolog'],
-                regex: '([a-z]\\w*)(\\.)' }],
-        '#builtins': [{ token: 'support.function.builtin.prolog',
-                regex: '\\b(?:abolish|abort|ancestors|arg|ascii|assert[az]|atom(?:ic)?|body|char|close|conc|concat|consult|define|definition|dynamic|dump|fail|file|free|free_proc|functor|getc|goal|halt|head|head|integer|length|listing|match_args|member|next_clause|nl|nonvar|nth|number|cvars|nvars|offset|op|print?|prompt|putc|quoted|ratom|read|redefine|rename|retract(?:all)?|see|seeing|seen|skip|spy|statistics|system|tab|tell|telling|term|time|told|univ|unlink_clause|unspy_predicate|var|write)\\b' }],
-        '#comment': [{ token: ['punctuation.definition.comment.prolog',
-                    'comment.line.percentage.prolog'],
-                regex: '(%)(.*$)' },
-            { token: 'punctuation.definition.comment.prolog',
-                regex: '/\\*',
-                push: [{ token: 'punctuation.definition.comment.prolog',
-                        regex: '\\*/',
-                        next: 'pop' },
-                    { defaultToken: 'comment.block.prolog' }] }],
-        '#constants': [{ token: 'constant.language.prolog',
-                regex: '\\b(?:true|false|yes|no)\\b' }],
-        '#directive': [{ token: 'keyword.operator.directive.prolog',
-                regex: ':-',
-                push: [{ token: 'meta.directive.prolog', regex: '\\.', next: 'pop' },
-                    { include: '#comment' },
-                    { include: '#statement' },
-                    { defaultToken: 'meta.directive.prolog' }] }],
-        '#expr': [{ include: '#comments' },
-            { token: 'meta.expression.prolog',
-                regex: '\\(',
-                push: [{ token: 'meta.expression.prolog', regex: '\\)', next: 'pop' },
-                    { include: '#expr' },
-                    { defaultToken: 'meta.expression.prolog' }] },
-            { token: 'keyword.control.cutoff.prolog', regex: '!' },
-            { token: 'punctuation.control.and.prolog', regex: ',' },
-            { token: 'punctuation.control.or.prolog', regex: ';' },
-            { include: '#basic_elem' }],
-        '#fact': [{ token: ['entity.name.function.fact.prolog',
-                    'punctuation.begin.fact.parameters.prolog'],
-                regex: '([a-z]\\w*)(\\()(?!.*:-)',
-                push: [{ token: ['punctuation.end.fact.parameters.prolog',
-                            'punctuation.end.fact.prolog'],
-                        regex: '(\\))(\\.?)',
-                        next: 'pop' },
-                    { include: '#parameter' },
-                    { defaultToken: 'meta.fact.prolog' }] }],
-        '#list': [{ token: 'punctuation.begin.list.prolog',
-                regex: '\\[(?=.*\\])',
-                push: [{ token: 'punctuation.end.list.prolog',
-                        regex: '\\]',
-                        next: 'pop' },
-                    { include: '#comment' },
-                    { token: 'punctuation.separator.list.prolog', regex: ',' },
-                    { token: 'punctuation.concat.list.prolog',
-                        regex: '\\|',
-                        push: [{ token: 'meta.list.concat.prolog',
-                                regex: '(?=\\s*\\])',
-                                next: 'pop' },
-                            { include: '#basic_elem' },
-                            { defaultToken: 'meta.list.concat.prolog' }] },
-                    { include: '#basic_elem' },
-                    { defaultToken: 'meta.list.prolog' }] }],
-        '#operators': [{ token: 'keyword.operator.prolog',
-                regex: '\\\\\\+|\\bnot\\b|\\bis\\b|->|[><]|[><\\\\:=]?=|(?:=\\\\|\\\\=)=' }],
-        '#parameter': [{ token: 'variable.language.anonymous.prolog',
-                regex: '\\b_\\b' },
-            { token: 'variable.parameter.prolog',
-                regex: '\\b[A-Z_]\\w*\\b' },
-            { token: 'punctuation.separator.parameters.prolog', regex: ',' },
-            { include: '#basic_elem' },
-            { token: 'text', regex: '[^\\s]' }],
-        '#rule': [{ token: 'meta.rule.prolog',
-                regex: '(?=[a-z]\\w*.*:-)',
-                push: [{ token: 'punctuation.rule.end.prolog',
-                        regex: '\\.',
-                        next: 'pop' },
-                    { token: 'meta.rule.signature.prolog',
-                        regex: '(?=[a-z]\\w*.*:-)',
-                        push: [{ token: 'meta.rule.signature.prolog',
-                                regex: '(?=:-)',
-                                next: 'pop' },
-                            { token: 'entity.name.function.rule.prolog',
-                                regex: '[a-z]\\w*(?=\\(|\\s*:-)' },
-                            { token: 'punctuation.rule.parameters.begin.prolog',
-                                regex: '\\(',
-                                push: [{ token: 'punctuation.rule.parameters.end.prolog',
-                                        regex: '\\)',
-                                        next: 'pop' },
-                                    { include: '#parameter' },
-                                    { defaultToken: 'meta.rule.parameters.prolog' }] },
-                            { defaultToken: 'meta.rule.signature.prolog' }] },
-                    { token: 'keyword.operator.definition.prolog',
-                        regex: ':-',
-                        push: [{ token: 'meta.rule.definition.prolog',
-                                regex: '(?=\\.)',
-                                next: 'pop' },
-                            { include: '#comment' },
-                            { include: '#expr' },
-                            { defaultToken: 'meta.rule.definition.prolog' }] },
-                    { defaultToken: 'meta.rule.prolog' }] }],
-        '#statement': [{ token: 'meta.statement.prolog',
-                regex: '(?=[a-z]\\w*\\()',
-                push: [{ token: 'punctuation.end.statement.parameters.prolog',
-                        regex: '\\)',
-                        next: 'pop' },
-                    { include: '#builtins' },
-                    { include: '#atom' },
-                    { token: 'punctuation.begin.statement.parameters.prolog',
-                        regex: '\\(',
-                        push: [{ token: 'meta.statement.parameters.prolog',
-                                regex: '(?=\\))',
-                                next: 'pop' },
-                            { token: 'punctuation.separator.statement.prolog', regex: ',' },
-                            { include: '#basic_elem' },
-                            { defaultToken: 'meta.statement.parameters.prolog' }] },
-                    { defaultToken: 'meta.statement.prolog' }] }],
-        '#string': [{ token: 'punctuation.definition.string.begin.prolog',
-                regex: '\'',
-                push: [{ token: 'punctuation.definition.string.end.prolog',
-                        regex: '\'',
-                        next: 'pop' },
-                    { token: 'constant.character.escape.prolog', regex: '\\\\.' },
-                    { token: 'constant.character.escape.quote.prolog',
-                        regex: '\'\'' },
-                    { defaultToken: 'string.quoted.single.prolog' }] }],
-        '#variable': [{ token: 'variable.language.anonymous.prolog',
-                regex: '\\b_\\b' },
-            { token: 'variable.other.prolog',
-                regex: '\\b[A-Z_][a-zA-Z0-9_]*\\b' }] };
-    this.normalizeRules();
-};
-PrologHighlightRules.metaData = { fileTypes: ['plg', 'prolog'],
-    foldingStartMarker: '(%\\s*region \\w*)|([a-z]\\w*.*:- ?)',
-    foldingStopMarker: '(%\\s*end(\\s*region)?)|(?=\\.)',
-    keyEquivalent: '^~P',
-    name: 'Prolog',
-    scopeName: 'source.prolog' };
-oop.inherits(PrologHighlightRules, TextHighlightRules);
-exports.PrologHighlightRules = PrologHighlightRules;
-
-});
-
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
-    if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
-    }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
-    this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
-    this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
-    this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
-    this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
-        var line = session.getLine(row);
-        if (this.singleLineBlockCommentRe.test(line)) {
-            if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
-                return "";
-        }
-        var fw = this._getFoldWidgetBase(session, foldStyle, row);
-        if (!fw && this.startRegionRe.test(line))
-            return "start"; // lineCommentRegionStart
-        return fw;
-    };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
-        var line = session.getLine(row);
-        if (this.startRegionRe.test(line))
-            return this.getCommentRegionBlock(session, line, row);
-        var match = line.match(this.foldingStartMarker);
-        if (match) {
-            var i = match.index;
-            if (match[1])
-                return this.openingBracketBlock(session, match[1], row, i);
-            var range = session.getCommentFoldRange(row, i + match[0].length, 1);
-            if (range && !range.isMultiLine()) {
-                if (forceMultiline) {
-                    range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
-                    range = null;
-            }
-            return range;
-        }
-        if (foldStyle === "markbegin")
-            return;
-        var match = line.match(this.foldingStopMarker);
-        if (match) {
-            var i = match.index + match[0].length;
-            if (match[1])
-                return this.closingBracketBlock(session, match[1], row, i);
-            return session.getCommentFoldRange(row, i, -1);
-        }
-    };
-    this.getSectionRange = function (session, row) {
-        var line = session.getLine(row);
-        var startIndent = line.search(/\S/);
-        var startRow = row;
-        var startColumn = line.length;
-        row = row + 1;
-        var endRow = row;
-        var maxRow = session.getLength();
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var indent = line.search(/\S/);
-            if (indent === -1)
-                continue;
-            if (startIndent > indent)
-                break;
-            var subRange = this.getFoldWidgetRange(session, "all", row);
-            if (subRange) {
-                if (subRange.start.row <= startRow) {
-                    break;
-                }
-                else if (subRange.isMultiLine()) {
-                    row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
-                    break;
-                }
-            }
-            endRow = row;
-        }
-        return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
-    };
-    this.getCommentRegionBlock = function (session, line, row) {
-        var startColumn = line.search(/\s*$/);
-        var maxRow = session.getLength();
-        var startRow = row;
-        var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
-        var depth = 1;
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
-        }
-        var endRow = row;
-        if (endRow > startRow) {
-            return new Range(startRow, startColumn, endRow, line.length);
-        }
-    };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/prolog",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/prolog_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
-*/
-"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var PrologHighlightRules = require("./prolog_highlight_rules").PrologHighlightRules;
-var FoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
-    this.HighlightRules = PrologHighlightRules;
-    this.foldingRules = new FoldMode();
-    this.$behaviour = this.$defaultBehaviour;
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.lineCommentStart = "%";
-    this.blockComment = { start: "/*", end: "*/" };
-    this.$id = "ace/mode/prolog";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});                (function() {
-                    ace.require(["ace/mode/prolog"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 168 - 0
web/2dea096a03cd8f864db5f06e9f0113e5.js

@@ -0,0 +1,168 @@
+ace.define("ace/mode/gherkin_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var stringEscape =  "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";
+
+var GherkinHighlightRules = function() {
+    var languages = [{
+        name: "en",
+        labels: "Feature|Background|Scenario(?: Outline)?|Examples",
+        keywords: "Given|When|Then|And|But"
+    }];
+    
+    var labels = languages.map(function(l) {
+        return l.labels;
+    }).join("|");
+    var keywords = languages.map(function(l) {
+        return l.keywords;
+    }).join("|");
+    this.$rules = {
+        start : [{
+            token: "constant.numeric",
+            regex: "(?:(?:[1-9]\\d*)|(?:0))"
+        }, {
+            token : "comment",
+            regex : "#.*$"
+        }, {
+            token : "keyword",
+            regex : "(?:" + labels + "):|(?:" + keywords + ")\\b"
+        }, {
+            token : "keyword",
+            regex : "\\*"
+        }, {
+            token : "string",           // multi line """ string start
+            regex : '"{3}',
+            next : "qqstring3"
+        }, {
+            token : "string",           // " string
+            regex : '"',
+            next : "qqstring"
+        }, {
+            token : "text",
+            regex : "^\\s*(?=@[\\w])",
+            next : [{
+                token : "text",
+                regex : "\\s+"
+            }, {
+                token : "variable.parameter",
+                regex : "@[\\w]+"
+            }, {
+                token : "empty",
+                regex : "",
+                next : "start"
+            }]
+        }, {
+            token : "comment",
+            regex : "<[^>]+>"
+        }, {
+            token : "comment",
+            regex : "\\|(?=.)",
+            next : "table-item"
+        }, {
+            token : "comment",
+            regex : "\\|$",
+            next : "start"
+        }],
+        "qqstring3" : [ {
+            token : "constant.language.escape",
+            regex : stringEscape
+        }, {
+            token : "string", // multi line """ string end
+            regex : '"{3}',
+            next : "start"
+        }, {
+            defaultToken : "string"
+        }],
+        "qqstring" : [{
+            token : "constant.language.escape",
+            regex : stringEscape
+        }, {
+            token : "string",
+            regex : "\\\\$",
+            next  : "qqstring"
+        }, {
+            token : "string",
+            regex : '"|$',
+            next  : "start"
+        }, {
+            defaultToken: "string"
+        }],
+        "table-item" : [{
+            token : "comment",
+            regex : /$/,
+            next : "start"
+        }, {
+            token : "comment",
+            regex : /\|/
+        }, {
+            token : "string",
+            regex : /\\./
+        }, {
+            defaultToken : "string"
+        }]
+    };
+    this.normalizeRules();
+};
+
+oop.inherits(GherkinHighlightRules, TextHighlightRules);
+
+exports.GherkinHighlightRules = GherkinHighlightRules;
+});
+
+ace.define("ace/mode/gherkin",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gherkin_highlight_rules"], function(require, exports, module) {
+
+var oop = require("../lib/oop");
+var TextMode = require("./text").Mode;
+var GherkinHighlightRules = require("./gherkin_highlight_rules").GherkinHighlightRules;
+
+var Mode = function() {
+    this.HighlightRules = GherkinHighlightRules;
+    this.$behaviour = this.$defaultBehaviour;
+};
+oop.inherits(Mode, TextMode);
+
+(function() {
+    this.lineCommentStart = "#";
+    this.$id = "ace/mode/gherkin";
+
+    this.getNextLineIndent = function(state, line, tab) {
+        var indent = this.$getIndent(line);
+        var space2 = "  ";
+
+        var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
+        var tokens = tokenizedLine.tokens;
+        
+        if(line.match("[ ]*\\|")) {
+            indent += "| ";
+        }
+
+        if (tokens.length && tokens[tokens.length-1].type == "comment") {
+            return indent;
+        }
+        
+
+        if (state == "start") {
+            if (line.match("Scenario:|Feature:|Scenario Outline:|Background:")) {
+                indent += space2;
+            } else if(line.match("(Given|Then).+(:)$|Examples:")) {
+                indent += space2;
+            } else if(line.match("\\*.+")) {
+                indent += "* ";
+            } 
+        }
+        
+
+        return indent;
+    };
+}).call(Mode.prototype);
+
+exports.Mode = Mode;
+});                (function() {
+                    ace.require(["ace/mode/gherkin"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

文件差异内容过多而无法显示
+ 0 - 4
web/2f5ea84ffbac21b3f98fccc2352300e4.js


文件差异内容过多而无法显示
+ 0 - 0
web/2f689ca91158f918e23ce27c7abbcf25.js


文件差异内容过多而无法显示
+ 0 - 0
web/2f6dcc38e5ad378438bea99c47e20e28.js


+ 137 - 0
web/2f6f1f6753d430190cb38411a9112f08.js

@@ -0,0 +1,137 @@
+ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
+"use strict";
+
+exports.isDark = false;
+exports.cssClass = "ace-tm";
+exports.cssText = ".ace-tm .ace_gutter {\
+background: #f0f0f0;\
+color: #333;\
+}\
+.ace-tm .ace_print-margin {\
+width: 1px;\
+background: #e8e8e8;\
+}\
+.ace-tm .ace_fold {\
+background-color: #6B72E6;\
+}\
+.ace-tm {\
+background-color: #FFFFFF;\
+color: black;\
+}\
+.ace-tm .ace_cursor {\
+color: black;\
+}\
+.ace-tm .ace_invisible {\
+color: rgb(191, 191, 191);\
+}\
+.ace-tm .ace_storage,\
+.ace-tm .ace_keyword {\
+color: blue;\
+}\
+.ace-tm .ace_constant {\
+color: rgb(197, 6, 11);\
+}\
+.ace-tm .ace_constant.ace_buildin {\
+color: rgb(88, 72, 246);\
+}\
+.ace-tm .ace_constant.ace_language {\
+color: rgb(88, 92, 246);\
+}\
+.ace-tm .ace_constant.ace_library {\
+color: rgb(6, 150, 14);\
+}\
+.ace-tm .ace_invalid {\
+background-color: rgba(255, 0, 0, 0.1);\
+color: red;\
+}\
+.ace-tm .ace_support.ace_function {\
+color: rgb(60, 76, 114);\
+}\
+.ace-tm .ace_support.ace_constant {\
+color: rgb(6, 150, 14);\
+}\
+.ace-tm .ace_support.ace_type,\
+.ace-tm .ace_support.ace_class {\
+color: rgb(109, 121, 222);\
+}\
+.ace-tm .ace_keyword.ace_operator {\
+color: rgb(104, 118, 135);\
+}\
+.ace-tm .ace_string {\
+color: rgb(3, 106, 7);\
+}\
+.ace-tm .ace_comment {\
+color: rgb(76, 136, 107);\
+}\
+.ace-tm .ace_comment.ace_doc {\
+color: rgb(0, 102, 255);\
+}\
+.ace-tm .ace_comment.ace_doc.ace_tag {\
+color: rgb(128, 159, 191);\
+}\
+.ace-tm .ace_constant.ace_numeric {\
+color: rgb(0, 0, 205);\
+}\
+.ace-tm .ace_variable {\
+color: rgb(49, 132, 149);\
+}\
+.ace-tm .ace_xml-pe {\
+color: rgb(104, 104, 91);\
+}\
+.ace-tm .ace_entity.ace_name.ace_function {\
+color: #0000A2;\
+}\
+.ace-tm .ace_heading {\
+color: rgb(12, 7, 255);\
+}\
+.ace-tm .ace_list {\
+color:rgb(185, 6, 144);\
+}\
+.ace-tm .ace_meta.ace_tag {\
+color:rgb(0, 22, 142);\
+}\
+.ace-tm .ace_string.ace_regex {\
+color: rgb(255, 0, 0)\
+}\
+.ace-tm .ace_marker-layer .ace_selection {\
+background: rgb(181, 213, 255);\
+}\
+.ace-tm.ace_multiselect .ace_selection.ace_start {\
+box-shadow: 0 0 3px 0px white;\
+}\
+.ace-tm .ace_marker-layer .ace_step {\
+background: rgb(252, 255, 0);\
+}\
+.ace-tm .ace_marker-layer .ace_stack {\
+background: rgb(164, 229, 101);\
+}\
+.ace-tm .ace_marker-layer .ace_bracket {\
+margin: -1px 0 0 -1px;\
+border: 1px solid rgb(192, 192, 192);\
+}\
+.ace-tm .ace_marker-layer .ace_active-line {\
+background: rgba(0, 0, 0, 0.07);\
+}\
+.ace-tm .ace_gutter-active-line {\
+background-color : #dcdcdc;\
+}\
+.ace-tm .ace_marker-layer .ace_selected-word {\
+background: rgb(250, 250, 255);\
+border: 1px solid rgb(200, 200, 250);\
+}\
+.ace-tm .ace_indent-guide {\
+background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
+}\
+";
+exports.$id = "ace/theme/textmate";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});                (function() {
+                    ace.require(["ace/theme/textmate"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

文件差异内容过多而无法显示
+ 0 - 0
web/2f985fd2d1b0603c0cd825f7e9b4218d.js


文件差异内容过多而无法显示
+ 375 - 294
web/2fe13737434324ed67582ac97d484c54.js


+ 172 - 0
web/30314e1b4a51b1aed3766eadecde2a42.js

@@ -0,0 +1,172 @@
+ace.define("ace/snippets/python",["require","exports","module"], function(require, exports, module) {
+"use strict";
+
+exports.snippetText = "snippet #!\n\
+	#!/usr/bin/env python\n\
+snippet imp\n\
+	import ${1:module}\n\
+snippet from\n\
+	from ${1:package} import ${2:module}\n\
+# Module Docstring\n\
+snippet docs\n\
+	'''\n\
+	File: ${1:FILENAME:file_name}\n\
+	Author: ${2:author}\n\
+	Description: ${3}\n\
+	'''\n\
+snippet wh\n\
+	while ${1:condition}:\n\
+		${2:# TODO: write code...}\n\
+# dowh - does the same as do...while in other languages\n\
+snippet dowh\n\
+	while True:\n\
+		${1:# TODO: write code...}\n\
+		if ${2:condition}:\n\
+			break\n\
+snippet with\n\
+	with ${1:expr} as ${2:var}:\n\
+		${3:# TODO: write code...}\n\
+# New Class\n\
+snippet cl\n\
+	class ${1:ClassName}(${2:object}):\n\
+		\"\"\"${3:docstring for $1}\"\"\"\n\
+		def __init__(self, ${4:arg}):\n\
+			${5:super($1, self).__init__()}\n\
+			self.$4 = $4\n\
+			${6}\n\
+# New Function\n\
+snippet def\n\
+	def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):\n\
+		\"\"\"${3:docstring for $1}\"\"\"\n\
+		${4:# TODO: write code...}\n\
+snippet deff\n\
+	def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):\n\
+		${3:# TODO: write code...}\n\
+# New Method\n\
+snippet defs\n\
+	def ${1:mname}(self, ${2:arg}):\n\
+		${3:# TODO: write code...}\n\
+# New Property\n\
+snippet property\n\
+	def ${1:foo}():\n\
+		doc = \"${2:The $1 property.}\"\n\
+		def fget(self):\n\
+			${3:return self._$1}\n\
+		def fset(self, value):\n\
+			${4:self._$1 = value}\n\
+# Ifs\n\
+snippet if\n\
+	if ${1:condition}:\n\
+		${2:# TODO: write code...}\n\
+snippet el\n\
+	else:\n\
+		${1:# TODO: write code...}\n\
+snippet ei\n\
+	elif ${1:condition}:\n\
+		${2:# TODO: write code...}\n\
+# For\n\
+snippet for\n\
+	for ${1:item} in ${2:items}:\n\
+		${3:# TODO: write code...}\n\
+# Encodes\n\
+snippet cutf8\n\
+	# -*- coding: utf-8 -*-\n\
+snippet clatin1\n\
+	# -*- coding: latin-1 -*-\n\
+snippet cascii\n\
+	# -*- coding: ascii -*-\n\
+# Lambda\n\
+snippet ld\n\
+	${1:var} = lambda ${2:vars} : ${3:action}\n\
+snippet .\n\
+	self.\n\
+snippet try Try/Except\n\
+	try:\n\
+		${1:# TODO: write code...}\n\
+	except ${2:Exception}, ${3:e}:\n\
+		${4:raise $3}\n\
+snippet try Try/Except/Else\n\
+	try:\n\
+		${1:# TODO: write code...}\n\
+	except ${2:Exception}, ${3:e}:\n\
+		${4:raise $3}\n\
+	else:\n\
+		${5:# TODO: write code...}\n\
+snippet try Try/Except/Finally\n\
+	try:\n\
+		${1:# TODO: write code...}\n\
+	except ${2:Exception}, ${3:e}:\n\
+		${4:raise $3}\n\
+	finally:\n\
+		${5:# TODO: write code...}\n\
+snippet try Try/Except/Else/Finally\n\
+	try:\n\
+		${1:# TODO: write code...}\n\
+	except ${2:Exception}, ${3:e}:\n\
+		${4:raise $3}\n\
+	else:\n\
+		${5:# TODO: write code...}\n\
+	finally:\n\
+		${6:# TODO: write code...}\n\
+# if __name__ == '__main__':\n\
+snippet ifmain\n\
+	if __name__ == '__main__':\n\
+		${1:main()}\n\
+# __magic__\n\
+snippet _\n\
+	__${1:init}__${2}\n\
+# python debugger (pdb)\n\
+snippet pdb\n\
+	import pdb; pdb.set_trace()\n\
+# ipython debugger (ipdb)\n\
+snippet ipdb\n\
+	import ipdb; ipdb.set_trace()\n\
+# ipython debugger (pdbbb)\n\
+snippet pdbbb\n\
+	import pdbpp; pdbpp.set_trace()\n\
+snippet pprint\n\
+	import pprint; pprint.pprint(${1})${2}\n\
+snippet \"\n\
+	\"\"\"\n\
+	${1:doc}\n\
+	\"\"\"\n\
+# test function/method\n\
+snippet test\n\
+	def test_${1:description}(${2:self}):\n\
+		${3:# TODO: write code...}\n\
+# test case\n\
+snippet testcase\n\
+	class ${1:ExampleCase}(unittest.TestCase):\n\
+		\n\
+		def test_${2:description}(self):\n\
+			${3:# TODO: write code...}\n\
+snippet fut\n\
+	from __future__ import ${1}\n\
+#getopt\n\
+snippet getopt\n\
+	try:\n\
+		# Short option syntax: \"hv:\"\n\
+		# Long option syntax: \"help\" or \"verbose=\"\n\
+		opts, args = getopt.getopt(sys.argv[1:], \"${1:short_options}\", [${2:long_options}])\n\
+	\n\
+	except getopt.GetoptError, err:\n\
+		# Print debug info\n\
+		print str(err)\n\
+		${3:error_action}\n\
+\n\
+	for option, argument in opts:\n\
+		if option in (\"-h\", \"--help\"):\n\
+			${4}\n\
+		elif option in (\"-v\", \"--verbose\"):\n\
+			verbose = argument\n\
+";
+exports.scope = "python";
+
+});                (function() {
+                    ace.require(["ace/snippets/python"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

+ 185 - 122
web/a77f254bc934c3d69dd51902da56f6f1.js → web/3045404d52d03253c81822bdf760cfd1.js

@@ -1,109 +1,121 @@
-ace.define("ace/mode/perl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
+ace.define("ace/mode/perl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var PerlHighlightRules = function () {
-    var keywords = ("base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|" +
-        "no|package|parent|redo|require|scalar|sub|unless|until|while|use|vars");
+
+var PerlHighlightRules = function() {
+
+    var keywords = (
+        "base|constant|continue|else|elsif|for|foreach|format|goto|if|last|local|my|next|" +
+         "no|package|parent|redo|require|scalar|sub|unless|until|while|use|vars"
+    );
+
     var buildinConstants = ("ARGV|ENV|INC|SIG");
-    var builtinFunctions = ("getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|" +
-        "gethostbyname|getservbyport|getnetbyaddr|getnetbyname|getsockname|" +
-        "getpeername|setpriority|getprotoent|setprotoent|getpriority|" +
-        "endprotoent|getservent|setservent|endservent|sethostent|socketpair|" +
-        "getsockopt|gethostent|endhostent|setsockopt|setnetent|quotemeta|" +
-        "localtime|prototype|getnetent|endnetent|rewinddir|wantarray|getpwuid|" +
-        "closedir|getlogin|readlink|endgrent|getgrgid|getgrnam|shmwrite|" +
-        "shutdown|readline|endpwent|setgrent|readpipe|formline|truncate|" +
-        "dbmclose|syswrite|setpwent|getpwnam|getgrent|getpwent|ucfirst|sysread|" +
-        "setpgrp|shmread|sysseek|sysopen|telldir|defined|opendir|connect|" +
-        "lcfirst|getppid|binmode|syscall|sprintf|getpgrp|readdir|seekdir|" +
-        "waitpid|reverse|unshift|symlink|dbmopen|semget|msgrcv|rename|listen|" +
-        "chroot|msgsnd|shmctl|accept|unpack|exists|fileno|shmget|system|" +
-        "unlink|printf|gmtime|msgctl|semctl|values|rindex|substr|splice|" +
-        "length|msgget|select|socket|return|caller|delete|alarm|ioctl|index|" +
-        "undef|lstat|times|srand|chown|fcntl|close|write|umask|rmdir|study|" +
-        "sleep|chomp|untie|print|utime|mkdir|atan2|split|crypt|flock|chmod|" +
-        "BEGIN|bless|chdir|semop|shift|reset|link|stat|chop|grep|fork|dump|" +
-        "join|open|tell|pipe|exit|glob|warn|each|bind|sort|pack|eval|push|" +
-        "keys|getc|kill|seek|sqrt|send|wait|rand|tied|read|time|exec|recv|" +
-        "eof|chr|int|ord|exp|pos|pop|sin|log|abs|oct|hex|tie|cos|vec|END|ref|" +
-        "map|die|uc|lc|do");
+
+    var builtinFunctions = (
+        "getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|" +
+         "gethostbyname|getservbyport|getnetbyaddr|getnetbyname|getsockname|" +
+         "getpeername|setpriority|getprotoent|setprotoent|getpriority|" +
+         "endprotoent|getservent|setservent|endservent|sethostent|socketpair|" +
+         "getsockopt|gethostent|endhostent|setsockopt|setnetent|quotemeta|" +
+         "localtime|prototype|getnetent|endnetent|rewinddir|wantarray|getpwuid|" +
+         "closedir|getlogin|readlink|endgrent|getgrgid|getgrnam|shmwrite|" +
+         "shutdown|readline|endpwent|setgrent|readpipe|formline|truncate|" +
+         "dbmclose|syswrite|setpwent|getpwnam|getgrent|getpwent|ucfirst|sysread|" +
+         "setpgrp|shmread|sysseek|sysopen|telldir|defined|opendir|connect|" +
+         "lcfirst|getppid|binmode|syscall|sprintf|getpgrp|readdir|seekdir|" +
+         "waitpid|reverse|unshift|symlink|dbmopen|semget|msgrcv|rename|listen|" +
+         "chroot|msgsnd|shmctl|accept|unpack|exists|fileno|shmget|system|" +
+         "unlink|printf|gmtime|msgctl|semctl|values|rindex|substr|splice|" +
+         "length|msgget|select|socket|return|caller|delete|alarm|ioctl|index|" +
+         "undef|lstat|times|srand|chown|fcntl|close|write|umask|rmdir|study|" +
+         "sleep|chomp|untie|print|utime|mkdir|atan2|split|crypt|flock|chmod|" +
+         "BEGIN|bless|chdir|semop|shift|reset|link|stat|chop|grep|fork|dump|" +
+         "join|open|tell|pipe|exit|glob|warn|each|bind|sort|pack|eval|push|" +
+         "keys|getc|kill|seek|sqrt|send|wait|rand|tied|read|time|exec|recv|" +
+         "eof|chr|int|ord|exp|pos|pop|sin|log|abs|oct|hex|tie|cos|vec|END|ref|" +
+         "map|die|uc|lc|do"
+    );
+
     var keywordMapper = this.createKeywordMapper({
         "keyword": keywords,
         "constant.language": buildinConstants,
         "support.function": builtinFunctions
     }, "identifier");
+
     this.$rules = {
-        "start": [
+        "start" : [
             {
-                token: "comment.doc",
-                regex: "^=(?:begin|item)\\b",
-                next: "block_comment"
+                token : "comment.doc",
+                regex : "^=(?:begin|item)\\b",
+                next : "block_comment"
             }, {
-                token: "string.regexp",
-                regex: "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
+                token : "string.regexp",
+                regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
             }, {
-                token: "string",
-                regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+                token : "string", // single line
+                regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
             }, {
-                token: "string",
-                regex: '["].*\\\\$',
-                next: "qqstring"
+                token : "string", // multi line string start
+                regex : '["].*\\\\$',
+                next : "qqstring"
             }, {
-                token: "string",
-                regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+                token : "string", // single line
+                regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
             }, {
-                token: "string",
-                regex: "['].*\\\\$",
-                next: "qstring"
+                token : "string", // multi line string start
+                regex : "['].*\\\\$",
+                next : "qstring"
             }, {
-                token: "constant.numeric",
-                regex: "0x[0-9a-fA-F]+\\b"
+                token : "constant.numeric", // hex
+                regex : "0x[0-9a-fA-F]+\\b"
             }, {
-                token: "constant.numeric",
-                regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+                token : "constant.numeric", // float
+                regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
             }, {
-                token: keywordMapper,
-                regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+                token : keywordMapper,
+                regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
             }, {
-                token: "keyword.operator",
-                regex: "%#|\\$#|\\.\\.\\.|\\|\\|=|>>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)"
+                token : "keyword.operator",
+                regex : "%#|\\$#|\\.\\.\\.|\\|\\|=|>>=|<<=|<=>|&&=|=>|!~|\\^=|&=|\\|=|\\.=|x=|%=|\\/=|\\*=|\\-=|\\+=|=~|\\*\\*|\\-\\-|\\.\\.|\\|\\||&&|\\+\\+|\\->|!=|==|>=|<=|>>|<<|,|=|\\?\\:|\\^|\\||x|%|\\/|\\*|<|&|\\\\|~|!|>|\\.|\\-|\\+|\\-C|\\-b|\\-S|\\-u|\\-t|\\-p|\\-l|\\-d|\\-f|\\-g|\\-s|\\-z|\\-k|\\-e|\\-O|\\-T|\\-B|\\-M|\\-A|\\-X|\\-W|\\-c|\\-R|\\-o|\\-x|\\-w|\\-r|\\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)"
             }, {
-                token: "comment",
-                regex: "#.*$"
+                token : "comment",
+                regex : "#.*$"
             }, {
-                token: "lparen",
-                regex: "[[({]"
+                token : "lparen",
+                regex : "[[({]"
             }, {
-                token: "rparen",
-                regex: "[\\])}]"
+                token : "rparen",
+                regex : "[\\])}]"
             }, {
-                token: "text",
-                regex: "\\s+"
+                token : "text",
+                regex : "\\s+"
             }
         ],
-        "qqstring": [
+        "qqstring" : [
             {
-                token: "string",
-                regex: '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
-                next: "start"
+                token : "string",
+                regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
+                next : "start"
             }, {
-                token: "string",
-                regex: '.+'
+                token : "string",
+                regex : '.+'
             }
         ],
-        "qstring": [
+        "qstring" : [
             {
-                token: "string",
-                regex: "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
-                next: "start"
+                token : "string",
+                regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
+                next : "start"
             }, {
-                token: "string",
-                regex: '.+'
+                token : "string",
+                regex : '.+'
             }
         ],
         "block_comment": [
             {
-                token: "comment.doc",
+                token: "comment.doc", 
                 regex: "^=cut\\b",
                 next: "start"
             },
@@ -113,99 +125,135 @@ var PerlHighlightRules = function () {
         ]
     };
 };
+
 oop.inherits(PerlHighlightRules, TextHighlightRules);
-exports.PerlHighlightRules = PerlHighlightRules;
 
+exports.PerlHighlightRules = PerlHighlightRules;
 });
 
-ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
+ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
+"use strict";
+
 var Range = require("../range").Range;
-var MatchingBraceOutdent = function () { };
-(function () {
-    this.checkOutdent = function (line, input) {
-        if (!/^\s+$/.test(line))
+
+var MatchingBraceOutdent = function() {};
+
+(function() {
+
+    this.checkOutdent = function(line, input) {
+        if (! /^\s+$/.test(line))
             return false;
+
         return /^\s*\}/.test(input);
     };
-    this.autoOutdent = function (doc, row) {
+
+    this.autoOutdent = function(doc, row) {
         var line = doc.getLine(row);
         var match = line.match(/^(\s*\})/);
-        if (!match)
-            return 0;
+
+        if (!match) return 0;
+
         var column = match[1].length;
-        var openBracePos = doc.findMatchingBracket({ row: row, column: column });
-        if (!openBracePos || openBracePos.row == row)
-            return 0;
+        var openBracePos = doc.findMatchingBracket({row: row, column: column});
+
+        if (!openBracePos || openBracePos.row == row) return 0;
+
         var indent = this.$getIndent(doc.getLine(openBracePos.row));
-        doc.replace(new Range(row, 0, row, column - 1), indent);
+        doc.replace(new Range(row, 0, row, column-1), indent);
     };
-    this.$getIndent = function (line) {
+
+    this.$getIndent = function(line) {
         return line.match(/^\s*/)[0];
     };
+
 }).call(MatchingBraceOutdent.prototype);
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
 
+exports.MatchingBraceOutdent = MatchingBraceOutdent;
 });
 
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
+ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../../lib/oop");
 var Range = require("../../range").Range;
 var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
+
+var FoldMode = exports.FoldMode = function(commentRegex) {
     if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
+        this.foldingStartMarker = new RegExp(
+            this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
+        );
+        this.foldingStopMarker = new RegExp(
+            this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
+        );
     }
 };
 oop.inherits(FoldMode, BaseFoldMode);
-(function () {
+
+(function() {
+    
     this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
     this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
+    this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
     this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
     this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
     this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
+    this.getFoldWidget = function(session, foldStyle, row) {
         var line = session.getLine(row);
+    
         if (this.singleLineBlockCommentRe.test(line)) {
             if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
                 return "";
         }
+    
         var fw = this._getFoldWidgetBase(session, foldStyle, row);
+    
         if (!fw && this.startRegionRe.test(line))
             return "start"; // lineCommentRegionStart
+    
         return fw;
     };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
+
+    this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
         var line = session.getLine(row);
+        
         if (this.startRegionRe.test(line))
             return this.getCommentRegionBlock(session, line, row);
+        
         var match = line.match(this.foldingStartMarker);
         if (match) {
             var i = match.index;
+
             if (match[1])
                 return this.openingBracketBlock(session, match[1], row, i);
+                
             var range = session.getCommentFoldRange(row, i + match[0].length, 1);
+            
             if (range && !range.isMultiLine()) {
                 if (forceMultiline) {
                     range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
+                } else if (foldStyle != "all")
                     range = null;
             }
+            
             return range;
         }
+
         if (foldStyle === "markbegin")
             return;
+
         var match = line.match(this.foldingStopMarker);
         if (match) {
             var i = match.index + match[0].length;
+
             if (match[1])
                 return this.closingBracketBlock(session, match[1], row, i);
+
             return session.getCommentFoldRange(row, i, -1);
         }
     };
-    this.getSectionRange = function (session, row) {
+    
+    this.getSectionRange = function(session, row) {
         var line = session.getLine(row);
         var startIndent = line.search(/\S/);
         var startRow = row;
@@ -218,96 +266,111 @@ oop.inherits(FoldMode, BaseFoldMode);
             var indent = line.search(/\S/);
             if (indent === -1)
                 continue;
-            if (startIndent > indent)
+            if  (startIndent > indent)
                 break;
             var subRange = this.getFoldWidgetRange(session, "all", row);
+            
             if (subRange) {
                 if (subRange.start.row <= startRow) {
                     break;
-                }
-                else if (subRange.isMultiLine()) {
+                } else if (subRange.isMultiLine()) {
                     row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
+                } else if (startIndent == indent) {
                     break;
                 }
             }
             endRow = row;
         }
+        
         return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
     };
-    this.getCommentRegionBlock = function (session, line, row) {
+    this.getCommentRegionBlock = function(session, line, row) {
         var startColumn = line.search(/\s*$/);
         var maxRow = session.getLength();
         var startRow = row;
+        
         var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
         var depth = 1;
         while (++row < maxRow) {
             line = session.getLine(row);
             var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
+            if (!m) continue;
+            if (m[1]) depth--;
+            else depth++;
+
+            if (!depth) break;
         }
+
         var endRow = row;
         if (endRow > startRow) {
             return new Range(startRow, startColumn, endRow, line.length);
         }
     };
+
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/perl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/perl_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
+ace.define("ace/mode/perl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/perl_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/cstyle"], function(require, exports, module) {
+"use strict";
+
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var PerlHighlightRules = require("./perl_highlight_rules").PerlHighlightRules;
 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
+
+var Mode = function() {
     this.HighlightRules = PerlHighlightRules;
+    
     this.$outdent = new MatchingBraceOutdent();
-    this.foldingRules = new CStyleFoldMode({ start: "^=(begin|item)\\b", end: "^=(cut)\\b" });
+    this.foldingRules = new CStyleFoldMode({start: "^=(begin|item)\\b", end: "^=(cut)\\b"});
     this.$behaviour = this.$defaultBehaviour;
 };
 oop.inherits(Mode, TextMode);
-(function () {
+
+(function() {
+
     this.lineCommentStart = "#";
     this.blockComment = [
-        { start: "=begin", end: "=cut", lineStartOnly: true },
-        { start: "=item", end: "=cut", lineStartOnly: true }
+        {start: "=begin", end: "=cut", lineStartOnly: true},
+        {start: "=item", end: "=cut", lineStartOnly: true}
     ];
-    this.getNextLineIndent = function (state, line, tab) {
+
+
+    this.getNextLineIndent = function(state, line, tab) {
         var indent = this.$getIndent(line);
+
         var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
         var tokens = tokenizedLine.tokens;
-        if (tokens.length && tokens[tokens.length - 1].type == "comment") {
+
+        if (tokens.length && tokens[tokens.length-1].type == "comment") {
             return indent;
         }
+
         if (state == "start") {
             var match = line.match(/^.*[\{\(\[:]\s*$/);
             if (match) {
                 indent += tab;
             }
         }
+
         return indent;
     };
-    this.checkOutdent = function (state, line, input) {
+
+    this.checkOutdent = function(state, line, input) {
         return this.$outdent.checkOutdent(line, input);
     };
-    this.autoOutdent = function (state, doc, row) {
+
+    this.autoOutdent = function(state, doc, row) {
         this.$outdent.autoOutdent(doc, row);
     };
+
     this.$id = "ace/mode/perl";
     this.snippetFileId = "ace/snippets/perl";
 }).call(Mode.prototype);
-exports.Mode = Mode;
 
+exports.Mode = Mode;
 });                (function() {
                     ace.require(["ace/mode/perl"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 103 - 0
web/30f5b57295dfda4eafc7f8c098160582.js

@@ -0,0 +1,103 @@
+ace.define("ace/theme/merbivore_soft",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
+
+exports.isDark = true;
+exports.cssClass = "ace-merbivore-soft";
+exports.cssText = ".ace-merbivore-soft .ace_gutter {\
+background: #262424;\
+color: #E6E1DC\
+}\
+.ace-merbivore-soft .ace_print-margin {\
+width: 1px;\
+background: #262424\
+}\
+.ace-merbivore-soft {\
+background-color: #1C1C1C;\
+color: #E6E1DC\
+}\
+.ace-merbivore-soft .ace_cursor {\
+color: #FFFFFF\
+}\
+.ace-merbivore-soft .ace_marker-layer .ace_selection {\
+background: #494949\
+}\
+.ace-merbivore-soft.ace_multiselect .ace_selection.ace_start {\
+box-shadow: 0 0 3px 0px #1C1C1C;\
+}\
+.ace-merbivore-soft .ace_marker-layer .ace_step {\
+background: rgb(102, 82, 0)\
+}\
+.ace-merbivore-soft .ace_marker-layer .ace_bracket {\
+margin: -1px 0 0 -1px;\
+border: 1px solid #404040\
+}\
+.ace-merbivore-soft .ace_marker-layer .ace_active-line {\
+background: #333435\
+}\
+.ace-merbivore-soft .ace_gutter-active-line {\
+background-color: #333435\
+}\
+.ace-merbivore-soft .ace_marker-layer .ace_selected-word {\
+border: 1px solid #494949\
+}\
+.ace-merbivore-soft .ace_invisible {\
+color: #404040\
+}\
+.ace-merbivore-soft .ace_entity.ace_name.ace_tag,\
+.ace-merbivore-soft .ace_keyword,\
+.ace-merbivore-soft .ace_meta,\
+.ace-merbivore-soft .ace_meta.ace_tag,\
+.ace-merbivore-soft .ace_storage {\
+color: #FC803A\
+}\
+.ace-merbivore-soft .ace_constant,\
+.ace-merbivore-soft .ace_constant.ace_character,\
+.ace-merbivore-soft .ace_constant.ace_character.ace_escape,\
+.ace-merbivore-soft .ace_constant.ace_other,\
+.ace-merbivore-soft .ace_support.ace_type {\
+color: #68C1D8\
+}\
+.ace-merbivore-soft .ace_constant.ace_character.ace_escape {\
+color: #B3E5B4\
+}\
+.ace-merbivore-soft .ace_constant.ace_language {\
+color: #E1C582\
+}\
+.ace-merbivore-soft .ace_constant.ace_library,\
+.ace-merbivore-soft .ace_string,\
+.ace-merbivore-soft .ace_support.ace_constant {\
+color: #8EC65F\
+}\
+.ace-merbivore-soft .ace_constant.ace_numeric {\
+color: #7FC578\
+}\
+.ace-merbivore-soft .ace_invalid,\
+.ace-merbivore-soft .ace_invalid.ace_deprecated {\
+color: #FFFFFF;\
+background-color: #FE3838\
+}\
+.ace-merbivore-soft .ace_fold {\
+background-color: #FC803A;\
+border-color: #E6E1DC\
+}\
+.ace-merbivore-soft .ace_comment,\
+.ace-merbivore-soft .ace_meta {\
+font-style: italic;\
+color: #AC4BB8\
+}\
+.ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name {\
+color: #EAF1A3\
+}\
+.ace-merbivore-soft .ace_indent-guide {\
+background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQkpLyZfD09PwPAAfYAnaStpHRAAAAAElFTkSuQmCC) right repeat-y\
+}";
+
+var dom = require("../lib/dom");
+dom.importCssString(exports.cssText, exports.cssClass);
+});                (function() {
+                    ace.require(["ace/theme/merbivore_soft"], function(m) {
+                        if (typeof module == "object" && typeof exports == "object" && module) {
+                            module.exports = m;
+                        }
+                    });
+                })();
+            

文件差异内容过多而无法显示
+ 0 - 0
web/30fc7b3a9d721379c231908210e3530d.js


文件差异内容过多而无法显示
+ 0 - 6
web/321d98b6707ed20d34818a7533713433.js


文件差异内容过多而无法显示
+ 0 - 11
web/34eb9d98392182a042fa67206fd33187.js


+ 0 - 254
web/34f52a56877a14fbb7e9d37469ebbf15.js

@@ -1,254 +0,0 @@
-ace.define("ace/mode/julia_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from https://raw.github.com/JuliaLang/julia/master/contrib/Julia.tmbundle/Syntaxes/Julia.tmLanguage (uuid: ) */
-"use strict";
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var JuliaHighlightRules = function () {
-    this.$rules = { start: [{ include: '#function_decl' },
-            { include: '#function_call' },
-            { include: '#type_decl' },
-            { include: '#keyword' },
-            { include: '#operator' },
-            { include: '#number' },
-            { include: '#string' },
-            { include: '#comment' }],
-        '#bracket': [{ token: 'keyword.bracket.julia',
-                regex: '\\(|\\)|\\[|\\]|\\{|\\}|,' }],
-        '#comment': [{ token: ['punctuation.definition.comment.julia',
-                    'comment.line.number-sign.julia'],
-                regex: '(#)(?!\\{)(.*$)' }],
-        '#function_call': [{ token: ['support.function.julia', 'text'],
-                regex: '([a-zA-Z0-9_]+!?)([\\w\\xff-\\u218e\\u2455-\\uffff]*\\()' }],
-        '#function_decl': [{ token: ['keyword.other.julia', 'meta.function.julia',
-                    'entity.name.function.julia', 'meta.function.julia', 'text'],
-                regex: '(function|macro)(\\s*)([a-zA-Z0-9_\\{]+!?)([\\w\\xff-\\u218e\\u2455-\\uffff]*)([(\\\\{])' }],
-        '#keyword': [{ token: 'keyword.other.julia',
-                regex: '\\b(?:function|type|immutable|macro|quote|abstract|bitstype|typealias|module|baremodule|new)\\b' },
-            { token: 'keyword.control.julia',
-                regex: '\\b(?:if|else|elseif|while|for|in|begin|let|end|do|try|catch|finally|return|break|continue)\\b' },
-            { token: 'storage.modifier.variable.julia',
-                regex: '\\b(?:global|local|const|export|import|importall|using)\\b' },
-            { token: 'variable.macro.julia', regex: '@[\\w\\xff-\\u218e\\u2455-\\uffff]+\\b' }],
-        '#number': [{ token: 'constant.numeric.julia',
-                regex: '\\b0(?:x|X)[0-9a-fA-F]*|(?:\\b[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]*)?(?:im)?|\\bInf(?:32)?\\b|\\bNaN(?:32)?\\b|\\btrue\\b|\\bfalse\\b' }],
-        '#operator': [{ token: 'keyword.operator.update.julia',
-                regex: '=|:=|\\+=|-=|\\*=|/=|//=|\\.//=|\\.\\*=|\\\\=|\\.\\\\=|^=|\\.^=|%=|\\|=|&=|\\$=|<<=|>>=' },
-            { token: 'keyword.operator.ternary.julia', regex: '\\?|:' },
-            { token: 'keyword.operator.boolean.julia',
-                regex: '\\|\\||&&|!' },
-            { token: 'keyword.operator.arrow.julia', regex: '->|<-|-->' },
-            { token: 'keyword.operator.relation.julia',
-                regex: '>|<|>=|<=|==|!=|\\.>|\\.<|\\.>=|\\.>=|\\.==|\\.!=|\\.=|\\.!|<:|:>' },
-            { token: 'keyword.operator.range.julia', regex: ':' },
-            { token: 'keyword.operator.shift.julia', regex: '<<|>>' },
-            { token: 'keyword.operator.bitwise.julia', regex: '\\||\\&|~' },
-            { token: 'keyword.operator.arithmetic.julia',
-                regex: '\\+|-|\\*|\\.\\*|/|\\./|//|\\.//|%|\\.%|\\\\|\\.\\\\|\\^|\\.\\^' },
-            { token: 'keyword.operator.isa.julia', regex: '::' },
-            { token: 'keyword.operator.dots.julia',
-                regex: '\\.(?=[a-zA-Z])|\\.\\.+' },
-            { token: 'keyword.operator.interpolation.julia',
-                regex: '\\$#?(?=.)' },
-            { token: ['variable', 'keyword.operator.transposed-variable.julia'],
-                regex: '([\\w\\xff-\\u218e\\u2455-\\uffff]+)((?:\'|\\.\')*\\.?\')' },
-            { token: 'text',
-                regex: '\\[|\\(' },
-            { token: ['text', 'keyword.operator.transposed-matrix.julia'],
-                regex: "([\\]\\)])((?:'|\\.')*\\.?')" }],
-        '#string': [{ token: 'punctuation.definition.string.begin.julia',
-                regex: '\'',
-                push: [{ token: 'punctuation.definition.string.end.julia',
-                        regex: '\'',
-                        next: 'pop' },
-                    { include: '#string_escaped_char' },
-                    { defaultToken: 'string.quoted.single.julia' }] },
-            { token: 'punctuation.definition.string.begin.julia',
-                regex: '"',
-                push: [{ token: 'punctuation.definition.string.end.julia',
-                        regex: '"',
-                        next: 'pop' },
-                    { include: '#string_escaped_char' },
-                    { defaultToken: 'string.quoted.double.julia' }] },
-            { token: 'punctuation.definition.string.begin.julia',
-                regex: '\\b[\\w\\xff-\\u218e\\u2455-\\uffff]+"',
-                push: [{ token: 'punctuation.definition.string.end.julia',
-                        regex: '"[\\w\\xff-\\u218e\\u2455-\\uffff]*',
-                        next: 'pop' },
-                    { include: '#string_custom_escaped_char' },
-                    { defaultToken: 'string.quoted.custom-double.julia' }] },
-            { token: 'punctuation.definition.string.begin.julia',
-                regex: '`',
-                push: [{ token: 'punctuation.definition.string.end.julia',
-                        regex: '`',
-                        next: 'pop' },
-                    { include: '#string_escaped_char' },
-                    { defaultToken: 'string.quoted.backtick.julia' }] }],
-        '#string_custom_escaped_char': [{ token: 'constant.character.escape.julia', regex: '\\\\"' }],
-        '#string_escaped_char': [{ token: 'constant.character.escape.julia',
-                regex: '\\\\(?:\\\\|[0-3]\\d{,2}|[4-7]\\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8}|.)' }],
-        '#type_decl': [{ token: ['keyword.control.type.julia',
-                    'meta.type.julia',
-                    'entity.name.type.julia',
-                    'entity.other.inherited-class.julia',
-                    'punctuation.separator.inheritance.julia',
-                    'entity.other.inherited-class.julia'],
-                regex: '(type|immutable)(\\s+)([a-zA-Z0-9_]+)(?:(\\s*)(<:)(\\s*[.a-zA-Z0-9_:]+))?' },
-            { token: ['other.typed-variable.julia', 'support.type.julia'],
-                regex: '([a-zA-Z0-9_]+)(::[a-zA-Z0-9_{}]+)' }] };
-    this.normalizeRules();
-};
-JuliaHighlightRules.metaData = { fileTypes: ['jl'],
-    firstLineMatch: '^#!.*\\bjulia\\s*$',
-    foldingStartMarker: '^\\s*(?:if|while|for|begin|function|macro|module|baremodule|type|immutable|let)\\b(?!.*\\bend\\b).*$',
-    foldingStopMarker: '^\\s*(?:end)\\b.*$',
-    name: 'Julia',
-    scopeName: 'source.julia' };
-oop.inherits(JuliaHighlightRules, TextHighlightRules);
-exports.JuliaHighlightRules = JuliaHighlightRules;
-
-});
-
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
-    if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
-    }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
-    this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
-    this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
-    this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
-    this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
-        var line = session.getLine(row);
-        if (this.singleLineBlockCommentRe.test(line)) {
-            if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
-                return "";
-        }
-        var fw = this._getFoldWidgetBase(session, foldStyle, row);
-        if (!fw && this.startRegionRe.test(line))
-            return "start"; // lineCommentRegionStart
-        return fw;
-    };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
-        var line = session.getLine(row);
-        if (this.startRegionRe.test(line))
-            return this.getCommentRegionBlock(session, line, row);
-        var match = line.match(this.foldingStartMarker);
-        if (match) {
-            var i = match.index;
-            if (match[1])
-                return this.openingBracketBlock(session, match[1], row, i);
-            var range = session.getCommentFoldRange(row, i + match[0].length, 1);
-            if (range && !range.isMultiLine()) {
-                if (forceMultiline) {
-                    range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
-                    range = null;
-            }
-            return range;
-        }
-        if (foldStyle === "markbegin")
-            return;
-        var match = line.match(this.foldingStopMarker);
-        if (match) {
-            var i = match.index + match[0].length;
-            if (match[1])
-                return this.closingBracketBlock(session, match[1], row, i);
-            return session.getCommentFoldRange(row, i, -1);
-        }
-    };
-    this.getSectionRange = function (session, row) {
-        var line = session.getLine(row);
-        var startIndent = line.search(/\S/);
-        var startRow = row;
-        var startColumn = line.length;
-        row = row + 1;
-        var endRow = row;
-        var maxRow = session.getLength();
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var indent = line.search(/\S/);
-            if (indent === -1)
-                continue;
-            if (startIndent > indent)
-                break;
-            var subRange = this.getFoldWidgetRange(session, "all", row);
-            if (subRange) {
-                if (subRange.start.row <= startRow) {
-                    break;
-                }
-                else if (subRange.isMultiLine()) {
-                    row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
-                    break;
-                }
-            }
-            endRow = row;
-        }
-        return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
-    };
-    this.getCommentRegionBlock = function (session, line, row) {
-        var startColumn = line.search(/\s*$/);
-        var maxRow = session.getLength();
-        var startRow = row;
-        var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
-        var depth = 1;
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
-        }
-        var endRow = row;
-        if (endRow > startRow) {
-            return new Range(startRow, startColumn, endRow, line.length);
-        }
-    };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/julia",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/julia_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
-  THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
-*/
-"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var JuliaHighlightRules = require("./julia_highlight_rules").JuliaHighlightRules;
-var FoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
-    this.HighlightRules = JuliaHighlightRules;
-    this.foldingRules = new FoldMode();
-    this.$behaviour = this.$defaultBehaviour;
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.lineCommentStart = "#";
-    this.blockComment = "";
-    this.$id = "ace/mode/julia";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});                (function() {
-                    ace.require(["ace/mode/julia"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

文件差异内容过多而无法显示
+ 0 - 4
web/352953d27b4b7ce8dbc7b850a3f2232c.js


+ 0 - 74
web/35b23ae9af47c42f9442c3071d489fb0.js

@@ -1,74 +0,0 @@
-ace.define("ace/mode/gcode_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var GcodeHighlightRules = function () {
-    var keywords = ("IF|DO|WHILE|ENDWHILE|CALL|ENDIF|SUB|ENDSUB|GOTO|REPEAT|ENDREPEAT|CALL");
-    var builtinConstants = ("PI");
-    var builtinFunctions = ("ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN");
-    var keywordMapper = this.createKeywordMapper({
-        "support.function": builtinFunctions,
-        "keyword": keywords,
-        "constant.language": builtinConstants
-    }, "identifier", true);
-    this.$rules = {
-        "start": [{
-                token: "comment",
-                regex: "\\(.*\\)"
-            }, {
-                token: "comment",
-                regex: "([N])([0-9]+)"
-            }, {
-                token: "string",
-                regex: "([G])([0-9]+\\.?[0-9]?)"
-            }, {
-                token: "string",
-                regex: "([M])([0-9]+\\.?[0-9]?)"
-            }, {
-                token: "constant.numeric",
-                regex: "([-+]?([0-9]*\\.?[0-9]+\\.?))|(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)"
-            }, {
-                token: keywordMapper,
-                regex: "[A-Z]"
-            }, {
-                token: "keyword.operator",
-                regex: "EQ|LT|GT|NE|GE|LE|OR|XOR"
-            }, {
-                token: "paren.lparen",
-                regex: "[\\[]"
-            }, {
-                token: "paren.rparen",
-                regex: "[\\]]"
-            }, {
-                token: "text",
-                regex: "\\s+"
-            }]
-    };
-};
-oop.inherits(GcodeHighlightRules, TextHighlightRules);
-exports.GcodeHighlightRules = GcodeHighlightRules;
-
-});
-
-ace.define("ace/mode/gcode",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gcode_highlight_rules","ace/range"], function(require, exports, module){"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var GcodeHighlightRules = require("./gcode_highlight_rules").GcodeHighlightRules;
-var Range = require("../range").Range;
-var Mode = function () {
-    this.HighlightRules = GcodeHighlightRules;
-    this.$behaviour = this.$defaultBehaviour;
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.$id = "ace/mode/gcode";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});                (function() {
-                    ace.require(["ace/mode/gcode"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

+ 0 - 747
web/3799d08c351633c98f6ae5ff08397674.js

@@ -1,747 +0,0 @@
-ace.define("ace/mode/ion_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/*
-  THIS FILE WAS GENERATED BY 'ligand' USING 'mode_highlight_rules.js'
-*/
-"use strict";
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var IonHighlightRules = function () {
-    var k_keywords_bool = "TRUE|FALSE";
-    var k_bool = k_keywords_bool;
-    var k_keywords_null = "NULL.NULL|NULL.BOOL|NULL.INT|NULL.FLOAT|NULL.DECIMAL|NULL.TIMESTAMP|NULL.STRING|NULL.SYMBOL|NULL.BLOB|NULL.CLOB|"
-        + "NULL.STRUCT|NULL.LIST|NULL.SEXP|NULL";
-    var k_null = k_keywords_null;
-    var keywordMapper = this.createKeywordMapper({
-        "constant.language.bool.ion": k_bool,
-        "constant.language.null.ion": k_null
-    }, "constant.other.symbol.identifier.ion", true);
-    var keywordMapperRule = {
-        token: keywordMapper,
-        regex: "\\b\\w+(?:\\.\\w+)?\\b"
-    };
-    this.$rules = {
-        "start": [
-            {
-                "include": "value"
-            }
-        ],
-        "value": [
-            {
-                "include": "whitespace"
-            },
-            {
-                "include": "comment"
-            },
-            {
-                "include": "annotation"
-            },
-            {
-                "include": "string"
-            },
-            {
-                "include": "number"
-            },
-            {
-                "include": "keywords"
-            },
-            {
-                "include": "symbol"
-            },
-            {
-                "include": "clob"
-            },
-            {
-                "include": "blob"
-            },
-            {
-                "include": "struct"
-            },
-            {
-                "include": "list"
-            },
-            {
-                "include": "sexp"
-            }
-        ],
-        "sexp": [
-            {
-                "token": "punctuation.definition.sexp.begin.ion",
-                "regex": "\\(",
-                "push": [
-                    {
-                        "token": "punctuation.definition.sexp.end.ion",
-                        "regex": "\\)",
-                        "next": "pop"
-                    },
-                    {
-                        "include": "comment"
-                    },
-                    {
-                        "include": "value"
-                    },
-                    {
-                        "token": "storage.type.symbol.operator.ion",
-                        "regex": "[\\!\\#\\%\\&\\*\\+\\-\\./\\;\\<\\=\\>\\?\\@\\^\\`\\|\\~]+"
-                    }
-                ]
-            }
-        ],
-        "comment": [
-            {
-                "token": "comment.line.ion",
-                "regex": "//[^\\n]*"
-            },
-            {
-                "token": "comment.block.ion",
-                "regex": "/\\*",
-                "push": [
-                    {
-                        "token": "comment.block.ion",
-                        "regex": "[*]/",
-                        "next": "pop"
-                    },
-                    {
-                        "token": "comment.block.ion",
-                        "regex": "[^*/]+"
-                    },
-                    {
-                        "token": "comment.block.ion",
-                        "regex": "[*/]+"
-                    }
-                ]
-            }
-        ],
-        "list": [
-            {
-                "token": "punctuation.definition.list.begin.ion",
-                "regex": "\\[",
-                "push": [
-                    {
-                        "token": "punctuation.definition.list.end.ion",
-                        "regex": "\\]",
-                        "next": "pop"
-                    },
-                    {
-                        "include": "comment"
-                    },
-                    {
-                        "include": "value"
-                    },
-                    {
-                        "token": "punctuation.definition.list.separator.ion",
-                        "regex": ","
-                    }
-                ]
-            }
-        ],
-        "struct": [
-            {
-                "token": "punctuation.definition.struct.begin.ion",
-                "regex": "\\{",
-                "push": [
-                    {
-                        "token": "punctuation.definition.struct.end.ion",
-                        "regex": "\\}",
-                        "next": "pop"
-                    },
-                    {
-                        "include": "comment"
-                    },
-                    {
-                        "include": "value"
-                    },
-                    {
-                        "token": "punctuation.definition.struct.separator.ion",
-                        "regex": ",|:"
-                    }
-                ]
-            }
-        ],
-        "blob": [
-            {
-                "token": [
-                    "punctuation.definition.blob.begin.ion",
-                    "string.other.blob.ion",
-                    "punctuation.definition.blob.end.ion"
-                ],
-                "regex": "(\\{\\{)([^\"]*)(\\}\\})"
-            }
-        ],
-        "clob": [
-            {
-                "token": [
-                    "punctuation.definition.clob.begin.ion",
-                    "string.other.clob.ion",
-                    "punctuation.definition.clob.end.ion"
-                ],
-                "regex": "(\\{\\{)(\"[^\"]*\")(\\}\\})"
-            }
-        ],
-        "symbol": [
-            {
-                "token": "storage.type.symbol.quoted.ion",
-                "regex": "(['])((?:(?:\\\\')|(?:[^']))*?)(['])"
-            },
-            {
-                "token": "storage.type.symbol.identifier.ion",
-                "regex": "[\\$_a-zA-Z][\\$_a-zA-Z0-9]*"
-            }
-        ],
-        "number": [
-            {
-                "token": "constant.numeric.timestamp.ion",
-                "regex": "\\d{4}(?:-\\d{2})?(?:-\\d{2})?T(?:\\d{2}:\\d{2})(?::\\d{2})?(?:\\.\\d+)?(?:Z|[-+]\\d{2}:\\d{2})?"
-            },
-            {
-                "token": "constant.numeric.timestamp.ion",
-                "regex": "\\d{4}-\\d{2}-\\d{2}T?"
-            },
-            {
-                "token": "constant.numeric.integer.binary.ion",
-                "regex": "-?0[bB][01](?:_?[01])*"
-            },
-            {
-                "token": "constant.numeric.integer.hex.ion",
-                "regex": "-?0[xX][0-9a-fA-F](?:_?[0-9a-fA-F])*"
-            },
-            {
-                "token": "constant.numeric.float.ion",
-                "regex": "-?(?:0|[1-9](?:_?\\d)*)(?:\\.(?:\\d(?:_?\\d)*)?)?(?:[eE][+-]?\\d+)"
-            },
-            {
-                "token": "constant.numeric.float.ion",
-                "regex": "(?:[-+]inf)|(?:nan)"
-            },
-            {
-                "token": "constant.numeric.decimal.ion",
-                "regex": "-?(?:0|[1-9](?:_?\\d)*)(?:(?:(?:\\.(?:\\d(?:_?\\d)*)?)(?:[dD][+-]?\\d+)|\\.(?:\\d(?:_?\\d)*)?)|(?:[dD][+-]?\\d+))"
-            },
-            {
-                "token": "constant.numeric.integer.ion",
-                "regex": "-?(?:0|[1-9](?:_?\\d)*)"
-            }
-        ],
-        "string": [
-            {
-                "token": [
-                    "punctuation.definition.string.begin.ion",
-                    "string.quoted.double.ion",
-                    "punctuation.definition.string.end.ion"
-                ],
-                "regex": "([\"])((?:(?:\\\\\")|(?:[^\"]))*?)([\"])"
-            },
-            {
-                "token": "punctuation.definition.string.begin.ion",
-                "regex": "'{3}",
-                "push": [
-                    {
-                        "token": "punctuation.definition.string.end.ion",
-                        "regex": "'{3}",
-                        "next": "pop"
-                    },
-                    {
-                        "token": "string.quoted.triple.ion",
-                        "regex": "(?:\\\\'|[^'])+"
-                    },
-                    {
-                        "token": "string.quoted.triple.ion",
-                        "regex": "'"
-                    }
-                ]
-            }
-        ],
-        "annotation": [
-            {
-                "token": [
-                    "variable.language.annotation.ion",
-                    "punctuation.definition.annotation.ion"
-                ],
-                "regex": "('(?:[^']|\\\\\\\\|\\\\')*')\\s*(::)"
-            },
-            {
-                "token": [
-                    "variable.language.annotation.ion",
-                    "punctuation.definition.annotation.ion"
-                ],
-                "regex": "([\\$_a-zA-Z][\\$_a-zA-Z0-9]*)\\s*(::)"
-            }
-        ],
-        "whitespace": [
-            {
-                "token": "text.ion",
-                "regex": "\\s+"
-            }
-        ]
-    };
-    this.$rules["keywords"] = [keywordMapperRule];
-    this.normalizeRules();
-};
-oop.inherits(IonHighlightRules, TextHighlightRules);
-exports.IonHighlightRules = IonHighlightRules;
-
-});
-
-ace.define("ace/mode/partiql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/ion_highlight_rules"], function(require, exports, module){/*
-  THIS FILE WAS GENERATED BY 'ligand' USING 'mode_highlight_rules.js'
-*/
-"use strict";
-var oop = require("../lib/oop");
-var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-var IonHighlightRules = require("./ion_highlight_rules").IonHighlightRules;
-var PartiqlHighlightRules = function () {
-    var k_partiql_constant = "MISSING";
-    var k_sql_constant = "FALSE|NULL|TRUE";
-    var k_constant = k_partiql_constant + "|" + k_sql_constant;
-    var k_partiql_keyword = "PIVOT|UNPIVOT|LIMIT|TUPLE|REMOVE|INDEX|CONFLICT|DO|NOTHING|RETURNING|"
-        + "MODIFIED|NEW|OLD|LET";
-    var k_sql_keyword = "ABSOLUTE|ACTION|ADD|ALL|ALLOCATE|ALTER|AND|ANY|ARE|AS|"
-        + "ASC|ASSERTION|AT|AUTHORIZATION|BEGIN|BETWEEN|BIT_LENGTH|BY|CASCADE|CASCADED|"
-        + "CASE|CATALOG|CHAR|CHARACTER_LENGTH|CHAR_LENGTH|CHECK|CLOSE|COLLATE|COLLATION|COLUMN|"
-        + "COMMIT|CONNECT|CONNECTION|CONSTRAINT|CONSTRAINTS|CONTINUE|CONVERT|CORRESPONDING|CREATE|CROSS|"
-        + "CURRENT|CURSOR|DEALLOCATE|DEC|DECLARE|DEFAULT|DEFERRABLE|DEFERRED|DELETE|DESC|"
-        + "DESCRIBE|DESCRIPTOR|DIAGNOSTICS|DISCONNECT|DISTINCT|DOMAIN|DROP|ELSE|END|END-EXEC|"
-        + "ESCAPE|EXCEPT|EXCEPTION|EXEC|EXECUTE|EXTERNAL|EXTRACT|FETCH|FIRST|FOR|"
-        + "FOREIGN|FOUND|FROM|FULL|GET|GLOBAL|GO|GOTO|GRANT|GROUP|"
-        + "HAVING|IDENTITY|IMMEDIATE|IN|INDICATOR|INITIALLY|INNER|INPUT|INSENSITIVE|INSERT|"
-        + "INTERSECT|INTERVAL|INTO|IS|ISOLATION|JOIN|KEY|LANGUAGE|LAST|LEFT|"
-        + "LEVEL|LIKE|LOCAL|LOWER|MATCH|MODULE|NAMES|NATIONAL|NATURAL|NCHAR|"
-        + "NEXT|NO|NOT|OCTET_LENGTH|OF|ON|ONLY|OPEN|OPTION|OR|"
-        + "ORDER|OUTER|OUTPUT|OVERLAPS|PAD|PARTIAL|POSITION|PRECISION|PREPARE|PRESERVE|"
-        + "PRIMARY|PRIOR|PRIVILEGES|PROCEDURE|PUBLIC|READ|REAL|REFERENCES|RELATIVE|RESTRICT|"
-        + "REVOKE|RIGHT|ROLLBACK|ROWS|SCHEMA|SCROLL|SECTION|SELECT|SESSION|SET|"
-        + "SIZE|SOME|SPACE|SQL|SQLCODE|SQLERROR|SQLSTATE|TABLE|TEMPORARY|THEN|"
-        + "TIME|TO|TRANSACTION|TRANSLATE|TRANSLATION|UNION|UNIQUE|UNKNOWN|UPDATE|UPPER|"
-        + "USAGE|USER|USING|VALUE|VALUES|VIEW|WHEN|WHENEVER|WHERE|WITH|"
-        + "WORK|WRITE|ZONE";
-    var k_keyword = k_partiql_keyword + "|" + k_sql_keyword;
-    var k_partiql_type = "BOOL|BOOLEAN|STRING|SYMBOL|CLOB|BLOB|STRUCT|LIST|SEXP|BAG";
-    var k_sql_type = "CHARACTER|DATE|DECIMAL|DOUBLE|FLOAT|INT|INTEGER|NUMERIC|SMALLINT|TIMESTAMP|"
-        + "VARCHAR|VARYING";
-    var k_type = k_partiql_type + "|" + k_sql_type;
-    var k_sql_aggfn = "AVG|COUNT|MAX|MIN|SUM";
-    var k_aggfn = k_sql_aggfn;
-    var k_sql_fn = "CAST|COALESCE|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|EXISTS|DATE_ADD|DATE_DIFF|NULLIF|"
-        + "SESSION_USER|SUBSTRING|SYSTEM_USER|TRIM";
-    var k_fn = k_sql_fn;
-    var keywordMapper = this.createKeywordMapper({
-        "constant.language.partiql": k_constant,
-        "keyword.other.partiql": k_keyword,
-        "storage.type.partiql": k_type,
-        "support.function.aggregation.partiql": k_aggfn,
-        "support.function.partiql": k_fn
-    }, "variable.language.identifier.partiql", true);
-    var keywordMapperRule = {
-        token: keywordMapper,
-        regex: "\\b\\w+\\b"
-    };
-    this.$rules = {
-        "start": [
-            {
-                "include": "whitespace"
-            },
-            {
-                "include": "comment"
-            },
-            {
-                "include": "value"
-            }
-        ],
-        "value": [
-            {
-                "include": "whitespace"
-            },
-            {
-                "include": "comment"
-            },
-            {
-                "include": "tuple_value"
-            },
-            {
-                "include": "collection_value"
-            },
-            {
-                "include": "scalar_value"
-            }
-        ],
-        "scalar_value": [
-            {
-                "include": "string"
-            },
-            {
-                "include": "number"
-            },
-            {
-                "include": "keywords"
-            },
-            {
-                "include": "identifier"
-            },
-            {
-                "include": "embed-ion"
-            },
-            {
-                "include": "operator"
-            },
-            {
-                "include": "punctuation"
-            }
-        ],
-        "punctuation": [
-            {
-                "token": "punctuation.partiql",
-                "regex": "[;:()\\[\\]\\{\\},.]"
-            }
-        ],
-        "operator": [
-            {
-                "token": "keyword.operator.partiql",
-                "regex": "[+*/<>=~!@#%&|?^-]+"
-            }
-        ],
-        "identifier": [
-            {
-                "token": "variable.language.identifier.quoted.partiql",
-                "regex": "([\"])((?:(?:\\\\.)|(?:[^\"\\\\]))*?)([\"])"
-            },
-            {
-                "token": "variable.language.identifier.at.partiql",
-                "regex": "@\\w+"
-            },
-            {
-                "token": "variable.language.identifier.partiql",
-                "regex": "\\b\\w+(?:\\.\\w+)?\\b"
-            }
-        ],
-        "number": [
-            {
-                "token": "constant.numeric.partiql",
-                "regex": "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
-            }
-        ],
-        "string": [
-            {
-                "token": [
-                    "punctuation.definition.string.begin.partiql",
-                    "string.quoted.single.partiql",
-                    "punctuation.definition.string.end.partiql"
-                ],
-                "regex": "(['])((?:(?:\\\\.)|(?:[^'\\\\]))*?)(['])"
-            }
-        ],
-        "collection_value": [
-            {
-                "include": "array_value"
-            },
-            {
-                "include": "bag_value"
-            }
-        ],
-        "bag_value": [
-            {
-                "token": "punctuation.definition.bag.begin.partiql",
-                "regex": "<<",
-                "push": [
-                    {
-                        "token": "punctuation.definition.bag.end.partiql",
-                        "regex": ">>",
-                        "next": "pop"
-                    },
-                    {
-                        "include": "comment"
-                    },
-                    {
-                        "token": "punctuation.definition.bag.separator.partiql",
-                        "regex": ","
-                    },
-                    {
-                        "include": "value"
-                    }
-                ]
-            }
-        ],
-        "comment": [
-            {
-                "token": "comment.line.partiql",
-                "regex": "--.*"
-            },
-            {
-                "token": "comment.block.partiql",
-                "regex": "/\\*",
-                "push": "comment__1"
-            }
-        ],
-        "comment__1": [
-            {
-                "token": "comment.block.partiql",
-                "regex": "[*]/",
-                "next": "pop"
-            },
-            {
-                "token": "comment.block.partiql",
-                "regex": "[^*/]+"
-            },
-            {
-                "token": "comment.block.partiql",
-                "regex": "/\\*",
-                "push": "comment__1"
-            },
-            {
-                "token": "comment.block.partiql",
-                "regex": "[*/]+"
-            }
-        ],
-        "array_value": [
-            {
-                "token": "punctuation.definition.array.begin.partiql",
-                "regex": "\\[",
-                "push": [
-                    {
-                        "token": "punctuation.definition.array.end.partiql",
-                        "regex": "\\]",
-                        "next": "pop"
-                    },
-                    {
-                        "include": "comment"
-                    },
-                    {
-                        "token": "punctuation.definition.array.separator.partiql",
-                        "regex": ","
-                    },
-                    {
-                        "include": "value"
-                    }
-                ]
-            }
-        ],
-        "tuple_value": [
-            {
-                "token": "punctuation.definition.tuple.begin.partiql",
-                "regex": "\\{",
-                "push": [
-                    {
-                        "token": "punctuation.definition.tuple.end.partiql",
-                        "regex": "\\}",
-                        "next": "pop"
-                    },
-                    {
-                        "include": "comment"
-                    },
-                    {
-                        "token": "punctuation.definition.tuple.separator.partiql",
-                        "regex": ",|:"
-                    },
-                    {
-                        "include": "value"
-                    }
-                ]
-            }
-        ],
-        "whitespace": [
-            {
-                "token": "text.partiql",
-                "regex": "\\s+"
-            }
-        ]
-    };
-    this.$rules["keywords"] = [keywordMapperRule];
-    this.$rules["embed-ion"] = [{ token: "punctuation.definition.ion.begin.partiql", regex: "`", next: "ion-start" }];
-    this.embedRules(IonHighlightRules, "ion-", [{ token: "punctuation.definition.ion.end.partiql", regex: "`", next: "start" }]);
-    this.normalizeRules();
-};
-oop.inherits(PartiqlHighlightRules, TextHighlightRules);
-exports.PartiqlHighlightRules = PartiqlHighlightRules;
-
-});
-
-ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
-var Range = require("../range").Range;
-var MatchingBraceOutdent = function () { };
-(function () {
-    this.checkOutdent = function (line, input) {
-        if (!/^\s+$/.test(line))
-            return false;
-        return /^\s*\}/.test(input);
-    };
-    this.autoOutdent = function (doc, row) {
-        var line = doc.getLine(row);
-        var match = line.match(/^(\s*\})/);
-        if (!match)
-            return 0;
-        var column = match[1].length;
-        var openBracePos = doc.findMatchingBracket({ row: row, column: column });
-        if (!openBracePos || openBracePos.row == row)
-            return 0;
-        var indent = this.$getIndent(doc.getLine(openBracePos.row));
-        doc.replace(new Range(row, 0, row, column - 1), indent);
-    };
-    this.$getIndent = function (line) {
-        return line.match(/^\s*/)[0];
-    };
-}).call(MatchingBraceOutdent.prototype);
-exports.MatchingBraceOutdent = MatchingBraceOutdent;
-
-});
-
-ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
-var oop = require("../../lib/oop");
-var Range = require("../../range").Range;
-var BaseFoldMode = require("./fold_mode").FoldMode;
-var FoldMode = exports.FoldMode = function (commentRegex) {
-    if (commentRegex) {
-        this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
-        this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
-    }
-};
-oop.inherits(FoldMode, BaseFoldMode);
-(function () {
-    this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
-    this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
-    this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
-    this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
-    this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
-    this._getFoldWidgetBase = this.getFoldWidget;
-    this.getFoldWidget = function (session, foldStyle, row) {
-        var line = session.getLine(row);
-        if (this.singleLineBlockCommentRe.test(line)) {
-            if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
-                return "";
-        }
-        var fw = this._getFoldWidgetBase(session, foldStyle, row);
-        if (!fw && this.startRegionRe.test(line))
-            return "start"; // lineCommentRegionStart
-        return fw;
-    };
-    this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
-        var line = session.getLine(row);
-        if (this.startRegionRe.test(line))
-            return this.getCommentRegionBlock(session, line, row);
-        var match = line.match(this.foldingStartMarker);
-        if (match) {
-            var i = match.index;
-            if (match[1])
-                return this.openingBracketBlock(session, match[1], row, i);
-            var range = session.getCommentFoldRange(row, i + match[0].length, 1);
-            if (range && !range.isMultiLine()) {
-                if (forceMultiline) {
-                    range = this.getSectionRange(session, row);
-                }
-                else if (foldStyle != "all")
-                    range = null;
-            }
-            return range;
-        }
-        if (foldStyle === "markbegin")
-            return;
-        var match = line.match(this.foldingStopMarker);
-        if (match) {
-            var i = match.index + match[0].length;
-            if (match[1])
-                return this.closingBracketBlock(session, match[1], row, i);
-            return session.getCommentFoldRange(row, i, -1);
-        }
-    };
-    this.getSectionRange = function (session, row) {
-        var line = session.getLine(row);
-        var startIndent = line.search(/\S/);
-        var startRow = row;
-        var startColumn = line.length;
-        row = row + 1;
-        var endRow = row;
-        var maxRow = session.getLength();
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var indent = line.search(/\S/);
-            if (indent === -1)
-                continue;
-            if (startIndent > indent)
-                break;
-            var subRange = this.getFoldWidgetRange(session, "all", row);
-            if (subRange) {
-                if (subRange.start.row <= startRow) {
-                    break;
-                }
-                else if (subRange.isMultiLine()) {
-                    row = subRange.end.row;
-                }
-                else if (startIndent == indent) {
-                    break;
-                }
-            }
-            endRow = row;
-        }
-        return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
-    };
-    this.getCommentRegionBlock = function (session, line, row) {
-        var startColumn = line.search(/\s*$/);
-        var maxRow = session.getLength();
-        var startRow = row;
-        var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
-        var depth = 1;
-        while (++row < maxRow) {
-            line = session.getLine(row);
-            var m = re.exec(line);
-            if (!m)
-                continue;
-            if (m[1])
-                depth--;
-            else
-                depth++;
-            if (!depth)
-                break;
-        }
-        var endRow = row;
-        if (endRow > startRow) {
-            return new Range(startRow, startColumn, endRow, line.length);
-        }
-    };
-}).call(FoldMode.prototype);
-
-});
-
-ace.define("ace/mode/partiql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/partiql_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){/*
-  THIS FILE WAS GENERATED BY 'ligand' USING 'mode.js'
-*/
-"use strict";
-var oop = require("../lib/oop");
-var TextMode = require("./text").Mode;
-var HighlightRules = require("./partiql_highlight_rules").PartiqlHighlightRules;
-var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
-var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
-var CStyleFoldMode = require("./folding/cstyle").FoldMode;
-var Mode = function () {
-    this.HighlightRules = HighlightRules;
-    this.$outdent = new MatchingBraceOutdent();
-    this.$behaviour = new CstyleBehaviour();
-    this.foldingRules = new CStyleFoldMode();
-};
-oop.inherits(Mode, TextMode);
-(function () {
-    this.lineCommentStart = "--";
-    this.blockComment = { start: "/*", end: "*/", nestable: true };
-    this.getNextLineIndent = function (state, line, tab) {
-        var indent = this.$getIndent(line);
-        if (state == "start") {
-            var match = line.match(/^.*[\{\(\[]\s*$/);
-            if (match) {
-                indent += tab;
-            }
-        }
-        return indent;
-    };
-    this.checkOutdent = function (state, line, input) {
-        return this.$outdent.checkOutdent(line, input);
-    };
-    this.autoOutdent = function (state, doc, row) {
-        this.$outdent.autoOutdent(doc, row);
-    };
-    this.$id = "ace/mode/partiql";
-}).call(Mode.prototype);
-exports.Mode = Mode;
-
-});                (function() {
-                    ace.require(["ace/mode/partiql"], function(m) {
-                        if (typeof module == "object" && typeof exports == "object" && module) {
-                            module.exports = m;
-                        }
-                    });
-                })();
-            

部分文件因为文件数量过多而无法显示