ace-rails-ap 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ace/rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/ace/ace.js +403 -326
  4. data/vendor/assets/javascripts/ace/ext-language_tools.js +56 -40
  5. data/vendor/assets/javascripts/ace/ext-modelist.js +7 -3
  6. data/vendor/assets/javascripts/ace/ext-settings_menu.js +8 -4
  7. data/vendor/assets/javascripts/ace/ext-static_highlight.js +12 -5
  8. data/vendor/assets/javascripts/ace/keybinding-vim.js +5234 -1558
  9. data/vendor/assets/javascripts/ace/mode-abap.js +1 -1
  10. data/vendor/assets/javascripts/ace/mode-abc.js +261 -0
  11. data/vendor/assets/javascripts/ace/mode-actionscript.js +47 -1
  12. data/vendor/assets/javascripts/ace/mode-apache_conf.js +47 -1
  13. data/vendor/assets/javascripts/ace/mode-applescript.js +47 -1
  14. data/vendor/assets/javascripts/ace/mode-autohotkey.js +47 -1
  15. data/vendor/assets/javascripts/ace/mode-batchfile.js +47 -1
  16. data/vendor/assets/javascripts/ace/mode-c_cpp.js +101 -56
  17. data/vendor/assets/javascripts/ace/mode-coffee.js +3 -3
  18. data/vendor/assets/javascripts/ace/mode-coldfusion.js +114 -63
  19. data/vendor/assets/javascripts/ace/mode-csharp.js +99 -55
  20. data/vendor/assets/javascripts/ace/mode-css.js +98 -53
  21. data/vendor/assets/javascripts/ace/mode-curly.js +114 -63
  22. data/vendor/assets/javascripts/ace/mode-d.js +47 -1
  23. data/vendor/assets/javascripts/ace/mode-dart.js +103 -58
  24. data/vendor/assets/javascripts/ace/mode-diff.js +85 -85
  25. data/vendor/assets/javascripts/ace/mode-django.js +114 -63
  26. data/vendor/assets/javascripts/ace/mode-dockerfile.js +97 -52
  27. data/vendor/assets/javascripts/ace/mode-dot.js +47 -1
  28. data/vendor/assets/javascripts/ace/mode-eiffel.js +30 -37
  29. data/vendor/assets/javascripts/ace/mode-ejs.js +117 -63
  30. data/vendor/assets/javascripts/ace/mode-elm.js +47 -1
  31. data/vendor/assets/javascripts/ace/mode-erlang.js +47 -1
  32. data/vendor/assets/javascripts/ace/mode-forth.js +47 -1
  33. data/vendor/assets/javascripts/ace/mode-ftl.js +10 -7
  34. data/vendor/assets/javascripts/ace/mode-glsl.js +101 -56
  35. data/vendor/assets/javascripts/ace/mode-golang.js +96 -51
  36. data/vendor/assets/javascripts/ace/mode-groovy.js +98 -53
  37. data/vendor/assets/javascripts/ace/mode-haml.js +3 -0
  38. data/vendor/assets/javascripts/ace/mode-handlebars.js +114 -63
  39. data/vendor/assets/javascripts/ace/mode-haskell.js +49 -3
  40. data/vendor/assets/javascripts/ace/mode-haxe.js +96 -51
  41. data/vendor/assets/javascripts/ace/mode-html.js +114 -63
  42. data/vendor/assets/javascripts/ace/mode-html_ruby.js +117 -63
  43. data/vendor/assets/javascripts/ace/mode-io.js +47 -1
  44. data/vendor/assets/javascripts/ace/mode-jack.js +96 -51
  45. data/vendor/assets/javascripts/ace/mode-jade.js +10 -7
  46. data/vendor/assets/javascripts/ace/mode-java.js +98 -53
  47. data/vendor/assets/javascripts/ace/mode-javascript.js +98 -53
  48. data/vendor/assets/javascripts/ace/mode-json.js +99 -54
  49. data/vendor/assets/javascripts/ace/mode-jsoniq.js +98 -51
  50. data/vendor/assets/javascripts/ace/mode-jsp.js +106 -58
  51. data/vendor/assets/javascripts/ace/mode-jsx.js +96 -51
  52. data/vendor/assets/javascripts/ace/mode-julia.js +47 -1
  53. data/vendor/assets/javascripts/ace/mode-latex.js +1 -1
  54. data/vendor/assets/javascripts/ace/mode-lean.js +281 -0
  55. data/vendor/assets/javascripts/ace/mode-less.js +96 -51
  56. data/vendor/assets/javascripts/ace/mode-liquid.js +10 -7
  57. data/vendor/assets/javascripts/ace/mode-live_script.js +481 -0
  58. data/vendor/assets/javascripts/ace/mode-livescript.js +5 -8
  59. data/vendor/assets/javascripts/ace/mode-logiql.js +49 -50
  60. data/vendor/assets/javascripts/ace/mode-lsl.js +96 -51
  61. data/vendor/assets/javascripts/ace/mode-lua.js +3 -3
  62. data/vendor/assets/javascripts/ace/mode-luapage.js +117 -66
  63. data/vendor/assets/javascripts/ace/mode-makefile.js +1 -1
  64. data/vendor/assets/javascripts/ace/mode-markdown.js +134 -67
  65. data/vendor/assets/javascripts/ace/mode-mask.js +1985 -0
  66. data/vendor/assets/javascripts/ace/mode-mel.js +96 -51
  67. data/vendor/assets/javascripts/ace/mode-mips_assembler.js +235 -0
  68. data/vendor/assets/javascripts/ace/mode-mipsassembler.js +196 -0
  69. data/vendor/assets/javascripts/ace/mode-nix.js +101 -56
  70. data/vendor/assets/javascripts/ace/mode-objectivec.js +52 -6
  71. data/vendor/assets/javascripts/ace/mode-perl.js +47 -1
  72. data/vendor/assets/javascripts/ace/mode-pgsql.js +1 -1
  73. data/vendor/assets/javascripts/ace/mode-php.js +139 -85
  74. data/vendor/assets/javascripts/ace/mode-powershell.js +96 -51
  75. data/vendor/assets/javascripts/ace/mode-praat.js +47 -1
  76. data/vendor/assets/javascripts/ace/mode-prolog.js +47 -1
  77. data/vendor/assets/javascripts/ace/mode-protobuf.js +101 -56
  78. data/vendor/assets/javascripts/ace/mode-rdoc.js +1 -1
  79. data/vendor/assets/javascripts/ace/mode-rhtml.js +114 -63
  80. data/vendor/assets/javascripts/ace/mode-ruby.js +52 -50
  81. data/vendor/assets/javascripts/ace/mode-rust.js +57 -18
  82. data/vendor/assets/javascripts/ace/mode-scad.js +96 -51
  83. data/vendor/assets/javascripts/ace/mode-scala.js +98 -53
  84. data/vendor/assets/javascripts/ace/mode-scss.js +96 -51
  85. data/vendor/assets/javascripts/ace/mode-sh.js +97 -52
  86. data/vendor/assets/javascripts/ace/mode-sjs.js +98 -53
  87. data/vendor/assets/javascripts/ace/mode-smarty.js +114 -63
  88. data/vendor/assets/javascripts/ace/mode-soy_template.js +114 -63
  89. data/vendor/assets/javascripts/ace/mode-stylus.js +1 -1
  90. data/vendor/assets/javascripts/ace/mode-svg.js +132 -65
  91. data/vendor/assets/javascripts/ace/mode-tcl.js +47 -1
  92. data/vendor/assets/javascripts/ace/mode-twig.js +114 -63
  93. data/vendor/assets/javascripts/ace/mode-typescript.js +98 -53
  94. data/vendor/assets/javascripts/ace/mode-vala.js +96 -51
  95. data/vendor/assets/javascripts/ace/mode-velocity.js +114 -63
  96. data/vendor/assets/javascripts/ace/mode-vhdl.js +21 -21
  97. data/vendor/assets/javascripts/ace/mode-xml.js +34 -12
  98. data/vendor/assets/javascripts/ace/mode-xquery.js +98 -51
  99. data/vendor/assets/javascripts/ace/snippets/abc.js +38 -0
  100. data/vendor/assets/javascripts/ace/snippets/elixir.js +7 -0
  101. data/vendor/assets/javascripts/ace/snippets/elm.js +7 -0
  102. data/vendor/assets/javascripts/ace/snippets/lean.js +7 -0
  103. data/vendor/assets/javascripts/ace/snippets/live_script.js +7 -0
  104. data/vendor/assets/javascripts/ace/snippets/mask.js +7 -0
  105. data/vendor/assets/javascripts/ace/snippets/mips_assembler.js +7 -0
  106. data/vendor/assets/javascripts/ace/snippets/mipsassembler.js +7 -0
  107. data/vendor/assets/javascripts/ace/snippets/r.js +1 -1
  108. data/vendor/assets/javascripts/ace/theme-clouds_midnight.js +1 -1
  109. data/vendor/assets/javascripts/ace/theme-github.js +7 -1
  110. data/vendor/assets/javascripts/ace/theme-katzenmilch.js +3 -0
  111. data/vendor/assets/javascripts/ace/theme-kuroir.js +3 -0
  112. data/vendor/assets/javascripts/ace/worker-coffee.js +6 -7
  113. data/vendor/assets/javascripts/ace/worker-css.js +5 -5
  114. data/vendor/assets/javascripts/ace/worker-html.js +4354 -4354
  115. data/vendor/assets/javascripts/ace/worker-javascript.js +2435 -1397
  116. data/vendor/assets/javascripts/ace/worker-json.js +6 -7
  117. data/vendor/assets/javascripts/ace/worker-lua.js +11 -11
  118. data/vendor/assets/javascripts/ace/worker-php.js +4 -8
  119. data/vendor/assets/javascripts/ace/worker-xml.js +3809 -0
  120. data/vendor/assets/javascripts/ace/worker-xquery.js +38 -47
  121. metadata +18 -9
  122. data/vendor/assets/javascripts/ace/ext-options.js +0 -252
  123. data/vendor/assets/javascripts/ace/mode-html_completions.js +0 -309
  124. data/vendor/assets/javascripts/ace/mode-luahtml.js +0 -2415
  125. data/vendor/assets/javascripts/ace/mode-mushcode_high_rules.js +0 -569
  126. data/vendor/assets/javascripts/ace/mode-tmsnippet.js +0 -200
  127. data/vendor/assets/javascripts/ace/theme-kr.js +0 -105
@@ -85,26 +85,26 @@ oop.inherits(VHDLHighlightRules, TextHighlightRules);
85
85
  exports.VHDLHighlightRules = VHDLHighlightRules;
86
86
  });
87
87
 
88
- define("ace/mode/vhdl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/vhdl_highlight_rules","ace/range"], function(require, exports, module) {
89
- "use strict";
90
-
91
- var oop = require("../lib/oop");
92
- var TextMode = require("./text").Mode;
93
- var VHDLHighlightRules = require("./vhdl_highlight_rules").VHDLHighlightRules;
94
- var Range = require("../range").Range;
95
-
96
- var Mode = function() {
97
- this.HighlightRules = VHDLHighlightRules;
98
- };
99
- oop.inherits(Mode, TextMode);
100
-
101
- (function() {
102
-
103
- this.lineCommentStart = "--";
104
-
88
+ define("ace/mode/vhdl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/vhdl_highlight_rules","ace/range"], function(require, exports, module) {
89
+ "use strict";
90
+
91
+ var oop = require("../lib/oop");
92
+ var TextMode = require("./text").Mode;
93
+ var VHDLHighlightRules = require("./vhdl_highlight_rules").VHDLHighlightRules;
94
+ var Range = require("../range").Range;
95
+
96
+ var Mode = function() {
97
+ this.HighlightRules = VHDLHighlightRules;
98
+ };
99
+ oop.inherits(Mode, TextMode);
100
+
101
+ (function() {
102
+
103
+ this.lineCommentStart = "--";
104
+
105
105
  this.$id = "ace/mode/vhdl";
106
- }).call(Mode.prototype);
107
-
108
- exports.Mode = Mode;
109
-
106
+ }).call(Mode.prototype);
107
+
108
+ exports.Mode = Mode;
109
+
110
110
  });
@@ -5,6 +5,9 @@ var oop = require("../lib/oop");
5
5
  var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
6
6
 
7
7
  var XmlHighlightRules = function(normalize) {
8
+
9
+ var tagRegex = "[a-zA-Z][-_a-zA-Z0-9]*";
10
+
8
11
  this.$rules = {
9
12
  start : [
10
13
  {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
@@ -14,7 +17,7 @@ var XmlHighlightRules = function(normalize) {
14
17
  },
15
18
  {
16
19
  token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
17
- regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "processing_instruction",
20
+ regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction",
18
21
  },
19
22
  {token : "comment.xml", regex : "<\\!--", next : "comment"},
20
23
  {
@@ -30,7 +33,7 @@ var XmlHighlightRules = function(normalize) {
30
33
 
31
34
  xml_decl : [{
32
35
  token : "entity.other.attribute-name.decl-attribute-name.xml",
33
- regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
36
+ regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
34
37
  }, {
35
38
  token : "keyword.operator.decl-attribute-equals.xml",
36
39
  regex : "="
@@ -66,7 +69,7 @@ var XmlHighlightRules = function(normalize) {
66
69
  next: "pop"
67
70
  }, {
68
71
  token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
69
- regex : "(<\\!)([-_a-zA-Z0-9]+)",
72
+ regex : "(<\\!)(" + tagRegex + ")",
70
73
  push : [{
71
74
  token : "text",
72
75
  regex : "\\s+"
@@ -102,7 +105,7 @@ var XmlHighlightRules = function(normalize) {
102
105
 
103
106
  tag : [{
104
107
  token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
105
- regex : "(?:(<)|(</))((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
108
+ regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
106
109
  next: [
107
110
  {include : "attributes"},
108
111
  {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
@@ -133,7 +136,7 @@ var XmlHighlightRules = function(normalize) {
133
136
 
134
137
  attributes: [{
135
138
  token : "entity.other.attribute-name.xml",
136
- regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
139
+ regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
137
140
  }, {
138
141
  token : "keyword.operator.attribute-equals.xml",
139
142
  regex : "="
@@ -326,6 +329,8 @@ var XmlBehaviour = function () {
326
329
  var token = iterator.getCurrentToken();
327
330
 
328
331
  if (token && token.type.indexOf("tag-close") !== -1) {
332
+ if (token.value == "/>")
333
+ return;
329
334
  while (token && token.type.indexOf("tag-name") === -1) {
330
335
  token = iterator.stepBackward();
331
336
  }
@@ -525,9 +530,6 @@ function is(token, type) {
525
530
  if (!tag || top.tagName == tag.tagName) {
526
531
  return stack.pop();
527
532
  }
528
- else if (this.optionalEndTags.hasOwnProperty(tag.tagName)) {
529
- return;
530
- }
531
533
  else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
532
534
  stack.pop();
533
535
  continue;
@@ -553,6 +555,8 @@ function is(token, type) {
553
555
  row: row,
554
556
  column: firstTag.start.column + firstTag.tagName.length + 2
555
557
  };
558
+ if (firstTag.start.row == firstTag.end.row)
559
+ start.column = firstTag.end.column;
556
560
  while (tag = this._readTagForward(iterator)) {
557
561
  if (tag.selfClosing) {
558
562
  if (!stack.length) {
@@ -594,6 +598,8 @@ function is(token, type) {
594
598
  this._pop(stack, tag);
595
599
  if (stack.length == 0) {
596
600
  tag.start.column += tag.tagName.length + 2;
601
+ if (tag.start.row == tag.end.row && tag.start.column < tag.end.column)
602
+ tag.start.column = tag.end.column;
597
603
  return Range.fromPoints(tag.start, end);
598
604
  }
599
605
  }
@@ -609,7 +615,7 @@ function is(token, type) {
609
615
 
610
616
  });
611
617
 
612
- define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml"], function(require, exports, module) {
618
+ define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml","ace/worker/worker_client"], function(require, exports, module) {
613
619
  "use strict";
614
620
 
615
621
  var oop = require("../lib/oop");
@@ -618,11 +624,12 @@ var TextMode = require("./text").Mode;
618
624
  var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
619
625
  var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
620
626
  var XmlFoldMode = require("./folding/xml").FoldMode;
627
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
621
628
 
622
629
  var Mode = function() {
623
- this.HighlightRules = XmlHighlightRules;
624
- this.$behaviour = new XmlBehaviour();
625
- this.foldingRules = new XmlFoldMode();
630
+ this.HighlightRules = XmlHighlightRules;
631
+ this.$behaviour = new XmlBehaviour();
632
+ this.foldingRules = new XmlFoldMode();
626
633
  };
627
634
 
628
635
  oop.inherits(Mode, TextMode);
@@ -633,6 +640,21 @@ oop.inherits(Mode, TextMode);
633
640
 
634
641
  this.blockComment = {start: "<!--", end: "-->"};
635
642
 
643
+ this.createWorker = function(session) {
644
+ var worker = new WorkerClient(["ace"], "ace/mode/xml_worker", "Worker");
645
+ worker.attachToDocument(session.getDocument());
646
+
647
+ worker.on("error", function(e) {
648
+ session.setAnnotations(e.data);
649
+ });
650
+
651
+ worker.on("terminate", function() {
652
+ session.clearAnnotations();
653
+ });
654
+
655
+ return worker;
656
+ };
657
+
636
658
  this.$id = "ace/mode/xml";
637
659
  }).call(Mode.prototype);
638
660
 
@@ -2103,6 +2103,19 @@ var initContext = function(editor) {
2103
2103
  };
2104
2104
  };
2105
2105
 
2106
+ var getWrapped = function(selection, selected, opening, closing) {
2107
+ var rowDiff = selection.end.row - selection.start.row;
2108
+ return {
2109
+ text: opening + selected + closing,
2110
+ selection: [
2111
+ 0,
2112
+ selection.start.column + 1,
2113
+ rowDiff,
2114
+ selection.end.column + (rowDiff ? 0 : 1)
2115
+ ]
2116
+ };
2117
+ };
2118
+
2106
2119
  var CstyleBehaviour = function() {
2107
2120
  this.add("braces", "insertion", function(state, action, editor, session, text) {
2108
2121
  var cursor = editor.getCursorPosition();
@@ -2112,10 +2125,7 @@ var CstyleBehaviour = function() {
2112
2125
  var selection = editor.getSelectionRange();
2113
2126
  var selected = session.doc.getTextRange(selection);
2114
2127
  if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
2115
- return {
2116
- text: '{' + selected + '}',
2117
- selection: false
2118
- };
2128
+ return getWrapped(selection, selected, '{', '}');
2119
2129
  } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
2120
2130
  if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) {
2121
2131
  CstyleBehaviour.recordAutoInsert(editor, session, "}");
@@ -2195,10 +2205,7 @@ var CstyleBehaviour = function() {
2195
2205
  var selection = editor.getSelectionRange();
2196
2206
  var selected = session.doc.getTextRange(selection);
2197
2207
  if (selected !== "" && editor.getWrapBehavioursEnabled()) {
2198
- return {
2199
- text: '(' + selected + ')',
2200
- selection: false
2201
- };
2208
+ return getWrapped(selection, selected, '(', ')');
2202
2209
  } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
2203
2210
  CstyleBehaviour.recordAutoInsert(editor, session, ")");
2204
2211
  return {
@@ -2243,10 +2250,7 @@ var CstyleBehaviour = function() {
2243
2250
  var selection = editor.getSelectionRange();
2244
2251
  var selected = session.doc.getTextRange(selection);
2245
2252
  if (selected !== "" && editor.getWrapBehavioursEnabled()) {
2246
- return {
2247
- text: '[' + selected + ']',
2248
- selection: false
2249
- };
2253
+ return getWrapped(selection, selected, '[', ']');
2250
2254
  } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
2251
2255
  CstyleBehaviour.recordAutoInsert(editor, session, "]");
2252
2256
  return {
@@ -2292,49 +2296,44 @@ var CstyleBehaviour = function() {
2292
2296
  var selection = editor.getSelectionRange();
2293
2297
  var selected = session.doc.getTextRange(selection);
2294
2298
  if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
2295
- return {
2296
- text: quote + selected + quote,
2297
- selection: false
2298
- };
2299
- } else {
2299
+ return getWrapped(selection, selected, quote, quote);
2300
+ } else if (!selected) {
2300
2301
  var cursor = editor.getCursorPosition();
2301
2302
  var line = session.doc.getLine(cursor.row);
2302
2303
  var leftChar = line.substring(cursor.column-1, cursor.column);
2303
- if (leftChar == '\\') {
2304
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
2305
+
2306
+ var token = session.getTokenAt(cursor.row, cursor.column);
2307
+ var rightToken = session.getTokenAt(cursor.row, cursor.column + 1);
2308
+ if (leftChar == "\\" && token && /escape/.test(token.type))
2304
2309
  return null;
2310
+
2311
+ var stringBefore = token && /string/.test(token.type);
2312
+ var stringAfter = !rightToken || /string/.test(rightToken.type);
2313
+
2314
+ var pair;
2315
+ if (rightChar == quote) {
2316
+ pair = stringBefore !== stringAfter;
2317
+ } else {
2318
+ if (stringBefore && !stringAfter)
2319
+ return null; // wrap string with different quote
2320
+ if (stringBefore && stringAfter)
2321
+ return null; // do not pair quotes inside strings
2322
+ var wordRe = session.$mode.tokenRe;
2323
+ wordRe.lastIndex = 0;
2324
+ var isWordBefore = wordRe.test(leftChar);
2325
+ wordRe.lastIndex = 0;
2326
+ var isWordAfter = wordRe.test(leftChar);
2327
+ if (isWordBefore || isWordAfter)
2328
+ return null; // before or after alphanumeric
2329
+ if (rightChar && !/[\s;,.})\]\\]/.test(rightChar))
2330
+ return null; // there is rightChar and it isn't closing
2331
+ pair = true;
2305
2332
  }
2306
- var tokens = session.getTokens(selection.start.row);
2307
- var col = 0, token;
2308
- var quotepos = -1; // Track whether we're inside an open quote.
2309
-
2310
- for (var x = 0; x < tokens.length; x++) {
2311
- token = tokens[x];
2312
- if (token.type == "string") {
2313
- quotepos = -1;
2314
- } else if (quotepos < 0) {
2315
- quotepos = token.value.indexOf(quote);
2316
- }
2317
- if ((token.value.length + col) > selection.start.column) {
2318
- break;
2319
- }
2320
- col += tokens[x].value.length;
2321
- }
2322
- if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
2323
- if (!CstyleBehaviour.isSaneInsertion(editor, session))
2324
- return;
2325
- return {
2326
- text: quote + quote,
2327
- selection: [1,1]
2328
- };
2329
- } else if (token && token.type === "string") {
2330
- var rightChar = line.substring(cursor.column, cursor.column + 1);
2331
- if (rightChar == quote) {
2332
- return {
2333
- text: '',
2334
- selection: [1, 1]
2335
- };
2336
- }
2337
- }
2333
+ return {
2334
+ text: pair ? quote + quote : "",
2335
+ selection: [1,1]
2336
+ };
2338
2337
  }
2339
2338
  }
2340
2339
  });
@@ -2544,6 +2543,8 @@ var XmlBehaviour = function () {
2544
2543
  var token = iterator.getCurrentToken();
2545
2544
 
2546
2545
  if (token && token.type.indexOf("tag-close") !== -1) {
2546
+ if (token.value == "/>")
2547
+ return;
2547
2548
  while (token && token.type.indexOf("tag-name") === -1) {
2548
2549
  token = iterator.stepBackward();
2549
2550
  }
@@ -2671,12 +2672,35 @@ var FoldMode = exports.FoldMode = function(commentRegex) {
2671
2672
  oop.inherits(FoldMode, BaseFoldMode);
2672
2673
 
2673
2674
  (function() {
2674
-
2675
+
2675
2676
  this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
2676
2677
  this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
2678
+ this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
2679
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
2680
+ this.startRegionRe = /^\s*(\/\*|\/\/)#region\b/;
2681
+ this._getFoldWidgetBase = this.getFoldWidget;
2682
+ this.getFoldWidget = function(session, foldStyle, row) {
2683
+ var line = session.getLine(row);
2684
+
2685
+ if (this.singleLineBlockCommentRe.test(line)) {
2686
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
2687
+ return "";
2688
+ }
2689
+
2690
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
2691
+
2692
+ if (!fw && this.startRegionRe.test(line))
2693
+ return "start"; // lineCommentRegionStart
2694
+
2695
+ return fw;
2696
+ };
2677
2697
 
2678
2698
  this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
2679
2699
  var line = session.getLine(row);
2700
+
2701
+ if (this.startRegionRe.test(line))
2702
+ return this.getCommentRegionBlock(session, line, row);
2703
+
2680
2704
  var match = line.match(this.foldingStartMarker);
2681
2705
  if (match) {
2682
2706
  var i = match.index;
@@ -2741,6 +2765,29 @@ oop.inherits(FoldMode, BaseFoldMode);
2741
2765
 
2742
2766
  return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
2743
2767
  };
2768
+
2769
+ this.getCommentRegionBlock = function(session, line, row) {
2770
+ var startColumn = line.search(/\s*$/);
2771
+ var maxRow = session.getLength();
2772
+ var startRow = row;
2773
+
2774
+ var re = /^\s*(?:\/\*|\/\/)#(end)?region\b/;
2775
+ var depth = 1;
2776
+ while (++row < maxRow) {
2777
+ line = session.getLine(row);
2778
+ var m = re.exec(line);
2779
+ if (!m) continue;
2780
+ if (m[1]) depth--;
2781
+ else depth++;
2782
+
2783
+ if (!depth) break;
2784
+ }
2785
+
2786
+ var endRow = row;
2787
+ if (endRow > startRow) {
2788
+ return new Range(startRow, startColumn, endRow, line.length);
2789
+ }
2790
+ };
2744
2791
 
2745
2792
  }).call(FoldMode.prototype);
2746
2793
 
@@ -0,0 +1,38 @@
1
+ define("ace/snippets/abc",["require","exports","module"], function(require, exports, module) {
2
+ "use strict";
3
+
4
+ exports.snippetText = "\n\
5
+ snippet zupfnoter.print\n\
6
+ %%%%hn.print {\"startpos\": ${1:pos_y}, \"t\":\"${2:title}\", \"v\":[${3:voices}], \"s\":[[${4:syncvoices}1,2]], \"f\":[${5:flowlines}], \"sf\":[${6:subflowlines}], \"j\":[${7:jumplines}]}\n\
7
+ \n\
8
+ snippet zupfnoter.note\n\
9
+ %%%%hn.note {\"pos\": [${1:pos_x},${2:pos_y}], \"text\": \"${3:text}\", \"style\": \"${4:style}\"}\n\
10
+ \n\
11
+ snippet zupfnoter.annotation\n\
12
+ %%%%hn.annotation {\"id\": \"${1:id}\", \"pos\": [${2:pos}], \"text\": \"${3:text}\"}\n\
13
+ \n\
14
+ snippet zupfnoter.lyrics\n\
15
+ %%%%hn.lyrics {\"pos\": [${1:x_pos},${2:y_pos}]}\n\
16
+ \n\
17
+ snippet zupfnoter.legend\n\
18
+ %%%%hn.legend {\"pos\": [${1:x_pos},${2:y_pos}]}\n\
19
+ \n\
20
+ \n\
21
+ \n\
22
+ snippet zupfnoter.target\n\
23
+ \"^:${1:target}\"\n\
24
+ \n\
25
+ snippet zupfnoter.goto\n\
26
+ \"^@${1:target}@${2:distance}\"\n\
27
+ \n\
28
+ snippet zupfnoter.annotationref\n\
29
+ \"^#${1:target}\"\n\
30
+ \n\
31
+ snippet zupfnoter.annotation\n\
32
+ \"^!${1:text}@${2:x_offset},${3:y_offset}\"\n\
33
+ \n\
34
+ \n\
35
+ ";
36
+ exports.scope = "abc";
37
+
38
+ });
@@ -0,0 +1,7 @@
1
+ define("ace/snippets/elixir",["require","exports","module"], function(require, exports, module) {
2
+ "use strict";
3
+
4
+ exports.snippetText =undefined;
5
+ exports.scope = "";
6
+
7
+ });
@@ -0,0 +1,7 @@
1
+ define("ace/snippets/elm",["require","exports","module"], function(require, exports, module) {
2
+ "use strict";
3
+
4
+ exports.snippetText =undefined;
5
+ exports.scope = "elm";
6
+
7
+ });