lex 2 years ago
parent
commit
7e4329af86
100 changed files with 14639 additions and 15946 deletions
  1. 0 312
      web/00280aae09f2a71c1ab46c7cfb9f491c.js
  2. 0 0
      web/02196ddafec9285fd1418759cec8eecb.js
  3. 1 3
      web/021dbd6f6eb2865373c1f974f1c7606f.js
  4. 582 0
      web/023f0a6de254bc2caa975f56d4b61243.js
  5. 0 500
      web/02703e133100c3be64cfec414d4db706.js
  6. 0 0
      web/027e36a1f41877209eca741a54467a40.js
  7. 20 44
      web/031eff2932c3edf3ad690d1e3abe2dde.js
  8. 0 0
      web/039af9192b9bb277966ceb4e4ce29c41.js
  9. 0 0
      web/03c0f1c2c4d4c2b6fa956a3e05de8ce4.js
  10. 168 0
      web/0410ca02b96655ac3c08452105cdad32.js
  11. 415 521
      web/048ff91dafaa6f7895760c219bb772d5.js
  12. 387 0
      web/0645227e6c2479f7aefed1fdd23ac733.js
  13. 104 126
      web/06c89bf980f201e95c550f51a020321b.js
  14. 0 24
      web/06d453ace473034cd357edb758d539ab.js
  15. 0 83
      web/0768225f873adf5f103dcb714f17783d.js
  16. 750 0
      web/07ffddcf45f1e6302c8af71d36e17b7b.js
  17. 524 0
      web/082d72cee51411d39d52d3f0e06eca3b.js
  18. 0 23
      web/0870bcf868f8d64dc9a6226a6c8b341d.js
  19. 16 0
      web/08f2ebda31cf24e86831115fde674fad.js
  20. 0 530
      web/09195a75bcf8a7ac579281ac2ed5954a.js
  21. 0 397
      web/0a4b12234fd7cba4d7c62207e4835f4c.js
  22. 0 119
      web/0ab67a107deacf1d9b22eb0b706486db.js
  23. 0 6
      web/0b56e82ae05b7ec2022e1cb35b8b6e10.js
  24. 25 73
      web/0bb7acf5bee94a874690e9d25e8d58df.js
  25. 4 0
      web/0c0d52a441dccb36d64840526d7c262e.js
  26. 0 422
      web/0c125a87d8efb9ce303b6b91783eb165.js
  27. 0 95
      web/0cab51dee983721ec757e7e209a67c1d.js
  28. 310 0
      web/0db77d70de73132c7e5979bf8e82f047.js
  29. 0 33
      web/0dc486b4415f7cbd7ddde8f32b6f12f1.js
  30. 8 16
      web/0e13b643b6e88e8fd6328d50acabfda8.js
  31. 276 359
      web/0e2be44e86c135b5017d23a1040da0ba.js
  32. 98 95
      web/0e6175d2306c7bd33ad73acb96313103.js
  33. 0 128
      web/0ebc6c9681e409f2bf3bb6d8ce64e28e.js
  34. 0 0
      web/103d2d5aeb83325c62e06eeb03ce110f.js
  35. 0 10
      web/1084edaced97872890c9d87a9944cdcd.js
  36. 0 125
      web/10bc79414b62df132421027bbf5e5c3e.js
  37. 0 5931
      web/117389396b5ae8131c2a299bfc802c7a.js
  38. 22 33
      web/1178a325160e7e86e4f86460128fc135.js
  39. 22 33
      web/11f9366eb32d7444aebd0a897dcc4f79.js
  40. 77 109
      web/12738aa8461e4775d7f380a5d1953893.js
  41. 0 23
      web/1295d4470d348d3ff8ea442b1dcef3d3.js
  42. 0 257
      web/1365ff3d277ebdab408e6aeec886cf08.js
  43. 0 40
      web/144991c48dbba89bfe10e886aaaed32a.js
  44. 0 96
      web/1570e695c448e6a4f3a6bdf0372b58f0.js
  45. 16 0
      web/15bd2f4de9aefea698aea59ecd36327f.js
  46. 271 351
      web/16274924d7152a77759b45dabd995ffa.js
  47. 0 449
      web/167a62ec377adafbeb4bbb1cef73250d.js
  48. 226 267
      web/1694f12f2e48f4b28754c37fd132c501.js
  49. 126 214
      web/16ae728a78f1cb04d40f77b322eb133d.js
  50. 16 0
      web/173ea2d9126a53f1d6cb61ef26219598.js
  51. 0 0
      web/18b69bf761ab7d8645f68794096dcb46.js
  52. 502 0
      web/18b9a42de70da52144b223be58bb65c3.js
  53. 0 148
      web/19573d26f286762809b86f935516c1ac.js
  54. 0 135
      web/1afbeca385b131cfc3ae515b89e552c7.js
  55. 177 246
      web/1bd8ec07cab7c3b9e5e00671ed6ddcd5.js
  56. 152 211
      web/1c396939d503de7cc34ff9e809ed92ee.js
  57. 9 0
      web/1c71dfe2ae40884baae78d14e2568eb1.js
  58. 16 0
      web/1cac3566cdfb6be0f51c3f2ade7c1603.js
  59. 0 0
      web/1e0340d10d5cb579b144f73e631c7813.js
  60. 0 279
      web/1e33cb44dfab039b4a7e88a3ee1bbfe7.js
  61. 0 0
      web/1ea9cb4eff3a4f4c27ff63263151eba2.js
  62. 836 0
      web/1f33899bba9efc8a9dc527f39ce8fe9a.js
  63. 70 0
      web/1facfcf9af0b5a679a66dc7f26080afe.js
  64. 9 0
      web/1fd353d022bf5027ba193d0b0b9995ed.js
  65. 0 167
      web/20642f73792092d3c71a4f1f4290430b.js
  66. 0 113
      web/2208705283adad817bb4a5af647f77ab.js
  67. 428 0
      web/2218ddba12711e7e7f6aea96015bafa2.js
  68. 0 310
      web/22b1c8bf4c2bdd7e438f832b888c75e4.js
  69. 6448 0
      web/22b3d72765b6ec7c787f375e68324531.js
  70. 25 40
      web/22cc8dfa6780c4baf11191388b0a4e71.js
  71. 1 1
      web/22ddca0f2cac653ae8eebd716e965aa7.js
  72. 127 178
      web/2322c0d73cf4169df003976804566079.js
  73. 0 0
      web/23ad6224fd6059c31c199b6d6d420628.js
  74. 0 109
      web/243d8101969c933d25388b5287bb3425.js
  75. 0 111
      web/2487e54390024553d757b9bd73dd1647.js
  76. 16 0
      web/26916d87ee46ad72f432b9a59e6fd198.js
  77. 72 115
      web/26fa04eabe6ca96832d5652350a2fb46.js
  78. 1 3
      web/2820d22820b6e6c07cdd0ec14477c7b9.js
  79. 74 105
      web/2836e58974a8e2730a9b6bec1921dd3d.js
  80. 0 6
      web/2839e845bd0cf60f35f3a8ca90a5ee22.js
  81. 0 254
      web/294fbc5b00264d6215dd8ff838dc2999.js
  82. 0 0
      web/2a4c96bd91c25806d68325751fb0c958.js
  83. 133 0
      web/2b1eed411f531a271f0e47693c82216a.js
  84. 1 3
      web/2c41df6060672e75b4ab09e4a5d43049.js
  85. 16 0
      web/2d53cfacb6a695f378ca997fcee7efb3.js
  86. 305 0
      web/2dcf359bda4d96fcd06e8b0b7bc039bf.js
  87. 0 168
      web/2dea096a03cd8f864db5f06e9f0113e5.js
  88. 110 182
      web/2e4c8b961fd80b700a23d21f3d9bb4c5.js
  89. 23 36
      web/2f3af4250fd57142b0ffb0ed6bc553dc.js
  90. 4 0
      web/2f5ea84ffbac21b3f98fccc2352300e4.js
  91. 0 0
      web/2f689ca91158f918e23ce27c7abbcf25.js
  92. 0 0
      web/2f6dcc38e5ad378438bea99c47e20e28.js
  93. 0 137
      web/2f6f1f6753d430190cb38411a9112f08.js
  94. 0 0
      web/2f985fd2d1b0603c0cd825f7e9b4218d.js
  95. 0 172
      web/30314e1b4a51b1aed3766eadecde2a42.js
  96. 159 197
      web/30335c579bfc2de8dcf574523ef13020.js
  97. 151 200
      web/3078a3b7f66272ada3e5d065827dfceb.js
  98. 0 103
      web/30f5b57295dfda4eafc7f8c098160582.js
  99. 0 0
      web/30fc7b3a9d721379c231908210e3530d.js
  100. 310 370
      web/318d00035e58a0cea6acc0c603c0e680.js

+ 0 - 312
web/00280aae09f2a71c1ab46c7cfb9f491c.js

@@ -1,312 +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) {
-"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;
-                        }
-                    });
-                })();
-            

File diff suppressed because it is too large
+ 0 - 0
web/02196ddafec9285fd1418759cec8eecb.js


File diff suppressed because it is too large
+ 1 - 3
web/021dbd6f6eb2865373c1f974f1c7606f.js


+ 582 - 0
web/023f0a6de254bc2caa975f56d4b61243.js

@@ -0,0 +1,582 @@
+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;
+                        }
+                    });
+                })();
+            

+ 0 - 500
web/02703e133100c3be64cfec414d4db706.js

@@ -1,500 +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",           // ' 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;
-                        }
-                    });
-                })();
-            

File diff suppressed because it is too large
+ 0 - 0
web/027e36a1f41877209eca741a54467a40.js


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

@@ -1,10 +1,7 @@
-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" +
@@ -13,7 +10,6 @@ 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,
@@ -90,71 +86,56 @@ var PascalHighlightRules = function() {
             }
         ]
     };
-
     this.normalizeRules();
 };
-
 oop.inherits(PascalHighlightRules, TextHighlightRules);
-
 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) {
@@ -163,56 +144,51 @@ 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) {
+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
+*/
 "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;
+
 });                (function() {
                     ace.require(["ace/mode/pascal"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

File diff suppressed because it is too large
+ 0 - 0
web/039af9192b9bb277966ceb4e4ce29c41.js


File diff suppressed because it is too large
+ 0 - 0
web/03c0f1c2c4d4c2b6fa956a3e05de8ce4.js


+ 168 - 0
web/0410ca02b96655ac3c08452105cdad32.js

@@ -0,0 +1,168 @@
+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;
+                        }
+                    });
+                })();
+            

File diff suppressed because it is too large
+ 415 - 521
web/048ff91dafaa6f7895760c219bb772d5.js


+ 387 - 0
web/0645227e6c2479f7aefed1fdd23ac733.js

@@ -0,0 +1,387 @@
+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;
+                        }
+                    });
+                })();
+            

+ 104 - 126
web/7bdb2e4d3bc51d15863aa7be6e0a23a9.js → web/06c89bf980f201e95c550f51a020321b.js

@@ -1,165 +1,140 @@
-ace.define("ace/mode/scheme_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
-"use strict";
-
+ace.define("ace/mode/scheme_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 SchemeHighlightRules = function() {
+var SchemeHighlightRules = function () {
     var keywordControl = "case|do|let|loop|if|else|when";
     var keywordOperator = "eq?|eqv?|equal?|and|or|not|null?";
     var constantLanguage = "#t|#f";
     var supportFunctions = "cons|car|cdr|cond|lambda|lambda*|syntax-rules|format|set!|quote|eval|append|list|list?|member?|load";
-
     var keywordMapper = this.createKeywordMapper({
         "keyword.control": keywordControl,
         "keyword.operator": keywordOperator,
         "constant.language": constantLanguage,
         "support.function": supportFunctions
     }, "identifier", true);
-
-    this.$rules = 
-        {
-    "start": [
-        {
-            token : "comment",
-            regex : ";.*$"
-        },
-        {
-            "token": ["storage.type.function-type.scheme", "text", "entity.name.function.scheme"],
-            "regex": "(?:\\b(?:(define|define-syntax|define-macro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)"
-        },
-        {
-            "token": "punctuation.definition.constant.character.scheme",
-            "regex": "#:\\S+"
-        },
-        {
-            "token": ["punctuation.definition.variable.scheme", "variable.other.global.scheme", "punctuation.definition.variable.scheme"],
-            "regex": "(\\*)(\\S*)(\\*)"
-        },
-        {
-            "token" : "constant.numeric", // hex
-            "regex" : "#[xXoObB][0-9a-fA-F]+"
-        }, 
-        {
-            "token" : "constant.numeric", // float
-            "regex" : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?"
-        },
-        {
-                "token" : keywordMapper,
-                "regex" : "[a-zA-Z_#][a-zA-Z0-9_\\-\\?\\!\\*]*"
-        },
-        {
-            "token" : "string",
-            "regex" : '"(?=.)',
-            "next"  : "qqstring"
-        }
-    ],
-    "qqstring": [
+    this.$rules =
         {
-            "token": "constant.character.escape.scheme",
-            "regex": "\\\\."
-        },
-        {
-            "token" : "string",
-            "regex" : '[^"\\\\]+',
-            "merge" : true
-        }, {
-            "token" : "string",
-            "regex" : "\\\\$",
-            "next"  : "qqstring",
-            "merge" : true
-        }, {
-            "token" : "string",
-            "regex" : '"|$',
-            "next"  : "start",
-            "merge" : true
-        }
-    ]
-};
-
+            "start": [
+                {
+                    token: "comment",
+                    regex: ";.*$"
+                },
+                {
+                    "token": ["storage.type.function-type.scheme", "text", "entity.name.function.scheme"],
+                    "regex": "(?:\\b(?:(define|define-syntax|define-macro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)"
+                },
+                {
+                    "token": "punctuation.definition.constant.character.scheme",
+                    "regex": "#:\\S+"
+                },
+                {
+                    "token": ["punctuation.definition.variable.scheme", "variable.other.global.scheme", "punctuation.definition.variable.scheme"],
+                    "regex": "(\\*)(\\S*)(\\*)"
+                },
+                {
+                    "token": "constant.numeric",
+                    "regex": "#[xXoObB][0-9a-fA-F]+"
+                },
+                {
+                    "token": "constant.numeric",
+                    "regex": "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?"
+                },
+                {
+                    "token": keywordMapper,
+                    "regex": "[a-zA-Z_#][a-zA-Z0-9_\\-\\?\\!\\*]*"
+                },
+                {
+                    "token": "string",
+                    "regex": '"(?=.)',
+                    "next": "qqstring"
+                }
+            ],
+            "qqstring": [
+                {
+                    "token": "constant.character.escape.scheme",
+                    "regex": "\\\\."
+                },
+                {
+                    "token": "string",
+                    "regex": '[^"\\\\]+',
+                    "merge": true
+                }, {
+                    "token": "string",
+                    "regex": "\\\\$",
+                    "next": "qqstring",
+                    "merge": true
+                }, {
+                    "token": "string",
+                    "regex": '"|$',
+                    "next": "start",
+                    "merge": true
+                }
+            ]
+        };
 };
-
 oop.inherits(SchemeHighlightRules, TextHighlightRules);
-
 exports.SchemeHighlightRules = SchemeHighlightRules;
-});
 
-ace.define("ace/mode/matching_parens_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
-"use strict";
+});
 
+ace.define("ace/mode/matching_parens_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
 var Range = require("../range").Range;
-
-var MatchingParensOutdent = function() {};
-
-(function() {
-
-    this.checkOutdent = function(line, input) {
-        if (! /^\s+$/.test(line))
+var MatchingParensOutdent = 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) {
         var match = line.match(/^(\s+)/);
         if (match) {
             return match[1];
         }
-
         return "";
     };
-
 }).call(MatchingParensOutdent.prototype);
-
 exports.MatchingParensOutdent = MatchingParensOutdent;
-});
 
-ace.define("ace/mode/scheme",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scheme_highlight_rules","ace/mode/matching_parens_outdent"], function(require, exports, module) {
-"use strict";
+});
 
+ace.define("ace/mode/scheme",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scheme_highlight_rules","ace/mode/matching_parens_outdent"], function(require, exports, module){"use strict";
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var SchemeHighlightRules = require("./scheme_highlight_rules").SchemeHighlightRules;
 var MatchingParensOutdent = require("./matching_parens_outdent").MatchingParensOutdent;
-
-var Mode = function() {
+var Mode = function () {
     this.HighlightRules = SchemeHighlightRules;
-	this.$outdent = new MatchingParensOutdent();
+    this.$outdent = new MatchingParensOutdent();
     this.$behaviour = this.$defaultBehaviour;
 };
 oop.inherits(Mode, TextMode);
-
-(function() {
-       
+(function () {
     this.lineCommentStart = ";";
     this.minorIndentFunctions = ["define", "lambda", "define-macro", "define-syntax", "syntax-rules", "define-record-type", "define-structure"];
-
-    this.$toIndent = function(str) {
-        return str.split('').map(function(ch) {
+    this.$toIndent = function (str) {
+        return str.split('').map(function (ch) {
             if (/\s/.exec(ch)) {
                 return ch;
-            } else {
+            }
+            else {
                 return ' ';
             }
         }).join('');
     };
-
-    this.$calculateIndent = function(line, tab) {
+    this.$calculateIndent = function (line, tab) {
         var baseIndent = this.$getIndent(line);
         var delta = 0;
         var isParen, ch;
@@ -168,10 +143,12 @@ oop.inherits(Mode, TextMode);
             if (ch === '(') {
                 delta--;
                 isParen = true;
-            } else if (ch === '(' || ch === '[' || ch === '{') {
+            }
+            else if (ch === '(' || ch === '[' || ch === '{') {
                 delta--;
                 isParen = false;
-            } else if (ch === ')' || ch === ']' || ch === '}') {
+            }
+            else if (ch === ')' || ch === ']' || ch === '}') {
                 delta++;
             }
             if (delta < 0) {
@@ -185,43 +162,44 @@ oop.inherits(Mode, TextMode);
             while (true) {
                 ch = line[i];
                 if (ch === ' ' || ch === '\t') {
-                    if(this.minorIndentFunctions.indexOf(fn) !== -1) {
+                    if (this.minorIndentFunctions.indexOf(fn) !== -1) {
                         return this.$toIndent(line.substring(0, iBefore - 1) + tab);
-                    } else {
+                    }
+                    else {
                         return this.$toIndent(line.substring(0, i + 1));
                     }
-                } else if (ch === undefined) {
+                }
+                else if (ch === undefined) {
                     return this.$toIndent(line.substring(0, iBefore - 1) + tab);
                 }
                 fn += line[i];
                 i++;
             }
-        } else if(delta < 0 && !isParen) {
-            return this.$toIndent(line.substring(0, i+1));
-        } else if(delta > 0) {
+        }
+        else if (delta < 0 && !isParen) {
+            return this.$toIndent(line.substring(0, i + 1));
+        }
+        else if (delta > 0) {
             baseIndent = baseIndent.substring(0, baseIndent.length - tab.length);
             return baseIndent;
-        } else {
+        }
+        else {
             return baseIndent;
         }
     };
-
-    this.getNextLineIndent = function(state, line, tab) {
+    this.getNextLineIndent = function (state, line, tab) {
         return this.$calculateIndent(line, tab);
     };
-
-    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/scheme";
 }).call(Mode.prototype);
-
 exports.Mode = Mode;
+
 });                (function() {
                     ace.require(["ace/mode/scheme"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 0 - 24
web/06d453ace473034cd357edb758d539ab.js

@@ -1,24 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 0 - 83
web/0768225f873adf5f103dcb714f17783d.js

@@ -1,83 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 750 - 0
web/07ffddcf45f1e6302c8af71d36e17b7b.js

@@ -0,0 +1,750 @@
+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;
+                        }
+                    });
+                })();
+            

+ 524 - 0
web/082d72cee51411d39d52d3f0e06eca3b.js

@@ -0,0 +1,524 @@
+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;
+                        }
+                    });
+                })();
+            

+ 0 - 23
web/0870bcf868f8d64dc9a6226a6c8b341d.js

@@ -1,23 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 16 - 0
web/08f2ebda31cf24e86831115fde674fad.js

@@ -0,0 +1,16 @@
+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;
+                        }
+                    });
+                })();
+            

File diff suppressed because it is too large
+ 0 - 530
web/09195a75bcf8a7ac579281ac2ed5954a.js


+ 0 - 397
web/0a4b12234fd7cba4d7c62207e4835f4c.js

@@ -1,397 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 0 - 119
web/0ab67a107deacf1d9b22eb0b706486db.js

@@ -1,119 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

File diff suppressed because it is too large
+ 0 - 6
web/0b56e82ae05b7ec2022e1cb35b8b6e10.js


+ 25 - 73
web/f3b6993cd8f9bbdd1d5ad68a5e1cdf70.js → web/0bb7acf5bee94a874690e9d25e8d58df.js

@@ -1,58 +1,26 @@
-ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom","ace/lib/lang"], function(require, exports, module) {
-"use strict";
+ace.define("ace/ext/static.css",["require","exports","module"], function(require, exports, module){module.exports = ".ace_static_highlight {\n    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;\n    font-size: 12px;\n    white-space: pre-wrap\n}\n\n.ace_static_highlight .ace_gutter {\n    width: 2em;\n    text-align: right;\n    padding: 0 3px 0 0;\n    margin-right: 3px;\n    contain: none;\n}\n\n.ace_static_highlight.ace_show_gutter .ace_line {\n    padding-left: 2.6em;\n}\n\n.ace_static_highlight .ace_line { position: relative; }\n\n.ace_static_highlight .ace_gutter-cell {\n    -moz-user-select: -moz-none;\n    -khtml-user-select: none;\n    -webkit-user-select: none;\n    user-select: none;\n    top: 0;\n    bottom: 0;\n    left: 0;\n    position: absolute;\n}\n\n\n.ace_static_highlight .ace_gutter-cell:before {\n    content: counter(ace_line, decimal);\n    counter-increment: ace_line;\n}\n.ace_static_highlight {\n    counter-reset: ace_line;\n}\n";
 
+});
+
+ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/ext/static.css","ace/config","ace/lib/dom","ace/lib/lang"], function(require, exports, module){"use strict";
 var EditSession = require("../edit_session").EditSession;
 var TextLayer = require("../layer/text").Text;
-var baseStyles = ".ace_static_highlight {\
-font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;\
-font-size: 12px;\
-white-space: pre-wrap\
-}\
-.ace_static_highlight .ace_gutter {\
-width: 2em;\
-text-align: right;\
-padding: 0 3px 0 0;\
-margin-right: 3px;\
-contain: none;\
-}\
-.ace_static_highlight.ace_show_gutter .ace_line {\
-padding-left: 2.6em;\
-}\
-.ace_static_highlight .ace_line { position: relative; }\
-.ace_static_highlight .ace_gutter-cell {\
--moz-user-select: -moz-none;\
--khtml-user-select: none;\
--webkit-user-select: none;\
-user-select: none;\
-top: 0;\
-bottom: 0;\
-left: 0;\
-position: absolute;\
-}\
-.ace_static_highlight .ace_gutter-cell:before {\
-content: counter(ace_line, decimal);\
-counter-increment: ace_line;\
-}\
-.ace_static_highlight {\
-counter-reset: ace_line;\
-}\
-";
+var baseStyles = require("./static.css");
 var config = require("../config");
 var dom = require("../lib/dom");
 var escapeHTML = require("../lib/lang").escapeHTML;
-
 function Element(type) {
     this.type = type;
     this.style = {};
     this.textContent = "";
 }
-Element.prototype.cloneNode = function() {
+Element.prototype.cloneNode = function () {
     return this;
 };
-Element.prototype.appendChild = function(child) {
+Element.prototype.appendChild = function (child) {
     this.textContent += child.toString();
 };
-Element.prototype.toString = function() {
+Element.prototype.toString = function () {
     var stringBuilder = [];
     if (this.type != "fragment") {
         stringBuilder.push("<", this.type);
@@ -66,47 +34,38 @@ Element.prototype.toString = function() {
             stringBuilder.push(" style='", styleStr.join(""), "'");
         stringBuilder.push(">");
     }
-
     if (this.textContent) {
         stringBuilder.push(this.textContent);
     }
-
     if (this.type != "fragment") {
         stringBuilder.push("</", this.type, ">");
     }
-    
     return stringBuilder.join("");
 };
-
-
 var simpleDom = {
-    createTextNode: function(textContent, element) {
+    createTextNode: function (textContent, element) {
         return escapeHTML(textContent);
     },
-    createElement: function(type) {
+    createElement: function (type) {
         return new Element(type);
     },
-    createFragment: function() {
+    createFragment: function () {
         return new Element("fragment");
     }
 };
-
-var SimpleTextLayer = function() {
+var SimpleTextLayer = function () {
     this.config = {};
     this.dom = simpleDom;
 };
 SimpleTextLayer.prototype = TextLayer.prototype;
-
-var highlight = function(el, opts, callback) {
+var highlight = function (el, opts, callback) {
     var m = el.className.match(/lang-(\w+)/);
     var mode = opts.mode || m && ("ace/mode/" + m[1]);
     if (!mode)
         return false;
     var theme = opts.theme || "ace/theme/textmate";
-    
     var data = "";
     var nodes = [];
-
     if (el.firstElementChild) {
         var textLen = 0;
         for (var i = 0; i < el.childNodes.length; i++) {
@@ -114,16 +73,17 @@ var highlight = function(el, opts, callback) {
             if (ch.nodeType == 3) {
                 textLen += ch.data.length;
                 data += ch.data;
-            } else {
+            }
+            else {
                 nodes.push(textLen, ch);
             }
         }
-    } else {
+    }
+    else {
         data = el.textContent;
         if (opts.trim)
             data = data.trim();
     }
-    
     highlight.render(data, mode, theme, opts.firstLineNumber, !opts.showGutter, function (highlighted) {
         dom.importCssString(highlighted.css, "ace_highlight");
         el.innerHTML = highlighted.html;
@@ -137,12 +97,12 @@ var highlight = function(el, opts, callback) {
         callback && callback();
     });
 };
-highlight.render = function(input, mode, theme, lineStart, disableGutter, callback) {
+highlight.render = function (input, mode, theme, lineStart, disableGutter, callback) {
     var waiting = 1;
     var modeCache = EditSession.prototype.$modes;
     if (typeof theme == "string") {
         waiting++;
-        config.loadModule(['theme', theme], function(m) {
+        config.loadModule(['theme', theme], function (m) {
             theme = m;
             --waiting || done();
         });
@@ -154,7 +114,7 @@ highlight.render = function(input, mode, theme, lineStart, disableGutter, callba
     }
     if (typeof mode == "string") {
         waiting++;
-        config.loadModule(['mode', mode], function(m) {
+        config.loadModule(['mode', mode], function (m) {
             if (!modeCache[mode] || modeOptions)
                 modeCache[mode] = new m.Mode(modeOptions);
             mode = modeCache[mode];
@@ -167,40 +127,33 @@ highlight.render = function(input, mode, theme, lineStart, disableGutter, callba
     }
     return --waiting || done();
 };
-highlight.renderSync = function(input, mode, theme, lineStart, disableGutter) {
+highlight.renderSync = function (input, mode, theme, lineStart, disableGutter) {
     lineStart = parseInt(lineStart || 1, 10);
-
     var session = new EditSession("");
     session.setUseWorker(false);
     session.setMode(mode);
-
     var textLayer = new SimpleTextLayer();
     textLayer.setSession(session);
-    Object.keys(textLayer.$tabStrings).forEach(function(k) {
+    Object.keys(textLayer.$tabStrings).forEach(function (k) {
         if (typeof textLayer.$tabStrings[k] == "string") {
             var el = simpleDom.createFragment();
             el.textContent = textLayer.$tabStrings[k];
             textLayer.$tabStrings[k] = el;
         }
     });
-
     session.setValue(input);
-    var length =  session.getLength();
-    
+    var length = session.getLength();
     var outerEl = simpleDom.createElement("div");
     outerEl.className = theme.cssClass;
-    
     var innerEl = simpleDom.createElement("div");
     innerEl.className = "ace_static_highlight" + (disableGutter ? "" : " ace_show_gutter");
     innerEl.style["counter-reset"] = "ace_line " + (lineStart - 1);
-
     for (var ix = 0; ix < length; ix++) {
         var lineEl = simpleDom.createElement("div");
         lineEl.className = "ace_line";
-        
         if (!disableGutter) {
             var gutterEl = simpleDom.createElement("span");
-            gutterEl.className ="ace_gutter ace_gutter-cell";
+            gutterEl.className = "ace_gutter ace_gutter-cell";
             gutterEl.textContent = "";
             lineEl.appendChild(gutterEl);
         }
@@ -209,16 +162,15 @@ highlight.renderSync = function(input, mode, theme, lineStart, disableGutter) {
         innerEl.appendChild(lineEl);
     }
     outerEl.appendChild(innerEl);
-
     return {
         css: baseStyles + theme.cssText,
         html: outerEl.toString(),
         session: session
     };
 };
-
 module.exports = highlight;
 module.exports.highlight = highlight;
+
 });                (function() {
                     ace.require(["ace/ext/static_highlight"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

File diff suppressed because it is too large
+ 4 - 0
web/0c0d52a441dccb36d64840526d7c262e.js


+ 0 - 422
web/0c125a87d8efb9ce303b6b91783eb165.js

@@ -1,422 +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", // 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;
-                        }
-                    });
-                })();
-            

+ 0 - 95
web/0cab51dee983721ec757e7e209a67c1d.js

@@ -1,95 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 310 - 0
web/0db77d70de73132c7e5979bf8e82f047.js

@@ -0,0 +1,310 @@
+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;
+                        }
+                    });
+                })();
+            

+ 0 - 33
web/0dc486b4415f7cbd7ddde8f32b6f12f1.js

@@ -1,33 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

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

@@ -1,14 +1,12 @@
-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);
             }
@@ -16,41 +14,35 @@ 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 });
     }
 }
 

File diff suppressed because it is too large
+ 276 - 359
web/0e2be44e86c135b5017d23a1040da0ba.js


+ 98 - 95
web/cb332e7b5386c55fe0ced93b36d73da7.js → web/0e6175d2306c7bd33ad73acb96313103.js

@@ -1,19 +1,21 @@
-ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
+ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"], function(require, exports, module){// [WIP]
 "use strict";
 var TokenIterator = require("../token_iterator").TokenIterator;
-
 function is(token, type) {
     return token.type.lastIndexOf(type + ".xml") > -1;
 }
 exports.singletonTags = ["area", "base", "br", "col", "command", "embed", "hr", "html", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];
 exports.blockTags = ["article", "aside", "blockquote", "body", "div", "dl", "fieldset", "footer", "form", "head", "header", "html", "nav", "ol", "p", "script", "section", "style", "table", "tbody", "tfoot", "thead", "ul"];
-
-exports.beautify = function(session) {
+exports.formatOptions = {
+    lineBreaksAfterCommasInCurlyBlock: true
+};
+exports.beautify = function (session) {
     var iterator = new TokenIterator(session, 0, 0);
     var token = iterator.getCurrentToken();
     var tabString = session.getTabString();
     var singletonTags = exports.singletonTags;
     var blockTags = exports.blockTags;
+    var formatOptions = exports.formatOptions || {};
     var nextToken;
     var breakBefore = false;
     var spaceBefore = false;
@@ -38,28 +40,32 @@ exports.beautify = function(session) {
     var inTag = false;
     var inCSS = false;
     var inBlock = false;
-    var levels = {0: 0};
+    var levels = { 0: 0 };
     var parents = [];
-
-    var trimNext = function() {
+    var caseBody = false;
+    var trimNext = function () {
         if (nextToken && nextToken.value && nextToken.type !== 'string.regexp')
             nextToken.value = nextToken.value.replace(/^\s*/, "");
     };
-    
-    var trimLine = function() {
-        code = code.replace(/ +$/, "");
+    var trimLine = function () {
+        var end = code.length - 1;
+        while (true) {
+            if (end == 0)
+                break;
+            if (code[end] !== " ")
+                break;
+            end = end - 1;
+        }
+        code = code.slice(0, end + 1);
     };
-
-    var trimCode = function() {
+    var trimCode = function () {
         code = code.trimRight();
         breakBefore = false;
     };
-
     while (token !== null) {
         curRow = iterator.getCurrentTokenRow();
         rowTokens = iterator.$rowTokens;
         nextToken = iterator.stepForward();
-
         if (typeof token !== "undefined") {
             value = token.value;
             unindent = 0;
@@ -71,18 +77,19 @@ exports.beautify = function(session) {
                 if (value === "</") {
                     if (inBlock && !breakBefore && rowsToAdd < 1)
                         rowsToAdd++;
-
                     if (inCSS)
                         rowsToAdd = 1;
-
                     unindent = 1;
                     inBlock = false;
                 }
-            } else if (is(token, "tag-close")) {
+            }
+            else if (is(token, "tag-close")) {
                 inTag = false;
-            } else if (is(token, "comment.start")) {
+            }
+            else if (is(token, "comment.start")) {
                 inBlock = true;
-            } else if (is(token, "comment.end")) {
+            }
+            else if (is(token, "comment.end")) {
                 inBlock = false;
             }
             if (!inTag && !rowsToAdd && token.type === "paren.rparen" && token.value.substr(0, 1) === "}") {
@@ -90,25 +97,20 @@ exports.beautify = function(session) {
             }
             if (curRow !== row) {
                 rowsToAdd = curRow;
-
                 if (row)
                     rowsToAdd -= row;
             }
-
             if (rowsToAdd) {
                 trimCode();
                 for (; rowsToAdd > 0; rowsToAdd--)
                     code += "\n";
-
                 breakBefore = true;
                 if (!is(token, "comment") && !token.type.match(/^(comment|string)$/))
-                   value = value.trimLeft();
+                    value = value.trimLeft();
             }
-
             if (value) {
                 if (token.type === "keyword" && value.match(/^(if|else|elseif|for|foreach|while|switch)$/)) {
                     parents[depth] = value;
-
                     trimNext();
                     spaceAfter = true;
                     if (value.match(/^(else|elseif)$/)) {
@@ -117,13 +119,13 @@ exports.beautify = function(session) {
                             spaceBefore = true;
                         }
                     }
-                } else if (token.type === "paren.lparen") {
+                }
+                else if (token.type === "paren.lparen") {
                     trimNext();
                     if (value.substr(-1) === "{") {
                         spaceAfter = true;
                         indentNextLine = false;
-
-                        if(!inTag)
+                        if (!inTag)
                             rowsToAdd = 1;
                     }
                     if (value.substr(0, 1) === "{") {
@@ -131,25 +133,27 @@ exports.beautify = function(session) {
                         if (code.substr(-1) !== '[' && code.trimRight().substr(-1) === '[') {
                             trimCode();
                             spaceBefore = false;
-                        } else if (code.trimRight().substr(-1) === ')') {
+                        }
+                        else if (code.trimRight().substr(-1) === ')') {
                             trimCode();
-                        } else {
+                        }
+                        else {
                             trimLine();
                         }
                     }
-                } else if (token.type === "paren.rparen") {
+                }
+                else if (token.type === "paren.rparen") {
                     unindent = 1;
                     if (value.substr(0, 1) === "}") {
-                        if (parents[depth-1] === 'case')
+                        if (parents[depth - 1] === 'case')
                             unindent++;
-
                         if (code.trimRight().substr(-1) === '{') {
                             trimCode();
-                        } else {
+                        }
+                        else {
                             spaceBefore = true;
-
                             if (inCSS)
-                                rowsToAdd+=2;
+                                rowsToAdd += 2;
                         }
                     }
                     if (value.substr(0, 1) === "]") {
@@ -166,79 +170,83 @@ exports.beautify = function(session) {
                             trimCode();
                         }
                     }
-
                     trimLine();
-                } else if ((token.type === "keyword.operator" || token.type === "keyword") && value.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)) {
+                }
+                else if ((token.type === "keyword.operator" || token.type === "keyword") && value.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)) {
                     trimCode();
                     trimNext();
                     spaceBefore = true;
                     spaceAfter = true;
-                } else if (token.type === "punctuation.operator" && value === ';') {
+                }
+                else if (token.type === "punctuation.operator" && value === ';') {
                     trimCode();
                     trimNext();
                     spaceAfter = true;
-
                     if (inCSS)
                         rowsToAdd++;
-                } else if (token.type === "punctuation.operator" && value.match(/^(:|,)$/)) {
+                }
+                else if (token.type === "punctuation.operator" && value.match(/^(:|,)$/)) {
                     trimCode();
                     trimNext();
-                    if (value.match(/^(,)$/) && curlyDepth>0 && roundDepth===0) {
+                    if (value.match(/^(,)$/) && curlyDepth > 0 && roundDepth === 0 && formatOptions.lineBreaksAfterCommasInCurlyBlock) {
                         rowsToAdd++;
-                    } else {
+                    }
+                    else {
                         spaceAfter = true;
                         breakBefore = false;
                     }
-                } else if (token.type === "support.php_tag" && value === "?>" && !breakBefore) {
+                }
+                else if (token.type === "support.php_tag" && value === "?>" && !breakBefore) {
                     trimCode();
                     spaceBefore = true;
-                } else if (is(token, "attribute-name") && code.substr(-1).match(/^\s$/)) {
+                }
+                else if (is(token, "attribute-name") && code.substr(-1).match(/^\s$/)) {
                     spaceBefore = true;
-                } else if (is(token, "attribute-equals")) {
+                }
+                else if (is(token, "attribute-equals")) {
                     trimLine();
                     trimNext();
-                } else if (is(token, "tag-close")) {
+                }
+                else if (is(token, "tag-close")) {
                     trimLine();
-                    if(value === "/>")
+                    if (value === "/>")
                         spaceBefore = true;
                 }
-                if (breakBefore && !(token.type.match(/^(comment)$/) && !value.substr(0, 1).match(/^[/#]$/)) && !(token.type.match(/^(string)$/) && !value.substr(0, 1).match(/^['"]$/))) {
-
+                else if (token.type === "keyword" && value.match(/^(case|default)$/)) {
+                    if (caseBody)
+                        unindent = 1;
+                }
+                if (breakBefore && !(token.type.match(/^(comment)$/) && !value.substr(0, 1).match(/^[/#]$/)) && !(token.type.match(/^(string)$/) && !value.substr(0, 1).match(/^['"@]$/))) {
                     indent = lastIndent;
-
-                    if(depth > lastDepth) {
+                    if (depth > lastDepth) {
                         indent++;
-
-                        for (i=depth; i > lastDepth; i--)
+                        for (i = depth; i > lastDepth; i--)
                             levels[i] = indent;
-                    } else if(depth < lastDepth)
+                    }
+                    else if (depth < lastDepth)
                         indent = levels[depth];
-
                     lastDepth = depth;
                     lastIndent = indent;
-
-                    if(unindent)
+                    if (unindent)
                         indent -= unindent;
-
                     if (indentNextLine && !roundDepth) {
                         indent++;
                         indentNextLine = false;
                     }
-
                     for (i = 0; i < indent; i++)
                         code += tabString;
                 }
-
-
                 if (token.type === "keyword" && value.match(/^(case|default)$/)) {
-                    parents[depth] = value;
-                    depth++;
+                    if (caseBody === false) {
+                        parents[depth] = value;
+                        depth++;
+                        caseBody = true;
+                    }
                 }
-
-
-                if (token.type === "keyword" && value.match(/^(break)$/)) {
-                    if(parents[depth-1] && parents[depth-1].match(/^(case|default)$/)) {
+                else if (token.type === "keyword" && value.match(/^(break)$/)) {
+                    if (parents[depth - 1] && parents[depth - 1].match(/^(case|default)$/)) {
                         depth--;
+                        caseBody = false;
                     }
                 }
                 if (token.type === "paren.lparen") {
@@ -246,25 +254,22 @@ exports.beautify = function(session) {
                     curlyDepth += (value.match(/\{/g) || []).length;
                     depth += value.length;
                 }
-
                 if (token.type === "keyword" && value.match(/^(if|else|elseif|for|while)$/)) {
                     indentNextLine = true;
                     roundDepth = 0;
-                } else if (!roundDepth && value.trim() && token.type !== "comment")
+                }
+                else if (!roundDepth && value.trim() && token.type !== "comment")
                     indentNextLine = false;
-
                 if (token.type === "paren.rparen") {
                     roundDepth -= (value.match(/\)/g) || []).length;
                     curlyDepth -= (value.match(/\}/g) || []).length;
-
                     for (i = 0; i < value.length; i++) {
                         depth--;
-                        if(value.substr(i, 1)==='}' && parents[depth]==='case') {
+                        if (value.substr(i, 1) === '}' && parents[depth] === 'case') {
                             depth--;
                         }
                     }
                 }
-                
                 if (token.type == "text")
                     value = value.replace(/\s+$/, " ");
                 if (spaceBefore && !breakBefore) {
@@ -272,12 +277,9 @@ exports.beautify = function(session) {
                     if (code.substr(-1) !== "\n")
                         code += " ";
                 }
-
                 code += value;
-
                 if (spaceAfter)
                     code += " ";
-
                 breakBefore = false;
                 spaceBefore = false;
                 spaceAfter = false;
@@ -287,35 +289,36 @@ exports.beautify = function(session) {
                     else
                         rowsToAdd = 1;
                 }
-                if (is(token, "tag-open") && value === "</") {
-                    depth--;
-                } else if (is(token, "tag-open") && value === "<" && singletonTags.indexOf(nextToken.value) === -1) {
-                    depth++;
-                } else if (is(token, "tag-name")) {
+                if (nextToken && singletonTags.indexOf(nextToken.value) === -1) {
+                    if (is(token, "tag-open") && value === "</") {
+                        depth--;
+                    }
+                    else if (is(token, "tag-open") && value === "<") {
+                        depth++;
+                    }
+                    else if (is(token, "tag-close") && value === "/>") {
+                        depth--;
+                    }
+                }
+                if (is(token, "tag-name")) {
                     tagName = value;
-                } else if (is(token, "tag-close") && value === "/>" && singletonTags.indexOf(tagName) === -1){
-                    depth--;
                 }
-
                 row = curRow;
             }
         }
-
         token = nextToken;
     }
-
     code = code.trim();
     session.doc.setValue(code);
 };
-
 exports.commands = [{
-    name: "beautify",
-    description: "Format selection (Beautify)",
-    exec: function(editor) {
-        exports.beautify(editor.session);
-    },
-    bindKey: "Ctrl-Shift-B"
-}];
+        name: "beautify",
+        description: "Format selection (Beautify)",
+        exec: function (editor) {
+            exports.beautify(editor.session);
+        },
+        bindKey: "Ctrl-Shift-B"
+    }];
 
 });                (function() {
                     ace.require(["ace/ext/beautify"], function(m) {

+ 0 - 128
web/0ebc6c9681e409f2bf3bb6d8ce64e28e.js

@@ -1,128 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

File diff suppressed because it is too large
+ 0 - 0
web/103d2d5aeb83325c62e06eeb03ce110f.js


File diff suppressed because it is too large
+ 0 - 10
web/1084edaced97872890c9d87a9944cdcd.js


+ 0 - 125
web/10bc79414b62df132421027bbf5e5c3e.js

@@ -1,125 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 0 - 5931
web/117389396b5ae8131c2a299bfc802c7a.js

@@ -1,5931 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

File diff suppressed because it is too large
+ 22 - 33
web/1178a325160e7e86e4f86460128fc135.js


File diff suppressed because it is too large
+ 22 - 33
web/11f9366eb32d7444aebd0a897dcc4f79.js


+ 77 - 109
web/8f69fc81a83ba318eca7dbae6c6eba75.js → web/12738aa8461e4775d7f380a5d1953893.js

@@ -1,13 +1,10 @@
-ace.define("ace/mode/alda_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 AldaHighlightRules = function() {
-    
-        this.$rules = {
-            pitch: [{
+ace.define("ace/mode/alda_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from ../../src/alda.JSON-tmLanguage (uuid: ) */
+"use strict";
+var oop = require("../lib/oop");
+var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
+var AldaHighlightRules = function () {
+    this.$rules = {
+        pitch: [{
                 token: "variable.parameter.operator.pitch.alda",
                 regex: /(?:[+\-]+|\=)/
             }, {
@@ -15,7 +12,7 @@ ace.define("ace/mode/alda_highlight_rules",["require","exports","module","ace/li
                 regex: "",
                 next: "timing"
             }],
-            timing: [{
+        timing: [{
                 token: "string.quoted.operator.timing.alda",
                 regex: /\d+(?:s|ms)?/
             }, {
@@ -23,7 +20,7 @@ ace.define("ace/mode/alda_highlight_rules",["require","exports","module","ace/li
                 regex: "",
                 next: "start"
             }],
-            start: [{
+        start: [{
                 token: [
                     "constant.language.instrument.alda",
                     "constant.language.instrument.alda",
@@ -49,12 +46,12 @@ ace.define("ace/mode/alda_highlight_rules",["require","exports","module","ace/li
                 token: "comment.block.inline.alda",
                 regex: /\(comment\b/,
                 push: [{
-                    token: "comment.block.inline.alda",
-                    regex: /\)/,
-                    next: "pop"
-                }, {
-                    defaultToken: "comment.block.inline.alda"
-                }]
+                        token: "comment.block.inline.alda",
+                        regex: /\)/,
+                        next: "pop"
+                    }, {
+                        defaultToken: "comment.block.inline.alda"
+                    }]
             }, {
                 token: "entity.name.function.marker.alda",
                 regex: /%[a-zA-Z]{2}[\w\-+\'()]*/
@@ -73,7 +70,7 @@ ace.define("ace/mode/alda_highlight_rules",["require","exports","module","ace/li
             }, {
                 token: "string.quoted.operator.timing.alda",
                 regex: /[.]|r\d*(?:s|ms)?/
-            },{
+            }, {
                 token: "text",
                 regex: /([cdefgab])/,
                 next: "pitch"
@@ -93,138 +90,110 @@ ace.define("ace/mode/alda_highlight_rules",["require","exports","module","ace/li
                     token: "punctuation.section.embedded.cram.alda",
                     regex: /\{/,
                     push: [{
-                        token: "punctuation.section.embedded.cram.alda",
-                        regex: /\}/,
-                        next: "pop"
-                    }, {
-                        include: "$self"
-                    }]
+                            token: "punctuation.section.embedded.cram.alda",
+                            regex: /\}/,
+                            next: "pop"
+                        }, {
+                            include: "$self"
+                        }]
                 }
             }, {
                 todo: {
                     token: "keyword.control.sequence.alda",
                     regex: /\[/,
                     push: [{
-                        token: "keyword.control.sequence.alda",
-                        regex: /\]/,
-                        next: "pop"
-                    }, {
-                        include: "$self"
-                    }]
+                            token: "keyword.control.sequence.alda",
+                            regex: /\]/,
+                            next: "pop"
+                        }, {
+                            include: "$self"
+                        }]
                 }
             }, {
                 token: "meta.inline.clojure.alda",
                 regex: /\(/,
                 push: [{
-                    token: "meta.inline.clojure.alda",
-                    regex: /\)/,
-                    next: "pop"
-                }, {
-                    include: "source.clojure"
-                }, {
-                    defaultToken: "meta.inline.clojure.alda"
-                }]
+                        token: "meta.inline.clojure.alda",
+                        regex: /\)/,
+                        next: "pop"
+                    }, {
+                        include: "source.clojure"
+                    }, {
+                        defaultToken: "meta.inline.clojure.alda"
+                    }]
             }]
-        };
-        
-        this.normalizeRules();
     };
-    
-    AldaHighlightRules.metaData = {
-        scopeName: "source.alda",
-        fileTypes: ["alda"],
-        name: "Alda"
-    };
-    
-    
-    oop.inherits(AldaHighlightRules, TextHighlightRules);
-    
-    exports.AldaHighlightRules = AldaHighlightRules;
-    });
+    this.normalizeRules();
+};
+AldaHighlightRules.metaData = {
+    scopeName: "source.alda",
+    fileTypes: ["alda"],
+    name: "Alda"
+};
+oop.inherits(AldaHighlightRules, TextHighlightRules);
+exports.AldaHighlightRules = AldaHighlightRules;
 
-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;
@@ -237,70 +206,69 @@ 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/alda",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/alda_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {
+ace.define("ace/mode/alda",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/alda_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 AldaHighlightRules = require("./alda_highlight_rules").AldaHighlightRules;
 var FoldMode = require("./folding/cstyle").FoldMode;
-
-var Mode = function() {
+var Mode = function () {
     this.HighlightRules = AldaHighlightRules;
     this.foldingRules = new FoldMode();
 };
 oop.inherits(Mode, TextMode);
-
-(function() {
+(function () {
     this.$id = "ace/mode/alda";
 }).call(Mode.prototype);
-
 exports.Mode = Mode;
+
 });                (function() {
                     ace.require(["ace/mode/alda"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 0 - 23
web/1295d4470d348d3ff8ea442b1dcef3d3.js

@@ -1,23 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 0 - 257
web/1365ff3d277ebdab408e6aeec886cf08.js

@@ -1,257 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 0 - 40
web/144991c48dbba89bfe10e886aaaed32a.js

@@ -1,40 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 0 - 96
web/1570e695c448e6a4f3a6bdf0372b58f0.js

@@ -1,96 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 16 - 0
web/15bd2f4de9aefea698aea59ecd36327f.js

@@ -0,0 +1,16 @@
+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;
+                        }
+                    });
+                })();
+            

File diff suppressed because it is too large
+ 271 - 351
web/16274924d7152a77759b45dabd995ffa.js


+ 0 - 449
web/167a62ec377adafbeb4bbb1cef73250d.js

@@ -1,449 +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",           // ' 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;
-                        }
-                    });
-                })();
-            

File diff suppressed because it is too large
+ 226 - 267
web/1694f12f2e48f4b28754c37fd132c501.js


+ 126 - 214
web/dcb084d6aacfa517923dd3a94e3b9af5.js → web/16ae728a78f1cb04d40f77b322eb133d.js

@@ -1,272 +1,221 @@
-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", // doc comment
-        regex : "\\/\\*(?=\\*)",
-        next  : start
+        token: "comment.doc",
+        regex: "\\/\\*(?=\\*)",
+        next: start
     };
 };
-
 DocCommentHighlightRules.getEndRule = function (start) {
     return {
-        token : "comment.doc", // closing comment
-        regex : "\\*\\/",
-        next  : start
+        token: "comment.doc",
+        regex: "\\*\\/",
+        next: start
     };
 };
-
-
 exports.DocCommentHighlightRules = DocCommentHighlightRules;
 
 });
 
-ace.define("ace/mode/csharp_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/csharp_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 CSharpHighlightRules = function() {
+var CSharpHighlightRules = function () {
     var keywordMapper = this.createKeywordMapper({
         "variable.language": "this",
         "keyword": "abstract|async|await|event|new|struct|as|explicit|null|switch|base|extern|object|this|bool|false|operator|throw|break|finally|out|true|byte|fixed|override|try|case|float|params|typeof|catch|for|private|uint|char|foreach|protected|ulong|checked|goto|public|unchecked|class|if|readonly|unsafe|const|implicit|ref|ushort|continue|in|return|using|decimal|int|sbyte|virtual|default|interface|sealed|volatile|delegate|internal|partial|short|void|do|is|sizeof|while|double|lock|stackalloc|else|long|static|enum|namespace|string|var|dynamic",
         "constant.language": "null|true|false"
     }, "identifier");
-
     this.$rules = {
-        "start" : [
+        "start": [
             {
-                token : "comment",
-                regex : "\\/\\/.*$"
+                token: "comment",
+                regex: "\\/\\/.*$"
             },
             DocCommentHighlightRules.getStartRule("doc-start"),
             {
-                token : "comment", // multi line comment
-                regex : "\\/\\*",
-                next : "comment"
+                token: "comment",
+                regex: "\\/\\*",
+                next: "comment"
             }, {
-                token : "string", // character
-                regex : /'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))?'/
+                token: "string",
+                regex: /'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))?'/
             }, {
-                token : "string", start : '"', end : '"|$', next: [
-                    {token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/},
-                    {token: "invalid", regex: /\\./}
+                token: "string", start: '"', end: '"|$', next: [
+                    { token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/ },
+                    { token: "invalid", regex: /\\./ }
                 ]
             }, {
-                token : "string", start : '@"', end : '"', next:[
-                    {token: "constant.language.escape", regex: '""'}
+                token: "string", start: '@"', end: '"', next: [
+                    { token: "constant.language.escape", regex: '""' }
                 ]
             }, {
-                token : "string", start : /\$"/, end : '"|$', next: [
-                    {token: "constant.language.escape", regex: /\\(:?$)|{{/},
-                    {token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/},
-                    {token: "invalid", regex: /\\./}
+                token: "string", start: /\$"/, end: '"|$', next: [
+                    { token: "constant.language.escape", regex: /\\(:?$)|{{/ },
+                    { token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/ },
+                    { token: "invalid", regex: /\\./ }
                 ]
             }, {
-                token : "constant.numeric", // hex
-                regex : "0[xX][0-9a-fA-F]+\\b"
+                token: "constant.numeric",
+                regex: "0[xX][0-9a-fA-F]+\\b"
             }, {
-                token : "constant.numeric", // float
-                regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+                token: "constant.numeric",
+                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 : "keyword",
-                regex : "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)"
+                token: "keyword",
+                regex: "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)"
             }, {
-                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", // closing comment
-                regex : "\\*\\/",
-                next : "start"
+                token: "comment",
+                regex: "\\*\\/",
+                next: "start"
             }, {
-                defaultToken : "comment"
+                defaultToken: "comment"
             }
         ]
     };
-
-    this.embedRules(DocCommentHighlightRules, "doc-",
-        [ DocCommentHighlightRules.getEndRule("start") ]);
+    this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("start")]);
     this.normalizeRules();
 };
-
 oop.inherits(CSharpHighlightRules, TextHighlightRules);
-
 exports.CSharpHighlightRules = CSharpHighlightRules;
-});
 
-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;
-});
 
-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;
@@ -279,81 +228,71 @@ 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/folding/csharp",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/cstyle"], function(require, exports, module) {
-"use strict";
-
+ace.define("ace/mode/folding/csharp",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
 var oop = require("../../lib/oop");
 var Range = require("../../range").Range;
 var CFoldMode = require("./cstyle").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, CFoldMode);
-
-(function() {
+(function () {
     this.usingRe = /^\s*using \S/;
-
     this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
     this.getFoldWidgetBase = this.getFoldWidget;
-    
-    this.getFoldWidget = function(session, foldStyle, row) {
+    this.getFoldWidget = function (session, foldStyle, row) {
         var fw = this.getFoldWidgetBase(session, foldStyle, row);
         if (!fw) {
             var line = session.getLine(row);
-            if (/^\s*#region\b/.test(line)) 
+            if (/^\s*#region\b/.test(line))
                 return "start";
             var usingRe = this.usingRe;
             if (usingRe.test(line)) {
@@ -365,47 +304,38 @@ oop.inherits(FoldMode, CFoldMode);
         }
         return fw;
     };
-    
-    this.getFoldWidgetRange = function(session, foldStyle, row) {
+    this.getFoldWidgetRange = function (session, foldStyle, row) {
         var range = this.getFoldWidgetRangeBase(session, foldStyle, row);
         if (range)
             return range;
-
         var line = session.getLine(row);
         if (this.usingRe.test(line))
             return this.getUsingStatementBlock(session, line, row);
-            
         if (/^\s*#region\b/.test(line))
             return this.getRegionBlock(session, line, row);
     };
-    
-    this.getUsingStatementBlock = function(session, line, row) {
+    this.getUsingStatementBlock = function (session, line, row) {
         var startColumn = line.match(this.usingRe)[0].length - 1;
         var maxRow = session.getLength();
         var startRow = row;
         var endRow = row;
-
         while (++row < maxRow) {
             line = session.getLine(row);
             if (/^\s*$/.test(line))
                 continue;
             if (!this.usingRe.test(line))
                 break;
-
             endRow = row;
         }
-
         if (endRow > startRow) {
             var endColumn = session.getLine(endRow).length;
             return new Range(startRow, startColumn, endRow, endColumn);
         }
     };
-    
-    this.getRegionBlock = function(session, line, row) {
+    this.getRegionBlock = 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) {
@@ -417,81 +347,63 @@ oop.inherits(FoldMode, CFoldMode);
                 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/csharp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/csharp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/csharp"], function(require, exports, module) {
-"use strict";
-
+ace.define("ace/mode/csharp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/csharp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/csharp"], function(require, exports, module){"use strict";
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var CSharpHighlightRules = require("./csharp_highlight_rules").CSharpHighlightRules;
 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
 var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
 var CStyleFoldMode = require("./folding/csharp").FoldMode;
-
-var Mode = function() {
+var Mode = function () {
     this.HighlightRules = CSharpHighlightRules;
     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.createWorker = function(session) {
+    this.createWorker = function (session) {
         return null;
     };
-
     this.$id = "ace/mode/csharp";
 }).call(Mode.prototype);
-
 exports.Mode = Mode;
+
 });                (function() {
                     ace.require(["ace/mode/csharp"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 16 - 0
web/173ea2d9126a53f1d6cb61ef26219598.js

@@ -0,0 +1,16 @@
+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;
+                        }
+                    });
+                })();
+            

File diff suppressed because it is too large
+ 0 - 0
web/18b69bf761ab7d8645f68794096dcb46.js


+ 502 - 0
web/18b9a42de70da52144b223be58bb65c3.js

@@ -0,0 +1,502 @@
+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;
+                        }
+                    });
+                })();
+            

+ 0 - 148
web/19573d26f286762809b86f935516c1ac.js

@@ -1,148 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 0 - 135
web/1afbeca385b131cfc3ae515b89e552c7.js

@@ -1,135 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 177 - 246
web/d7cdf8e31755f70cd564c742feec3be0.js → web/1bd8ec07cab7c3b9e5e00671ed6ddcd5.js

@@ -1,68 +1,47 @@
-ace.define("ace/mode/fortran_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+ace.define("ace/mode/fortran_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* Derived from Python highlighing rules */
 "use strict";
-
 var oop = require("../lib/oop");
 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
-
-var FortranHighlightRules = function() {
-
-    var keywords = (
-        "call|case|contains|continue|cycle|do|else|elseif|end|enddo|endif|function|"+ 
-        "if|implicit|in|include|inout|intent|module|none|only|out|print|program|return|"+ 
+var FortranHighlightRules = function () {
+    var keywords = ("call|case|contains|continue|cycle|do|else|elseif|end|enddo|endif|function|" +
+        "if|implicit|in|include|inout|intent|module|none|only|out|print|program|return|" +
         "select|status|stop|subroutine|" +
-        "return|then|use|while|write|"+
-        "CALL|CASE|CONTAINS|CONTINUE|CYCLE|DO|ELSE|ELSEIF|END|ENDDO|ENDIF|FUNCTION|"+
-        "IF|IMPLICIT|IN|INCLUDE|INOUT|INTENT|MODULE|NONE|ONLY|OUT|PRINT|PROGRAM|RETURN|"+
+        "return|then|use|while|write|" +
+        "CALL|CASE|CONTAINS|CONTINUE|CYCLE|DO|ELSE|ELSEIF|END|ENDDO|ENDIF|FUNCTION|" +
+        "IF|IMPLICIT|IN|INCLUDE|INOUT|INTENT|MODULE|NONE|ONLY|OUT|PRINT|PROGRAM|RETURN|" +
         "SELECT|STATUS|STOP|SUBROUTINE|" +
-        "RETURN|THEN|USE|WHILE|WRITE"
-    );
-
-    var keywordOperators = (
-        "and|or|not|eq|ne|gt|ge|lt|le|" +
-        "AND|OR|NOT|EQ|NE|GT|GE|LT|LE" 
-    );
-
-    var builtinConstants = (
-        "true|false|TRUE|FALSE"
-    );
-
-    var builtinFunctions = (
-        "abs|achar|acos|acosh|adjustl|adjustr|aimag|aint|all|allocate|"+
-        "anint|any|asin|asinh|associated|atan|atan2|atanh|"+
-        "bessel_j0|bessel_j1|bessel_jn|bessel_y0|bessel_y1|bessel_yn|"+
-        "bge|bgt|bit_size|ble|blt|btest|ceiling|char|cmplx|conjg|cos|cosh|"+
-        "count|cpu_time|cshift|date_and_time|dble|deallocate|digits|dim|dot_product|dprod|"+
-        "dshiftl|dshiftr|dsqrt|eoshift|epsilon|erf|erfc|erfc_scaled|exp|float|floor|"+
-        "format|fraction|gamma|input|len|lge|lgt|lle|llt|log|log10|maskl|maskr|matmul|max|maxloc|maxval|"+
-        "merge|min|minloc|minval|mod|modulo|nint|not|norm2|null|nullify|pack|parity|popcnt|poppar|"+
-        "precision|present|product|radix|random_number|random_seed|range|repeat|reshape|round|"+
-        "rrspacing|same_type_as|scale|scan|selected_char_kind|selected_int_kind|selected_real_kind|"+
-        "set_exponent|shape|shifta|shiftl|shiftr|sign|sin|sinh|size|sngl|spacing|spread|"+
+        "RETURN|THEN|USE|WHILE|WRITE");
+    var keywordOperators = ("and|or|not|eq|ne|gt|ge|lt|le|" +
+        "AND|OR|NOT|EQ|NE|GT|GE|LT|LE");
+    var builtinConstants = ("true|false|TRUE|FALSE");
+    var builtinFunctions = ("abs|achar|acos|acosh|adjustl|adjustr|aimag|aint|all|allocate|" +
+        "anint|any|asin|asinh|associated|atan|atan2|atanh|" +
+        "bessel_j0|bessel_j1|bessel_jn|bessel_y0|bessel_y1|bessel_yn|" +
+        "bge|bgt|bit_size|ble|blt|btest|ceiling|char|cmplx|conjg|cos|cosh|" +
+        "count|cpu_time|cshift|date_and_time|dble|deallocate|digits|dim|dot_product|dprod|" +
+        "dshiftl|dshiftr|dsqrt|eoshift|epsilon|erf|erfc|erfc_scaled|exp|float|floor|" +
+        "format|fraction|gamma|input|len|lge|lgt|lle|llt|log|log10|maskl|maskr|matmul|max|maxloc|maxval|" +
+        "merge|min|minloc|minval|mod|modulo|nint|not|norm2|null|nullify|pack|parity|popcnt|poppar|" +
+        "precision|present|product|radix|random_number|random_seed|range|repeat|reshape|round|" +
+        "rrspacing|same_type_as|scale|scan|selected_char_kind|selected_int_kind|selected_real_kind|" +
+        "set_exponent|shape|shifta|shiftl|shiftr|sign|sin|sinh|size|sngl|spacing|spread|" +
         "sqrt|sum|system_clock|tan|tanh|tiny|trailz|transfer|transpose|trim|ubound|unpack|verify|" +
-        "ABS|ACHAR|ACOS|ACOSH|ADJUSTL|ADJUSTR|AIMAG|AINT|ALL|ALLOCATE|"+
-        "ANINT|ANY|ASIN|ASINH|ASSOCIATED|ATAN|ATAN2|ATANH|"+
-        "BESSEL_J0|BESSEL_J1|BESSEL_JN|BESSEL_Y0|BESSEL_Y1|BESSEL_YN|"+
-        "BGE|BGT|BIT_SIZE|BLE|BLT|BTEST|CEILING|CHAR|CMPLX|CONJG|COS|COSH|"+
-        "COUNT|CPU_TIME|CSHIFT|DATE_AND_TIME|DBLE|DEALLOCATE|DIGITS|DIM|DOT_PRODUCT|DPROD|"+
-        "DSHIFTL|DSHIFTR|DSQRT|EOSHIFT|EPSILON|ERF|ERFC|ERFC_SCALED|EXP|FLOAT|FLOOR|"+
-        "FORMAT|FRACTION|GAMMA|INPUT|LEN|LGE|LGT|LLE|LLT|LOG|LOG10|MASKL|MASKR|MATMUL|MAX|MAXLOC|MAXVAL|"+
-        "MERGE|MIN|MINLOC|MINVAL|MOD|MODULO|NINT|NOT|NORM2|NULL|NULLIFY|PACK|PARITY|POPCNT|POPPAR|"+
-        "PRECISION|PRESENT|PRODUCT|RADIX|RANDOM_NUMBER|RANDOM_SEED|RANGE|REPEAT|RESHAPE|ROUND|"+
-        "RRSPACING|SAME_TYPE_AS|SCALE|SCAN|SELECTED_CHAR_KIND|SELECTED_INT_KIND|SELECTED_REAL_KIND|"+
-        "SET_EXPONENT|SHAPE|SHIFTA|SHIFTL|SHIFTR|SIGN|SIN|SINH|SIZE|SNGL|SPACING|SPREAD|"+
-        "SQRT|SUM|SYSTEM_CLOCK|TAN|TANH|TINY|TRAILZ|TRANSFER|TRANSPOSE|TRIM|UBOUND|UNPACK|VERIFY"
-    );
-
-    var storageType = (
-        "logical|character|integer|real|type|" +
-        "LOGICAL|CHARACTER|INTEGER|REAL|TYPE"    
-    );
-
-    var storageModifiers = ( 
-        "allocatable|dimension|intent|parameter|pointer|target|private|public|" +
-        "ALLOCATABLE|DIMENSION|INTENT|PARAMETER|POINTER|TARGET|PRIVATE|PUBLIC"
-    );
-
+        "ABS|ACHAR|ACOS|ACOSH|ADJUSTL|ADJUSTR|AIMAG|AINT|ALL|ALLOCATE|" +
+        "ANINT|ANY|ASIN|ASINH|ASSOCIATED|ATAN|ATAN2|ATANH|" +
+        "BESSEL_J0|BESSEL_J1|BESSEL_JN|BESSEL_Y0|BESSEL_Y1|BESSEL_YN|" +
+        "BGE|BGT|BIT_SIZE|BLE|BLT|BTEST|CEILING|CHAR|CMPLX|CONJG|COS|COSH|" +
+        "COUNT|CPU_TIME|CSHIFT|DATE_AND_TIME|DBLE|DEALLOCATE|DIGITS|DIM|DOT_PRODUCT|DPROD|" +
+        "DSHIFTL|DSHIFTR|DSQRT|EOSHIFT|EPSILON|ERF|ERFC|ERFC_SCALED|EXP|FLOAT|FLOOR|" +
+        "FORMAT|FRACTION|GAMMA|INPUT|LEN|LGE|LGT|LLE|LLT|LOG|LOG10|MASKL|MASKR|MATMUL|MAX|MAXLOC|MAXVAL|" +
+        "MERGE|MIN|MINLOC|MINVAL|MOD|MODULO|NINT|NOT|NORM2|NULL|NULLIFY|PACK|PARITY|POPCNT|POPPAR|" +
+        "PRECISION|PRESENT|PRODUCT|RADIX|RANDOM_NUMBER|RANDOM_SEED|RANGE|REPEAT|RESHAPE|ROUND|" +
+        "RRSPACING|SAME_TYPE_AS|SCALE|SCAN|SELECTED_CHAR_KIND|SELECTED_INT_KIND|SELECTED_REAL_KIND|" +
+        "SET_EXPONENT|SHAPE|SHIFTA|SHIFTL|SHIFTR|SIGN|SIN|SINH|SIZE|SNGL|SPACING|SPREAD|" +
+        "SQRT|SUM|SYSTEM_CLOCK|TAN|TANH|TINY|TRAILZ|TRANSFER|TRANSPOSE|TRIM|UBOUND|UNPACK|VERIFY");
+    var storageType = ("logical|character|integer|real|type|" +
+        "LOGICAL|CHARACTER|INTEGER|REAL|TYPE");
+    var storageModifiers = ("allocatable|dimension|intent|parameter|pointer|target|private|public|" +
+        "ALLOCATABLE|DIMENSION|INTENT|PARAMETER|POINTER|TARGET|PRIVATE|PUBLIC");
     var keywordMapper = this.createKeywordMapper({
         "invalid.deprecated": "debugger",
         "support.function": builtinFunctions,
@@ -70,219 +49,189 @@ var FortranHighlightRules = function() {
         "keyword": keywords,
         "keyword.operator": keywordOperators,
         "storage.type": storageType,
-        "storage.modifier" : storageModifiers
+        "storage.modifier": storageModifiers
     }, "identifier");
-
     var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?";
-
     var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
     var octInteger = "(?:0[oO]?[0-7]+)";
     var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
     var binInteger = "(?:0[bB][01]+)";
     var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")";
-
     var exponent = "(?:[eE][+-]?\\d+)";
     var fraction = "(?:\\.\\d+)";
     var intPart = "(?:\\d+)";
     var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
-    var exponentFloat = "(?:(?:" + pointFloat + "|" +  intPart + ")" + exponent + ")";
+    var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")";
     var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
-
-    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 stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";
     this.$rules = {
-        "start" : [ {
-            token : "comment",
-            regex : "!.*$"
-        }, {
-            token : "string",           // multi line """ string start
-            regex : strPre + '"{3}',
-            next : "qqstring3"
-        }, {
-            token : "string",           // " string
-            regex : strPre + '"(?=.)',
-            next : "qqstring"
-        }, {
-            token : "string",           // multi line ''' string start
-            regex : strPre + "'{3}",
-            next : "qstring3"
-        }, {
-            token : "string",           // ' string
-            regex : strPre + "'(?=.)",
-            next : "qstring"
-        }, {
-            token : "constant.numeric", // imaginary
-            regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b"
-        }, {
-            token : "constant.numeric", // float
-            regex : floatNumber
-        }, {
-            token : "constant.numeric", // long integer
-            regex : integer + "[lL]\\b"
-        }, {
-            token : "constant.numeric", // integer
-            regex : integer + "\\b"
-        }, {
-            token : "keyword", // pre-compiler directives
-            regex : "#\\s*(?:include|import|define|undef|INCLUDE|IMPORT|DEFINE|UNDEF)\\b"
-        }, {
-            token : "keyword", // special case pre-compiler directive
-            regex : "#\\s*(?:endif|ifdef|else|elseif|ifndef|ENDIF|IFDEF|ELSE|ELSEIF|IFNDEF)\\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+"
-        } ],
-        "qqstring3" : [ {
-            token : "constant.language.escape",
-            regex : stringEscape
-        }, {
-            token : "string", // multi line """ string end
-            regex : '"{3}',
-            next : "start"
-        }, {
-            defaultToken : "string"
-        } ],
-        "qstring3" : [ {
-            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"
-        }],
-        "qstring" : [{
-            token : "constant.language.escape",
-            regex : stringEscape
-        }, {
-            token : "string",
-            regex : "\\\\$",
-            next  : "qstring"
-        }, {
-            token : "string",
-            regex : "'|$",
-            next  : "start"
-        }, {
-            defaultToken: "string"
-        }]
+        "start": [{
+                token: "comment",
+                regex: "!.*$"
+            }, {
+                token: "string",
+                regex: strPre + '"{3}',
+                next: "qqstring3"
+            }, {
+                token: "string",
+                regex: strPre + '"(?=.)',
+                next: "qqstring"
+            }, {
+                token: "string",
+                regex: strPre + "'{3}",
+                next: "qstring3"
+            }, {
+                token: "string",
+                regex: strPre + "'(?=.)",
+                next: "qstring"
+            }, {
+                token: "constant.numeric",
+                regex: "(?:" + floatNumber + "|\\d+)[jJ]\\b"
+            }, {
+                token: "constant.numeric",
+                regex: floatNumber
+            }, {
+                token: "constant.numeric",
+                regex: integer + "[lL]\\b"
+            }, {
+                token: "constant.numeric",
+                regex: integer + "\\b"
+            }, {
+                token: "keyword",
+                regex: "#\\s*(?:include|import|define|undef|INCLUDE|IMPORT|DEFINE|UNDEF)\\b"
+            }, {
+                token: "keyword",
+                regex: "#\\s*(?:endif|ifdef|else|elseif|ifndef|ENDIF|IFDEF|ELSE|ELSEIF|IFNDEF)\\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+"
+            }],
+        "qqstring3": [{
+                token: "constant.language.escape",
+                regex: stringEscape
+            }, {
+                token: "string",
+                regex: '"{3}',
+                next: "start"
+            }, {
+                defaultToken: "string"
+            }],
+        "qstring3": [{
+                token: "constant.language.escape",
+                regex: stringEscape
+            }, {
+                token: "string",
+                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"
+            }],
+        "qstring": [{
+                token: "constant.language.escape",
+                regex: stringEscape
+            }, {
+                token: "string",
+                regex: "\\\\$",
+                next: "qstring"
+            }, {
+                token: "string",
+                regex: "'|$",
+                next: "start"
+            }, {
+                defaultToken: "string"
+            }]
     };
 };
-
 oop.inherits(FortranHighlightRules, TextHighlightRules);
-
 exports.FortranHighlightRules = FortranHighlightRules;
-});
 
-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;
@@ -295,91 +244,81 @@ 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/fortran",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/fortran_highlight_rules","ace/mode/folding/cstyle","ace/range"], function(require, exports, module) {
+ace.define("ace/mode/fortran",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/fortran_highlight_rules","ace/mode/folding/cstyle","ace/range"], function(require, exports, module){/* Derived from Python rules */
 "use strict";
-
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var FortranHighlightRules = require("./fortran_highlight_rules").FortranHighlightRules;
 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
 var Range = require("../range").Range;
-
-var Mode = function() {
+var Mode = function () {
     this.HighlightRules = FortranHighlightRules;
     this.foldingRules = new CStyleFoldMode();
     this.$behaviour = this.$defaultBehaviour;
 };
 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);
-
         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;
     };
-
     var outdents = {
         "return": 1,
         "break": 1,
@@ -388,38 +327,30 @@ oop.inherits(Mode, TextMode);
         "BREAK": 1,
         "CONTINUE": 1
     };
-
-    this.checkOutdent = function(state, line, input) {
+    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) {
-
+    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));
+            doc.remove(new Range(row, indent.length - tab.length, row, indent.length));
     };
-
     this.$id = "ace/mode/fortran";
 }).call(Mode.prototype);
-
 exports.Mode = Mode;
+
 });                (function() {
                     ace.require(["ace/mode/fortran"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 152 - 211
web/434a5902436fc0f4bac913f7ae1471c6.js → web/1c396939d503de7cc34ff9e809ed92ee.js

@@ -1,47 +1,34 @@
-ace.define("ace/mode/lua_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
-"use strict";
-
+ace.define("ace/mode/lua_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 LuaHighlightRules = function() {
-
-    var keywords = (
-        "break|do|else|elseif|end|for|function|if|in|local|repeat|"+
-         "return|then|until|while|or|and|not"
-    );
-
+var LuaHighlightRules = function () {
+    var keywords = ("break|do|else|elseif|end|for|function|if|in|local|repeat|" +
+        "return|then|until|while|or|and|not");
     var builtinConstants = ("true|false|nil|_G|_VERSION");
-
     var functions = (
-        "string|xpcall|package|tostring|print|os|unpack|require|"+
-        "getfenv|setmetatable|next|assert|tonumber|io|rawequal|"+
-        "collectgarbage|getmetatable|module|rawset|math|debug|"+
-        "pcall|table|newproxy|type|coroutine|_G|select|gcinfo|"+
-        "pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|"+
-        "load|error|loadfile|"+
-
-        "sub|upper|len|gfind|rep|find|match|char|dump|gmatch|"+
-        "reverse|byte|format|gsub|lower|preload|loadlib|loaded|"+
-        "loaders|cpath|config|path|seeall|exit|setlocale|date|"+
-        "getenv|difftime|remove|time|clock|tmpname|rename|execute|"+
-        "lines|write|close|flush|open|output|type|read|stderr|"+
-        "stdin|input|stdout|popen|tmpfile|log|max|acos|huge|"+
-        "ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|"+
-        "frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|"+
-        "atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|"+
-        "gethook|setmetatable|setlocal|traceback|setfenv|getinfo|"+
-        "setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|"+
-        "foreachi|maxn|foreach|concat|sort|remove|resume|yield|"+
-        "status|wrap|create|running|"+
-        "__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|"+
-         "__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber"
-    );
-
+    "string|xpcall|package|tostring|print|os|unpack|require|" +
+        "getfenv|setmetatable|next|assert|tonumber|io|rawequal|" +
+        "collectgarbage|getmetatable|module|rawset|math|debug|" +
+        "pcall|table|newproxy|type|coroutine|_G|select|gcinfo|" +
+        "pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|" +
+        "load|error|loadfile|" +
+        "sub|upper|len|gfind|rep|find|match|char|dump|gmatch|" +
+        "reverse|byte|format|gsub|lower|preload|loadlib|loaded|" +
+        "loaders|cpath|config|path|seeall|exit|setlocale|date|" +
+        "getenv|difftime|remove|time|clock|tmpname|rename|execute|" +
+        "lines|write|close|flush|open|output|type|read|stderr|" +
+        "stdin|input|stdout|popen|tmpfile|log|max|acos|huge|" +
+        "ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|" +
+        "frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|" +
+        "atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|" +
+        "gethook|setmetatable|setlocal|traceback|setfenv|getinfo|" +
+        "setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|" +
+        "foreachi|maxn|foreach|concat|sort|remove|resume|yield|" +
+        "status|wrap|create|running|" +
+        "__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|" +
+        "__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber");
     var stdLibaries = ("string|package|os|io|math|debug|table|coroutine");
-
     var deprecatedIn5152 = ("setn|foreach|foreachi|gcinfo|log10|maxn");
-
     var keywordMapper = this.createKeywordMapper({
         "keyword": keywords,
         "support.function": functions,
@@ -50,136 +37,122 @@ var LuaHighlightRules = function() {
         "constant.language": builtinConstants,
         "variable.language": "self"
     }, "identifier");
-
     var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
     var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
     var integer = "(?:" + decimalInteger + "|" + hexInteger + ")";
-
     var fraction = "(?:\\.\\d+)";
     var intPart = "(?:\\d+)";
     var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
     var floatNumber = "(?:" + pointFloat + ")";
-
     this.$rules = {
-        "start" : [{
-            stateName: "bracketedComment",
-            onMatch : function(value, currentState, stack){
-                stack.unshift(this.next, value.length - 2, currentState);
-                return "comment";
+        "start": [{
+                stateName: "bracketedComment",
+                onMatch: function (value, currentState, stack) {
+                    stack.unshift(this.next, value.length - 2, currentState);
+                    return "comment";
+                },
+                regex: /\-\-\[=*\[/,
+                next: [
+                    {
+                        onMatch: function (value, currentState, stack) {
+                            if (value.length == stack[1]) {
+                                stack.shift();
+                                stack.shift();
+                                this.next = stack.shift();
+                            }
+                            else {
+                                this.next = "";
+                            }
+                            return "comment";
+                        },
+                        regex: /\]=*\]/,
+                        next: "start"
+                    }, {
+                        defaultToken: "comment"
+                    }
+                ]
             },
-            regex : /\-\-\[=*\[/,
-            next  : [
-                {
-                    onMatch : function(value, currentState, stack) {
-                        if (value.length == stack[1]) {
-                            stack.shift();
-                            stack.shift();
-                            this.next = stack.shift();
-                        } else {
-                            this.next = "";
-                        }
-                        return "comment";
-                    },
-                    regex : /\]=*\]/,
-                    next  : "start"
-                }, {
-                    defaultToken : "comment"
-                }
-            ]
-        },
-
-        {
-            token : "comment",
-            regex : "\\-\\-.*$"
-        },
-        {
-            stateName: "bracketedString",
-            onMatch : function(value, currentState, stack){
-                stack.unshift(this.next, value.length, currentState);
-                return "string.start";
+            {
+                token: "comment",
+                regex: "\\-\\-.*$"
             },
-            regex : /\[=*\[/,
-            next  : [
-                {
-                    onMatch : function(value, currentState, stack) {
-                        if (value.length == stack[1]) {
-                            stack.shift();
-                            stack.shift();
-                            this.next = stack.shift();
-                        } else {
-                            this.next = "";
-                        }
-                        return "string.end";
-                    },
-                    
-                    regex : /\]=*\]/,
-                    next  : "start"
-                }, {
-                    defaultToken : "string"
-                }
-            ]
-        },
-        {
-            token : "string",           // " string
-            regex : '"(?:[^\\\\]|\\\\.)*?"'
-        }, {
-            token : "string",           // ' string
-            regex : "'(?:[^\\\\]|\\\\.)*?'"
-        }, {
-            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 : "paren.lparen",
-            regex : "[\\[\\(\\{]"
-        }, {
-            token : "paren.rparen",
-            regex : "[\\]\\)\\}]"
-        }, {
-            token : "text",
-            regex : "\\s+|\\w+"
-        } ]
+            {
+                stateName: "bracketedString",
+                onMatch: function (value, currentState, stack) {
+                    stack.unshift(this.next, value.length, currentState);
+                    return "string.start";
+                },
+                regex: /\[=*\[/,
+                next: [
+                    {
+                        onMatch: function (value, currentState, stack) {
+                            if (value.length == stack[1]) {
+                                stack.shift();
+                                stack.shift();
+                                this.next = stack.shift();
+                            }
+                            else {
+                                this.next = "";
+                            }
+                            return "string.end";
+                        },
+                        regex: /\]=*\]/,
+                        next: "start"
+                    }, {
+                        defaultToken: "string"
+                    }
+                ]
+            },
+            {
+                token: "string",
+                regex: '"(?:[^\\\\]|\\\\.)*?"'
+            }, {
+                token: "string",
+                regex: "'(?:[^\\\\]|\\\\.)*?'"
+            }, {
+                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: "paren.lparen",
+                regex: "[\\[\\(\\{]"
+            }, {
+                token: "paren.rparen",
+                regex: "[\\]\\)\\}]"
+            }, {
+                token: "text",
+                regex: "\\s+|\\w+"
+            }]
     };
-    
     this.normalizeRules();
 };
-
 oop.inherits(LuaHighlightRules, TextHighlightRules);
-
 exports.LuaHighlightRules = LuaHighlightRules;
-});
 
-ace.define("ace/mode/folding/lua",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], function(require, exports, module) {
-"use strict";
+});
 
+ace.define("ace/mode/folding/lua",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], function(require, exports, module){"use strict";
 var oop = require("../../lib/oop");
 var BaseFoldMode = require("./fold_mode").FoldMode;
 var Range = require("../../range").Range;
 var TokenIterator = require("../../token_iterator").TokenIterator;
-
-
-var FoldMode = exports.FoldMode = function() {};
-
+var FoldMode = exports.FoldMode = function () { };
 oop.inherits(FoldMode, BaseFoldMode);
-
-(function() {
-
+(function () {
     this.foldingStartMarker = /\b(function|then|do|repeat)\b|{\s*$|(\[=*\[)/;
     this.foldingStopMarker = /\bend\b|^\s*}|\]=*\]/;
-
-    this.getFoldWidget = function(session, foldStyle, row) {
+    this.getFoldWidget = function (session, foldStyle, row) {
         var line = session.getLine(row);
         var isStart = this.foldingStartMarker.test(line);
         var isEnd = this.foldingStopMarker.test(line);
-
         if (isStart && !isEnd) {
             var match = line.match(this.foldingStartMarker);
             if (match[1] == "then" && /\belseif\b/.test(line))
@@ -187,57 +160,53 @@ oop.inherits(FoldMode, BaseFoldMode);
             if (match[1]) {
                 if (session.getTokenAt(row, match.index + 1).type === "keyword")
                     return "start";
-            } else if (match[2]) {
+            }
+            else if (match[2]) {
                 var type = session.bgTokenizer.getState(row) || "";
                 if (type[0] == "bracketedComment" || type[0] == "bracketedString")
                     return "start";
-            } else {
+            }
+            else {
                 return "start";
             }
         }
         if (foldStyle != "markbeginend" || !isEnd || isStart && isEnd)
             return "";
-
         var match = line.match(this.foldingStopMarker);
         if (match[0] === "end") {
             if (session.getTokenAt(row, match.index + 1).type === "keyword")
                 return "end";
-        } else if (match[0][0] === "]") {
+        }
+        else if (match[0][0] === "]") {
             var type = session.bgTokenizer.getState(row - 1) || "";
             if (type[0] == "bracketedComment" || type[0] == "bracketedString")
                 return "end";
-        } else
+        }
+        else
             return "end";
     };
-
-    this.getFoldWidgetRange = function(session, foldStyle, row) {
+    this.getFoldWidgetRange = function (session, foldStyle, row) {
         var line = session.doc.getLine(row);
         var match = this.foldingStartMarker.exec(line);
         if (match) {
             if (match[1])
                 return this.luaBlock(session, row, match.index + 1);
-
             if (match[2])
                 return session.getCommentFoldRange(row, match.index + 1);
-
             return this.openingBracketBlock(session, "{", row, match.index);
         }
-
         var match = this.foldingStopMarker.exec(line);
         if (match) {
             if (match[0] === "end") {
                 if (session.getTokenAt(row, match.index + 1).type === "keyword")
                     return this.luaBlock(session, row, match.index + 1);
             }
-
             if (match[0][0] === "]")
                 return session.getCommentFoldRange(row, match.index + 1);
-
             return this.closingBracketBlock(session, "}", row, match.index + match[0].length);
         }
     };
-
-    this.luaBlock = function(session, row, column, tokenRange) {
+    this.luaBlock = function (session, row, column, tokenRange) {
         var stream = new TokenIterator(session, row, column);
         var indentKeywords = {
             "function": 1,
@@ -248,30 +217,25 @@ oop.inherits(FoldMode, BaseFoldMode);
             "repeat": 1,
             "until": -1
         };
-
         var token = stream.getCurrentToken();
         if (!token || token.type != "keyword")
             return;
-
         var val = token.value;
         var stack = [val];
         var dir = indentKeywords[val];
-
         if (!dir)
             return;
-
         var startColumn = dir === -1 ? stream.getCurrentTokenColumn() : session.getLine(row).length;
         var startRow = row;
-
         stream.step = dir === -1 ? stream.stepBackward : stream.stepForward;
-        while(token = stream.step()) {
+        while (token = stream.step()) {
             if (token.type !== "keyword")
                 continue;
             var level = dir * indentKeywords[token.value];
-
             if (level > 0) {
                 stack.unshift(token.value);
-            } else if (level <= 0) {
+            }
+            else if (level <= 0) {
                 stack.shift();
                 if (!stack.length && token.value != "elseif")
                     break;
@@ -279,47 +243,36 @@ oop.inherits(FoldMode, BaseFoldMode);
                     stack.unshift(token.value);
             }
         }
-
         if (!token)
             return null;
-
         if (tokenRange)
             return stream.getCurrentTokenRange();
-
         var row = stream.getCurrentTokenRow();
         if (dir === -1)
             return new Range(row, session.getLine(row).length, startRow, startColumn);
         else
             return new Range(startRow, startColumn, row, stream.getCurrentTokenColumn());
     };
-
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/lua",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lua_highlight_rules","ace/mode/folding/lua","ace/range","ace/worker/worker_client"], function(require, exports, module) {
-"use strict";
-
+ace.define("ace/mode/lua",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lua_highlight_rules","ace/mode/folding/lua","ace/range","ace/worker/worker_client"], function(require, exports, module){"use strict";
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules;
 var LuaFoldMode = require("./folding/lua").FoldMode;
 var Range = require("../range").Range;
 var WorkerClient = require("../worker/worker_client").WorkerClient;
-
-var Mode = function() {
+var Mode = function () {
     this.HighlightRules = LuaHighlightRules;
-    
     this.foldingRules = new LuaFoldMode();
     this.$behaviour = this.$defaultBehaviour;
 };
 oop.inherits(Mode, TextMode);
-
-(function() {
-   
+(function () {
     this.lineCommentStart = "--";
-    this.blockComment = {start: "--[", end: "]--"};
-    
+    this.blockComment = { start: "--[[", end: "--]]" };
     var indentKeywords = {
         "function": 1,
         "then": 1,
@@ -336,7 +289,6 @@ oop.inherits(Mode, TextMode);
         "end",
         "until"
     ];
-
     function getNetIndentLevel(tokens) {
         var level = 0;
         for (var i = 0; i < tokens.length; i++) {
@@ -345,103 +297,92 @@ oop.inherits(Mode, TextMode);
                 if (token.value in indentKeywords) {
                     level += indentKeywords[token.value];
                 }
-            } else if (token.type == "paren.lparen") {
+            }
+            else if (token.type == "paren.lparen") {
                 level += token.value.length;
-            } else if (token.type == "paren.rparen") {
+            }
+            else if (token.type == "paren.rparen") {
                 level -= token.value.length;
             }
         }
         if (level < 0) {
             return -1;
-        } else if (level > 0) {
+        }
+        else if (level > 0) {
             return 1;
-        } else {
+        }
+        else {
             return 0;
         }
     }
-
-    this.getNextLineIndent = function(state, line, tab) {
+    this.getNextLineIndent = function (state, line, tab) {
         var indent = this.$getIndent(line);
         var level = 0;
-
         var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
         var tokens = tokenizedLine.tokens;
-
         if (state == "start") {
             level = getNetIndentLevel(tokens);
         }
         if (level > 0) {
             return indent + tab;
-        } else if (level < 0 && indent.substr(indent.length - tab.length) == tab) {
+        }
+        else if (level < 0 && indent.substr(indent.length - tab.length) == tab) {
             if (!this.checkOutdent(state, line, "\n")) {
                 return indent.substr(0, indent.length - tab.length);
             }
         }
         return indent;
     };
-
-    this.checkOutdent = function(state, line, input) {
+    this.checkOutdent = function (state, line, input) {
         if (input != "\n" && input != "\r" && input != "\r\n")
             return false;
-
         if (line.match(/^\s*[\)\}\]]$/))
             return true;
-
         var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
-
         if (!tokens || !tokens.length)
             return false;
-
         return (tokens[0].type == "keyword" && outdentKeywords.indexOf(tokens[0].value) != -1);
     };
-
-    this.getMatching = function(session, row, column) {
+    this.getMatching = function (session, row, column) {
         if (row == undefined) {
             var pos = session.selection.lead;
             column = pos.column;
             row = pos.row;
         }
-
         var startToken = session.getTokenAt(row, column);
         if (startToken && startToken.value in indentKeywords)
             return this.foldingRules.luaBlock(session, row, column, true);
     };
-
-    this.autoOutdent = function(state, session, row) {
+    this.autoOutdent = function (state, session, row) {
         var line = session.getLine(row);
         var column = line.match(/^\s*/)[0].length;
-        if (!column || !row) return;
-
+        if (!column || !row)
+            return;
         var startRange = this.getMatching(session, row, column + 1);
         if (!startRange || startRange.start.row == row)
-             return;
+            return;
         var indent = this.$getIndent(session.getLine(startRange.start.row));
         if (indent.length != column) {
             session.replace(new Range(row, 0, row, column), indent);
             session.outdentRows(new Range(row + 1, 0, row + 1, 0));
         }
     };
-
-    this.createWorker = function(session) {
+    this.createWorker = function (session) {
         var worker = new WorkerClient(["ace"], "ace/mode/lua_worker", "Worker");
         worker.attachToDocument(session.getDocument());
-        
-        worker.on("annotate", function(e) {
+        worker.on("annotate", function (e) {
             session.setAnnotations(e.data);
         });
-        
-        worker.on("terminate", function() {
+        worker.on("terminate", function () {
             session.clearAnnotations();
         });
-        
         return worker;
     };
-
     this.$id = "ace/mode/lua";
     this.snippetFileId = "ace/snippets/lua";
 }).call(Mode.prototype);
-
 exports.Mode = Mode;
+
 });                (function() {
                     ace.require(["ace/mode/lua"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 9 - 0
web/1c71dfe2ae40884baae78d14e2568eb1.js

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

+ 16 - 0
web/1cac3566cdfb6be0f51c3f2ade7c1603.js

@@ -0,0 +1,16 @@
+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;
+                        }
+                    });
+                })();
+            

File diff suppressed because it is too large
+ 0 - 0
web/1e0340d10d5cb579b144f73e631c7813.js


+ 0 - 279
web/1e33cb44dfab039b4a7e88a3ee1bbfe7.js

@@ -1,279 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

File diff suppressed because it is too large
+ 0 - 0
web/1ea9cb4eff3a4f4c27ff63263151eba2.js


+ 836 - 0
web/1f33899bba9efc8a9dc527f39ce8fe9a.js

@@ -0,0 +1,836 @@
+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;
+                        }
+                    });
+                })();
+            

+ 70 - 0
web/1facfcf9af0b5a679a66dc7f26080afe.js

@@ -0,0 +1,70 @@
+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;
+                        }
+                    });
+                })();
+            

+ 9 - 0
web/1fd353d022bf5027ba193d0b0b9995ed.js

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

File diff suppressed because it is too large
+ 0 - 167
web/20642f73792092d3c71a4f1f4290430b.js


+ 0 - 113
web/2208705283adad817bb4a5af647f77ab.js

@@ -1,113 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 428 - 0
web/2218ddba12711e7e7f6aea96015bafa2.js

@@ -0,0 +1,428 @@
+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;
+                        }
+                    });
+                })();
+            

+ 0 - 310
web/22b1c8bf4c2bdd7e438f832b888c75e4.js

@@ -1,310 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 6448 - 0
web/22b3d72765b6ec7c787f375e68324531.js

@@ -0,0 +1,6448 @@
+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;
+                        }
+                    });
+                })();
+            

File diff suppressed because it is too large
+ 25 - 40
web/22cc8dfa6780c4baf11191388b0a4e71.js


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

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

+ 127 - 178
web/4ab6dffb1b7255cc39ef77a35eb53293.js → web/2322c0d73cf4169df003976804566079.js

@@ -1,264 +1,220 @@
-ace.define("ace/mode/json_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
-"use strict";
-
+ace.define("ace/mode/json_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 JsonHighlightRules = function() {
+var JsonHighlightRules = function () {
     this.$rules = {
-        "start" : [
+        "start": [
             {
-                token : "variable", // single line
-                regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'
+                token: "variable",
+                regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'
             }, {
-                token : "string", // single line
-                regex : '"',
-                next  : "string"
+                token: "string",
+                regex: '"',
+                next: "string"
             }, {
-                token : "constant.numeric", // hex
-                regex : "0[xX][0-9a-fA-F]+\\b"
+                token: "constant.numeric",
+                regex: "0[xX][0-9a-fA-F]+\\b"
             }, {
-                token : "constant.numeric", // float
-                regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+                token: "constant.numeric",
+                regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
             }, {
-                token : "constant.language.boolean",
-                regex : "(?:true|false)\\b"
+                token: "constant.language.boolean",
+                regex: "(?:true|false)\\b"
             }, {
-                token : "text", // single quoted strings are not allowed
-                regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+                token: "text",
+                regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
             }, {
-                token : "comment", // comments are not allowed, but who cares?
-                regex : "\\/\\/.*$"
+                token: "comment",
+                regex: "\\/\\/.*$"
             }, {
-                token : "comment.start", // comments are not allowed, but who cares?
-                regex : "\\/\\*",
-                next  : "comment"
+                token: "comment.start",
+                regex: "\\/\\*",
+                next: "comment"
             }, {
-                token : "paren.lparen",
-                regex : "[[({]"
+                token: "paren.lparen",
+                regex: "[[({]"
             }, {
-                token : "paren.rparen",
-                regex : "[\\])}]"
+                token: "paren.rparen",
+                regex: "[\\])}]"
             }, {
-                token : "text",
-                regex : "\\s+"
+                token: "punctuation.operator",
+                regex: /[,]/
+            }, {
+                token: "text",
+                regex: "\\s+"
             }
         ],
-        "string" : [
+        "string": [
             {
-                token : "constant.language.escape",
-                regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/
+                token: "constant.language.escape",
+                regex: /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/
             }, {
-                token : "string",
-                regex : '"|$',
-                next  : "start"
+                token: "string",
+                regex: '"|$',
+                next: "start"
             }, {
-                defaultToken : "string"
+                defaultToken: "string"
             }
         ],
-        "comment" : [
+        "comment": [
             {
-                token : "comment.end", // comments are not allowed, but who cares?
-                regex : "\\*\\/",
-                next  : "start"
+                token: "comment.end",
+                regex: "\\*\\/",
+                next: "start"
             }, {
                 defaultToken: "comment"
             }
         ]
     };
-    
 };
-
 oop.inherits(JsonHighlightRules, TextHighlightRules);
-
 exports.JsonHighlightRules = JsonHighlightRules;
-});
 
-ace.define("ace/mode/json5_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/json_highlight_rules"], function(require, exports, module) {
-"use strict";
+});
 
+ace.define("ace/mode/json5_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/json_highlight_rules"], function(require, exports, module){"use strict";
 var oop = require("../lib/oop");
 var JsonHighlightRules = require("./json_highlight_rules").JsonHighlightRules;
-
-var Json5HighlightRules = function() {
+var Json5HighlightRules = function () {
     JsonHighlightRules.call(this);
-
     var startRules = [{
-        token : "variable",
-        regex : /[a-zA-Z$_\u00a1-\uffff][\w$\u00a1-\uffff]*\s*(?=:)/
-    }, {
-        token : "variable",
-        regex : /['](?:(?:\\.)|(?:[^'\\]))*?[']\s*(?=:)/
-    }, {
-        token : "constant.language.boolean",
-        regex : /(?:null)\b/
-    }, {
-        token : "string",
-        regex : /'/,
-        next  : [{
-            token : "constant.language.escape",
-            regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,
-            consumeLineEnd  : true
+            token: "variable",
+            regex: /[a-zA-Z$_\u00a1-\uffff][\w$\u00a1-\uffff]*\s*(?=:)/
         }, {
-            token : "string",
-            regex : /'|$/,
-            next  : "start"
+            token: "variable",
+            regex: /['](?:(?:\\.)|(?:[^'\\]))*?[']\s*(?=:)/
         }, {
-            defaultToken : "string"
-        }]
-    }, {
-        token : "string",
-        regex : /"(?![^"]*":)/,
-        next  : [{
-            token : "constant.language.escape",
-            regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,
-            consumeLineEnd  : true
+            token: "constant.language.boolean",
+            regex: /(?:null)\b/
         }, {
-            token : "string",
-            regex : /"|$/,
-            next  : "start"
+            token: "string",
+            regex: /'/,
+            next: [{
+                    token: "constant.language.escape",
+                    regex: /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,
+                    consumeLineEnd: true
+                }, {
+                    token: "string",
+                    regex: /'|$/,
+                    next: "start"
+                }, {
+                    defaultToken: "string"
+                }]
         }, {
-            defaultToken : "string"
-        }]
-    }, {
-        token : "constant.numeric",
-        regex : /[+-]?(?:Infinity|NaN)\b/
-    }];
-
+            token: "string",
+            regex: /"(?![^"]*":)/,
+            next: [{
+                    token: "constant.language.escape",
+                    regex: /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\/bfnrt]|$)/,
+                    consumeLineEnd: true
+                }, {
+                    token: "string",
+                    regex: /"|$/,
+                    next: "start"
+                }, {
+                    defaultToken: "string"
+                }]
+        }, {
+            token: "constant.numeric",
+            regex: /[+-]?(?:Infinity|NaN)\b/
+        }];
     for (var key in this.$rules)
         this.$rules[key].unshift.apply(this.$rules[key], startRules);
-
     this.normalizeRules();
 };
-
 oop.inherits(Json5HighlightRules, JsonHighlightRules);
-
 exports.Json5HighlightRules = Json5HighlightRules;
-});
 
-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;
-});
 
-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;
@@ -271,85 +227,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/json5",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json5_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/json5",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/json5_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 HighlightRules = require("./json5_highlight_rules").Json5HighlightRules;
 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 = HighlightRules;
     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.checkOutdent = function(state, line, input) {
+    this.blockComment = { start: "/*", end: "*/" };
+    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/json5";
 }).call(Mode.prototype);
-
 exports.Mode = Mode;
+
 });                (function() {
                     ace.require(["ace/mode/json5"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

File diff suppressed because it is too large
+ 0 - 0
web/23ad6224fd6059c31c199b6d6d420628.js


+ 0 - 109
web/243d8101969c933d25388b5287bb3425.js

@@ -1,109 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 0 - 111
web/2487e54390024553d757b9bd73dd1647.js

@@ -1,111 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

+ 16 - 0
web/26916d87ee46ad72f432b9a59e6fd198.js

@@ -0,0 +1,16 @@
+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;
+                        }
+                    });
+                })();
+            

+ 72 - 115
web/57c7c145c720f31f3749b658e3769833.js → web/26fa04eabe6ca96832d5652350a2fb46.js

@@ -1,33 +1,29 @@
-ace.define("ace/mode/c9search_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
-"use strict";
-
+ace.define("ace/mode/c9search_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;
-
 function safeCreateRegexp(source, flag) {
     try {
         return new RegExp(source, flag);
-    } catch(e) {}
+    }
+    catch (e) { }
 }
-
-var C9SearchHighlightRules = function() {
+var C9SearchHighlightRules = function () {
     this.$rules = {
-        "start" : [
+        "start": [
             {
-                tokenNames : ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text", "c9searchresults.keyword"],
-                regex : /(^\s+[0-9]+)(:)(\d*\s?)([^\r\n]+)/,
-                onMatch : function(val, state, stack) {
+                tokenNames: ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text", "c9searchresults.keyword"],
+                regex: /(^\s+[0-9]+)(:)(\d*\s?)([^\r\n]+)/,
+                onMatch: function (val, state, stack) {
                     var values = this.splitRegex.exec(val);
                     var types = this.tokenNames;
                     var tokens = [{
-                        type: types[0],
-                        value: values[1]
-                    }, {
-                        type: types[1],
-                        value: values[2]
-                    }];
-                    
+                            type: types[0],
+                            value: values[1]
+                        }, {
+                            type: types[1],
+                            value: values[2]
+                        }];
                     if (values[3]) {
                         if (values[3] == " ")
                             tokens[1] = { type: types[1], value: values[2] + " " };
@@ -36,7 +32,6 @@ var C9SearchHighlightRules = function() {
                     }
                     var regex = stack[1];
                     var str = values[4];
-                    
                     var m;
                     var last = 0;
                     if (regex && regex.exec) {
@@ -45,38 +40,36 @@ var C9SearchHighlightRules = function() {
                             var skipped = str.substring(last, m.index);
                             last = regex.lastIndex;
                             if (skipped)
-                                tokens.push({type: types[2], value: skipped});
+                                tokens.push({ type: types[2], value: skipped });
                             if (m[0])
-                                tokens.push({type: types[3], value: m[0]});
+                                tokens.push({ type: types[3], value: m[0] });
                             else if (!skipped)
                                 break;
                         }
                     }
                     if (last < str.length)
-                        tokens.push({type: types[2], value: str.substr(last)});
+                        tokens.push({ type: types[2], value: str.substr(last) });
                     return tokens;
                 }
             },
             {
-                regex : "^Searching for [^\\r\\n]*$",
-                onMatch: function(val, state, stack) {
+                regex: "^Searching for [^\\r\\n]*$",
+                onMatch: function (val, state, stack) {
                     var parts = val.split("\x01");
                     if (parts.length < 3)
                         return "text";
-
                     var options, search;
-                    
                     var i = 0;
                     var tokens = [{
-                        value: parts[i++] + "'",
-                        type: "text"
-                    }, {
-                        value: search = parts[i++],
-                        type: "text" // "c9searchresults.keyword"
-                    }, {
-                        value: "'" + parts[i++],
-                        type: "text"
-                    }];
+                            value: parts[i++] + "'",
+                            type: "text"
+                        }, {
+                            value: search = parts[i++],
+                            type: "text" // "c9searchresults.keyword"
+                        }, {
+                            value: "'" + parts[i++],
+                            type: "text"
+                        }];
                     if (parts[2] !== " in") {
                         tokens.push({
                             value: "'" + parts[i++] + "'",
@@ -90,14 +83,15 @@ var C9SearchHighlightRules = function() {
                         value: " " + parts[i++] + " ",
                         type: "text"
                     });
-                    if (parts[i+1]) {
-                        options = parts[i+1];
+                    if (parts[i + 1]) {
+                        options = parts[i + 1];
                         tokens.push({
-                            value: "(" + parts[i+1] + ")",
+                            value: "(" + parts[i + 1] + ")",
                             type: "text"
                         });
                         i += 1;
-                    } else {
+                    }
+                    else {
                         i -= 1;
                     }
                     while (i++ < parts.length) {
@@ -106,120 +100,93 @@ var C9SearchHighlightRules = function() {
                             type: "text"
                         });
                     }
-                    
                     if (search) {
                         if (!/regex/.test(options))
                             search = lang.escapeRegExp(search);
                         if (/whole/.test(options))
                             search = "\\b" + search + "\\b";
                     }
-                    
-                    var regex = search && safeCreateRegexp(
-                        "(" + search + ")",
-                        / sensitive/.test(options) ? "g" : "ig"
-                    );
+                    var regex = search && safeCreateRegexp("(" + search + ")", / sensitive/.test(options) ? "g" : "ig");
                     if (regex) {
                         stack[0] = state;
                         stack[1] = regex;
                     }
-                    
                     return tokens;
                 }
             },
             {
-                regex : "^(?=Found \\d+ matches)",
-                token : "text",
-                next : "numbers"
+                regex: "^(?=Found \\d+ matches)",
+                token: "text",
+                next: "numbers"
             },
             {
-                token : "string", // single line
-                regex : "^\\S:?[^:]+",
-                next : "numbers"
+                token: "string",
+                regex: "^\\S:?[^:]+",
+                next: "numbers"
             }
         ],
-        numbers:[{
-            regex : "\\d+",
-            token : "constant.numeric"
-        }, {
-            regex : "$",
-            token : "text",
-            next : "start"
-        }]
+        numbers: [{
+                regex: "\\d+",
+                token: "constant.numeric"
+            }, {
+                regex: "$",
+                token: "text",
+                next: "start"
+            }]
     };
     this.normalizeRules();
 };
-
 oop.inherits(C9SearchHighlightRules, TextHighlightRules);
-
 exports.C9SearchHighlightRules = C9SearchHighlightRules;
 
 });
 
-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;
-});
 
-ace.define("ace/mode/folding/c9search",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
-"use strict";
+});
 
+ace.define("ace/mode/folding/c9search",["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.*:|Searching for.*)$/;
     this.foldingStopMarker = /^(\s+|Found.*)$/;
-    
-    this.getFoldWidgetRange = function(session, foldStyle, row) {
+    this.getFoldWidgetRange = function (session, foldStyle, row) {
         var lines = session.doc.getAllLines(row);
         var line = lines[row];
         var level1 = /^(Found.*|Searching for.*)$/;
         var level2 = /^(\S.*:|\s*)$/;
         var re = level1.test(line) ? level1 : level2;
-        
         var startRow = row;
         var endRow = row;
-
         if (this.foldingStartMarker.test(line)) {
             for (var i = row + 1, l = session.getLength(); i < l; i++) {
                 if (re.test(lines[i]))
@@ -242,45 +209,35 @@ oop.inherits(FoldMode, BaseFoldMode);
             return new Range(startRow, col, endRow, 0);
         }
     };
-    
 }).call(FoldMode.prototype);
 
 });
 
-ace.define("ace/mode/c9search",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c9search_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/c9search"], function(require, exports, module) {
-"use strict";
-
+ace.define("ace/mode/c9search",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c9search_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/c9search"], function(require, exports, module){"use strict";
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var C9SearchHighlightRules = require("./c9search_highlight_rules").C9SearchHighlightRules;
 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
 var C9StyleFoldMode = require("./folding/c9search").FoldMode;
-
-var Mode = function() {
+var Mode = function () {
     this.HighlightRules = C9SearchHighlightRules;
     this.$outdent = new MatchingBraceOutdent();
     this.foldingRules = new C9StyleFoldMode();
 };
 oop.inherits(Mode, TextMode);
-
-(function() {
-    
-    this.getNextLineIndent = function(state, line, tab) {
+(function () {
+    this.getNextLineIndent = function (state, line, tab) {
         var indent = this.$getIndent(line);
         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/c9search";
 }).call(Mode.prototype);
-
 exports.Mode = Mode;
 
 });                (function() {

File diff suppressed because it is too large
+ 1 - 3
web/2820d22820b6e6c07cdd0ec14477c7b9.js


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

@@ -1,146 +1,116 @@
-ace.define("ace/mode/batchfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
+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: ) */
 "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;
-});
 
-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;
@@ -153,73 +123,72 @@ 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) {
+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
+*/
 "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;
+
 });                (function() {
                     ace.require(["ace/mode/batchfile"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

File diff suppressed because it is too large
+ 0 - 6
web/2839e845bd0cf60f35f3a8ca90a5ee22.js


+ 0 - 254
web/294fbc5b00264d6215dd8ff838dc2999.js

@@ -1,254 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

File diff suppressed because it is too large
+ 0 - 0
web/2a4c96bd91c25806d68325751fb0c958.js


+ 133 - 0
web/2b1eed411f531a271f0e47693c82216a.js

@@ -0,0 +1,133 @@
+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;
+                        }
+                    });
+                })();
+            

+ 1 - 3
web/3e6cde7f6a3d84c5cff5127be1c019f3.js → web/2c41df6060672e75b4ab09e4a5d43049.js

@@ -1,6 +1,4 @@
-ace.define("ace/snippets/io",["require","exports","module"], function(require, exports, module) {
-"use strict";
-
+ace.define("ace/snippets/io",["require","exports","module"], function(require, exports, module){"use strict";
 exports.snippets = [
     {
         "content": "assertEquals(${1:expected}, ${2:expr})",

+ 16 - 0
web/2d53cfacb6a695f378ca997fcee7efb3.js

@@ -0,0 +1,16 @@
+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;
+                        }
+                    });
+                })();
+            

+ 305 - 0
web/2dcf359bda4d96fcd06e8b0b7bc039bf.js

@@ -0,0 +1,305 @@
+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;
+                        }
+                    });
+                })();
+            

+ 0 - 168
web/2dea096a03cd8f864db5f06e9f0113e5.js

@@ -1,168 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

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

@@ -1,269 +1,210 @@
-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", // doc comment
-        regex : "\\/\\*(?=\\*)",
-        next  : start
+        token: "comment.doc",
+        regex: "\\/\\*(?=\\*)",
+        next: start
     };
 };
-
 DocCommentHighlightRules.getEndRule = function (start) {
     return {
-        token : "comment.doc", // closing comment
-        regex : "\\*\\/",
-        next  : start
+        token: "comment.doc",
+        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", // multi line comment
-                regex : "\\/\\*",
-                next : "comment"
+                token: "comment",
+                regex: "\\/\\*",
+                next: "comment"
             }, {
-                token : "string.regexp",
-                regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
+                token: "string.regexp",
+                regex: "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
             }, {
-                token : "string", // single line
-                regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+                token: "string",
+                regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
             }, {
-                token : "string", // single line
-                regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
+                token: "string",
+                regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
             }, {
-                token : "constant.numeric", // hex
-                regex : "0[xX][0-9a-fA-F]+\\b"
+                token: "constant.numeric",
+                regex: "0[xX][0-9a-fA-F]+\\b"
             }, {
-                token : "constant.numeric", // float
-                regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
+                token: "constant.numeric",
+                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", // closing comment
-                regex : "\\*\\/",
-                next : "start"
+                token: "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;
-});
 
-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;
-});
 
-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;
@@ -276,106 +217,93 @@ 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;
+
 });                (function() {
                     ace.require(["ace/mode/haxe"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

File diff suppressed because it is too large
+ 23 - 36
web/2f3af4250fd57142b0ffb0ed6bc553dc.js


File diff suppressed because it is too large
+ 4 - 0
web/2f5ea84ffbac21b3f98fccc2352300e4.js


File diff suppressed because it is too large
+ 0 - 0
web/2f689ca91158f918e23ce27c7abbcf25.js


File diff suppressed because it is too large
+ 0 - 0
web/2f6dcc38e5ad378438bea99c47e20e28.js


+ 0 - 137
web/2f6f1f6753d430190cb38411a9112f08.js

@@ -1,137 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

File diff suppressed because it is too large
+ 0 - 0
web/2f985fd2d1b0603c0cd825f7e9b4218d.js


+ 0 - 172
web/30314e1b4a51b1aed3766eadecde2a42.js

@@ -1,172 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

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

@@ -1,10 +1,7 @@
-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",
@@ -12,7 +9,6 @@ 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_]*)";
@@ -25,250 +21,224 @@ 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 + ")(?=\\()"
-        }, {//pragmas
-            token: "paren.lparen",
-            regex: "(\\{\\.)",
-            next: [{
-                token: "paren.rparen",
-                regex: '(\\.\\}|\\})',
-                next: "start"
+                token: ["identifier", "keyword.operator", "support.function"],
+                regex: "(" + identifier + ")([.]{1})(" + identifier + ")(?=\\()"
             }, {
-                include: "methods"
+                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: "identifier",
-                regex: identifier
+                token: "comment.doc.start",
+                regex: /##\[(?!])/,
+                push: "docBlockComment"
             }, {
-                token: "punctuation",
-                regex: /[,]/
+                token: "comment.start",
+                regex: /#\[(?!])/,
+                push: "blockComment"
             }, {
-                token: "keyword.operator",
-                regex: /[=:.]/
+                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})?'"
+            }, {
+                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: /[[(]/
+                regex: /\[\.|{\||\(\.|\[:|[[({`]/
             }, {
                 token: "paren.rparen",
-                regex: /[\])]/
+                regex: /\.\)|\|}|\.]|[\])}]/
             }, {
-                include: "math"
+                token: "keyword.operator",
+                regex: /[=+\-*\/<>@$~&%|!?^.:\\]/
             }, {
-                include: "strings"
+                token: "punctuation",
+                regex: /[,;]/
             }, {
-                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"
-        }],
+                include: "math"
+            }],
         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"
+            }],
         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: '"""',
-                next: "pop"
+                regex: '(\\b' + identifier + ')?"""',
+                push: [{
+                        token: "string",
+                        regex: '"""',
+                        next: "pop"
+                    }, {
+                        defaultToken: "string"
+                    }]
             }, {
-                defaultToken: "string"
-            }]
-        }, {
-            token: "string",
-            regex: "\\b" + identifier + '"(?=.)',
-            push: [{
                 token: "string",
-                regex: '"|$',
-                next: "pop"
+                regex: "\\b" + identifier + '"(?=.)',
+                push: [{
+                        token: "string",
+                        regex: '"|$',
+                        next: "pop"
+                    }, {
+                        defaultToken: "string"
+                    }]
             }, {
-                defaultToken: "string"
-            }]
-        }, {
-            token: "string",
-            regex: '"',
-            push: [{
                 token: "string",
-                regex: '"|$',
-                next: "pop"
-            }, {
-                token: "constant.language.escape",
-                regex: stringEscape
-            }, {
-                defaultToken: "string"
+                regex: '"',
+                push: [{
+                        token: "string",
+                        regex: '"|$',
+                        next: "pop"
+                    }, {
+                        token: "constant.language.escape",
+                        regex: stringEscape
+                    }, {
+                        defaultToken: "string"
+                    }]
             }]
-        }]
     };
     this.normalizeRules();
 };
-
-
 oop.inherits(NimHighlightRules, TextHighlightRules);
-
 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;
@@ -281,78 +251,70 @@ 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;
+
 });                (function() {
                     ace.require(["ace/mode/nim"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 151 - 200
web/a84f565fc5473f112281550ea6c2ccf4.js → web/3078a3b7f66272ada3e5d065827dfceb.js

@@ -1,86 +1,62 @@
-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;
@@ -93,290 +69,265 @@ 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/tcl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
-"use strict";
-
+ace.define("ace/mode/tcl_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 TclHighlightRules = function() {
-
+var TclHighlightRules = function () {
     this.$rules = {
-        "start" : [
-           {
-                token : "comment",
-                regex : "#.*\\\\$",
-                next  : "commentfollow"
+        "start": [
+            {
+                token: "comment",
+                regex: "#.*\\\\$",
+                next: "commentfollow"
+            }, {
+                token: "comment",
+                regex: "#.*$"
             }, {
-                token : "comment",
-                regex : "#.*$"
+                token: "support.function",
+                regex: '[\\\\]$',
+                next: "splitlineStart"
             }, {
-                token : "support.function",
-                regex : '[\\\\]$',
-                next  : "splitlineStart"
+                token: "text",
+                regex: /\\(?:["{}\[\]$\\])/
             }, {
-                token : "text",
-                regex : /\\(?:["{}\[\]$\\])/
+                token: "text",
+                regex: '^|[^{][;][^}]|[/\r/]',
+                next: "commandItem"
             }, {
-                token : "text", // last value before command
-                regex : '^|[^{][;][^}]|[/\r/]',
-                next  : "commandItem"
+                token: "string",
+                regex: '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
             }, {
-                token : "string", // single line
-                regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+                token: "string",
+                regex: '[ ]*["]',
+                next: "qqstring"
             }, {
-                token : "string", // multi line """ string start
-                regex : '[ ]*["]',
-                next  : "qqstring"
+                token: "variable.instance",
+                regex: "[$]",
+                next: "variable"
             }, {
-                token : "variable.instance",
-                regex : "[$]",
-                next  : "variable"
+                token: "support.function",
+                regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::"
             }, {
-                token : "support.function",
-                regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::"
+                token: "identifier",
+                regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
             }, {
-                token : "identifier",
-                regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
+                token: "paren.lparen",
+                regex: "[[{]",
+                next: "commandItem"
             }, {
-                token : "paren.lparen",
-                regex : "[[{]",
-                next  : "commandItem"
+                token: "paren.lparen",
+                regex: "[(]"
             }, {
-                token : "paren.lparen",
-                regex : "[(]"
-            },  {
-                token : "paren.rparen",
-                regex : "[\\])}]"
+                token: "paren.rparen",
+                regex: "[\\])}]"
             }, {
-                token : "text",
-                regex : "\\s+"
+                token: "text",
+                regex: "\\s+"
             }
         ],
-        "commandItem" : [
+        "commandItem": [
             {
-                token : "comment",
-                regex : "#.*\\\\$",
-                next  : "commentfollow"
+                token: "comment",
+                regex: "#.*\\\\$",
+                next: "commentfollow"
             }, {
-                token : "comment",
-                regex : "#.*$",
-                next  : "start"
+                token: "comment",
+                regex: "#.*$",
+                next: "start"
             }, {
-                token : "string", // single line
-                regex : '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
+                token: "string",
+                regex: '[ ]*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
             }, {
-                token : "variable.instance", 
-                regex : "[$]",
-                next  : "variable"
+                token: "variable.instance",
+                regex: "[$]",
+                next: "variable"
             }, {
-                token : "support.function",
-                regex : "(?:[:][:])[a-zA-Z0-9_/]+(?:[:][:])",
-                next  : "commandItem"
+                token: "support.function",
+                regex: "(?:[:][:])[a-zA-Z0-9_/]+(?:[:][:])",
+                next: "commandItem"
             }, {
-                token : "support.function",
-                regex : "[a-zA-Z0-9_/]+(?:[:][:])",
-                next  : "commandItem"
+                token: "support.function",
+                regex: "[a-zA-Z0-9_/]+(?:[:][:])",
+                next: "commandItem"
             }, {
-                token : "support.function",
-                regex : "(?:[:][:])",
-                next  : "commandItem"
+                token: "support.function",
+                regex: "(?:[:][:])",
+                next: "commandItem"
             }, {
-                token : "paren.rparen",
-                regex : "[\\])}]"
+                token: "paren.rparen",
+                regex: "[\\])}]"
             }, {
-                token : "paren.lparen",
-                regex : "[[({]"
+                token: "paren.lparen",
+                regex: "[[({]"
             }, {
-                token : "support.function",
-                regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::"
+                token: "support.function",
+                regex: "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|{\\*}|;|::"
             }, {
-                token : "keyword",
-                regex : "[a-zA-Z0-9_/]+",
-                next  : "start"
-            } ],
-        "commentfollow" : [ 
+                token: "keyword",
+                regex: "[a-zA-Z0-9_/]+",
+                next: "start"
+            }
+        ],
+        "commentfollow": [
             {
-                token : "comment",
-                regex : ".*\\\\$",
-                next  : "commentfollow"
+                token: "comment",
+                regex: ".*\\\\$",
+                next: "commentfollow"
             }, {
-                token : "comment",
-                regex : '.+',
-                next  : "start"
-        } ],
-        "splitlineStart" : [ 
+                token: "comment",
+                regex: '.+',
+                next: "start"
+            }
+        ],
+        "splitlineStart": [
             {
-                token : "text",
-                regex : "^.",
-                next  : "start"
-            }],
-        "variable" : [ 
+                token: "text",
+                regex: "^.",
+                next: "start"
+            }
+        ],
+        "variable": [
             {
-                token : "variable.instance", // variable tcl
-                regex : "[a-zA-Z_\\d]+(?:[(][a-zA-Z_\\d]+[)])?",
-                next  : "start"
+                token: "variable.instance",
+                regex: "[a-zA-Z_\\d]+(?:[(][a-zA-Z_\\d]+[)])?",
+                next: "start"
+            }, {
+                token: "variable.instance",
+                regex: "{?[a-zA-Z_\\d]+}?",
+                next: "start"
+            }
+        ],
+        "qqstring": [{
+                token: "string",
+                regex: '(?:[^\\\\]|\\\\.)*?["]',
+                next: "start"
             }, {
-                token : "variable.instance", // variable tcl with braces
-                regex : "{?[a-zA-Z_\\d]+}?",
-                next  : "start"
-            }],  
-        "qqstring" : [ {
-            token : "string", // multi line """ string end
-            regex : '(?:[^\\\\]|\\\\.)*?["]',
-            next : "start"
-        }, {
-            token : "string",
-            regex : '.+'
-        } ]
+                token: "string",
+                regex: '.+'
+            }]
     };
 };
-
 oop.inherits(TclHighlightRules, TextHighlightRules);
-
 exports.TclHighlightRules = TclHighlightRules;
-});
 
-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;
-});
 
-ace.define("ace/mode/tcl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/folding/cstyle","ace/mode/tcl_highlight_rules","ace/mode/matching_brace_outdent","ace/range"], function(require, exports, module) {
-"use strict";
+});
 
+ace.define("ace/mode/tcl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/folding/cstyle","ace/mode/tcl_highlight_rules","ace/mode/matching_brace_outdent","ace/range"], function(require, exports, module){"use strict";
 var oop = require("../lib/oop");
 var TextMode = require("./text").Mode;
 var CStyleFoldMode = require("./folding/cstyle").FoldMode;
 var TclHighlightRules = require("./tcl_highlight_rules").TclHighlightRules;
 var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
 var Range = require("../range").Range;
-
-var Mode = function() {
+var Mode = function () {
     this.HighlightRules = TclHighlightRules;
     this.$outdent = new MatchingBraceOutdent();
     this.foldingRules = new CStyleFoldMode();
     this.$behaviour = this.$defaultBehaviour;
 };
 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);
-
         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/tcl";
     this.snippetFileId = "ace/snippets/tcl";
 }).call(Mode.prototype);
-
 exports.Mode = Mode;
+
 });                (function() {
                     ace.require(["ace/mode/tcl"], function(m) {
                         if (typeof module == "object" && typeof exports == "object" && module) {

+ 0 - 103
web/30f5b57295dfda4eafc7f8c098160582.js

@@ -1,103 +0,0 @@
-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;
-                        }
-                    });
-                })();
-            

File diff suppressed because it is too large
+ 0 - 0
web/30fc7b3a9d721379c231908210e3530d.js


File diff suppressed because it is too large
+ 310 - 370
web/318d00035e58a0cea6acc0c603c0e680.js


Some files were not shown because too many files changed in this diff