codemirror-rails 5.10 → 5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/lib/codemirror/rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/codemirror.js +15 -12
  4. data/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js +1 -1
  5. data/vendor/assets/javascripts/codemirror/addons/fold/foldgutter.js +2 -2
  6. data/vendor/assets/javascripts/codemirror/addons/search/match-highlighter.js +32 -11
  7. data/vendor/assets/javascripts/codemirror/modes/clike.js +1 -3
  8. data/vendor/assets/javascripts/codemirror/modes/clojure.js +8 -3
  9. data/vendor/assets/javascripts/codemirror/modes/css.js +14 -13
  10. data/vendor/assets/javascripts/codemirror/modes/django.js +3 -4
  11. data/vendor/assets/javascripts/codemirror/modes/haskell-literate.js +43 -0
  12. data/vendor/assets/javascripts/codemirror/modes/jade.js +3 -3
  13. data/vendor/assets/javascripts/codemirror/modes/javascript.js +15 -4
  14. data/vendor/assets/javascripts/codemirror/modes/jsx.js +147 -0
  15. data/vendor/assets/javascripts/codemirror/modes/julia.js +143 -78
  16. data/vendor/assets/javascripts/codemirror/modes/markdown.js +1 -1
  17. data/vendor/assets/javascripts/codemirror/modes/nginx.js +1 -1
  18. data/vendor/assets/javascripts/codemirror/modes/ruby.js +1 -1
  19. data/vendor/assets/javascripts/codemirror/modes/swift.js +42 -3
  20. data/vendor/assets/javascripts/codemirror/modes/xml.js +78 -69
  21. data/vendor/assets/javascripts/codemirror/modes/yaml-frontmatter.js +1 -1
  22. data/vendor/assets/stylesheets/codemirror/modes/tiki.css +1 -1
  23. data/vendor/assets/stylesheets/codemirror/themes/mbo.css +1 -1
  24. data/vendor/assets/stylesheets/codemirror/themes/monokai.css +1 -0
  25. metadata +3 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b8e61cc3f102bb8df59250814f8e085cbed2276
4
- data.tar.gz: 94a4dc1242f2c4c35f5f3471b539b2e120a71776
3
+ metadata.gz: 1929b6a736399491a5fbf53a11bca4735924bfa2
4
+ data.tar.gz: 022e71456c14fad9f3b6cb764a4d7de3dd594769
5
5
  SHA512:
6
- metadata.gz: cbe960c480acaa3d22287d67bee4d8a2f29ba62b5ff4e75b8c9db284fb0e419db0a693477a1a7d4e9dbc0aa67a1b1f985230a7ed4cfdc7b583be2928a15faaa4
7
- data.tar.gz: a8a31612e7bd919fa5ddff87dee92782e97fe38bf57a838f0b12be52381682e2c49d4515bfa9b86ec539a24f0eb820b48f53b3c3c5cc7ee7344ab2f111f4288b
6
+ metadata.gz: 7e57b062d2e7529735bb27007f5a1e51a2d96e85a2f446c50708beb531b8bcc3bb091cc7dd9228fac3be69b3021b90063423b9424483a1fc3f06c90a450e55a9
7
+ data.tar.gz: d03c8b1a078dc4b251510e56e69759c153485306d0fad08590af3d80b44bf99f2332998115e933f793e57eaa3fa1d9f9c04a4dca73f465617642b50bbecbb50f
@@ -1,6 +1,6 @@
1
1
  module Codemirror
2
2
  module Rails
3
- VERSION = '5.10'
4
- CODEMIRROR_VERSION = '5.10'
3
+ VERSION = '5.11'
4
+ CODEMIRROR_VERSION = '5.11'
5
5
  end
6
6
  end
@@ -1258,6 +1258,7 @@
1258
1258
  });
1259
1259
 
1260
1260
  function prepareCopyCut(e) {
1261
+ if (signalDOMEvent(cm, e)) return
1261
1262
  if (cm.somethingSelected()) {
1262
1263
  lastCopied = cm.getSelections();
1263
1264
  if (input.inaccurateSelection) {
@@ -1615,6 +1616,7 @@
1615
1616
  });
1616
1617
 
1617
1618
  function onCopyCut(e) {
1619
+ if (signalDOMEvent(cm, e)) return
1618
1620
  if (cm.somethingSelected()) {
1619
1621
  lastCopied = cm.getSelections();
1620
1622
  if (e.type == "cut") cm.replaceSelection("", null, "cut");
@@ -3433,7 +3435,7 @@
3433
3435
  return dx * dx + dy * dy > 20 * 20;
3434
3436
  }
3435
3437
  on(d.scroller, "touchstart", function(e) {
3436
- if (!isMouseLikeTouchEvent(e)) {
3438
+ if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {
3437
3439
  clearTimeout(touchFinished);
3438
3440
  var now = +new Date;
3439
3441
  d.activeTouch = {start: now, moved: false,
@@ -3562,7 +3564,7 @@
3562
3564
  // not interfere with, such as a scrollbar or widget.
3563
3565
  function onMouseDown(e) {
3564
3566
  var cm = this, display = cm.display;
3565
- if (display.activeTouch && display.input.supportsTouch() || signalDOMEvent(cm, e)) return;
3567
+ if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) return;
3566
3568
  display.shift = e.shiftKey;
3567
3569
 
3568
3570
  if (eventInWidget(display, e)) {
@@ -4814,10 +4816,9 @@
4814
4816
  function findPosH(doc, pos, dir, unit, visually) {
4815
4817
  var line = pos.line, ch = pos.ch, origDir = dir;
4816
4818
  var lineObj = getLine(doc, line);
4817
- var possible = true;
4818
4819
  function findNextLine() {
4819
4820
  var l = line + dir;
4820
- if (l < doc.first || l >= doc.first + doc.size) return (possible = false);
4821
+ if (l < doc.first || l >= doc.first + doc.size) return false
4821
4822
  line = l;
4822
4823
  return lineObj = getLine(doc, l);
4823
4824
  }
@@ -4827,14 +4828,16 @@
4827
4828
  if (!boundToLine && findNextLine()) {
4828
4829
  if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);
4829
4830
  else ch = dir < 0 ? lineObj.text.length : 0;
4830
- } else return (possible = false);
4831
+ } else return false
4831
4832
  } else ch = next;
4832
4833
  return true;
4833
4834
  }
4834
4835
 
4835
- if (unit == "char") moveOnce();
4836
- else if (unit == "column") moveOnce(true);
4837
- else if (unit == "word" || unit == "group") {
4836
+ if (unit == "char") {
4837
+ moveOnce()
4838
+ } else if (unit == "column") {
4839
+ moveOnce(true)
4840
+ } else if (unit == "word" || unit == "group") {
4838
4841
  var sawType = null, group = unit == "group";
4839
4842
  var helper = doc.cm && doc.cm.getHelper(pos, "wordChars");
4840
4843
  for (var first = true;; first = false) {
@@ -4855,7 +4858,7 @@
4855
4858
  }
4856
4859
  }
4857
4860
  var result = skipAtomic(doc, Pos(line, ch), pos, origDir, true);
4858
- if (!possible) result.hitSide = true;
4861
+ if (!cmp(pos, result)) result.hitSide = true;
4859
4862
  return result;
4860
4863
  }
4861
4864
 
@@ -7113,14 +7116,14 @@
7113
7116
  if (endStyles) for (var j = 0; j < endStyles.length; j += 2)
7114
7117
  if (endStyles[j + 1] == nextChange) spanEndStyle += " " + endStyles[j]
7115
7118
 
7119
+ if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)
7120
+ buildCollapsedSpan(builder, 0, foundBookmarks[j]);
7116
7121
  if (collapsed && (collapsed.from || 0) == pos) {
7117
7122
  buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,
7118
7123
  collapsed.marker, collapsed.from == null);
7119
7124
  if (collapsed.to == null) return;
7120
7125
  if (collapsed.to == pos) collapsed = false;
7121
7126
  }
7122
- if (!collapsed && foundBookmarks.length) for (var j = 0; j < foundBookmarks.length; ++j)
7123
- buildCollapsedSpan(builder, 0, foundBookmarks[j]);
7124
7127
  }
7125
7128
  if (pos >= len) break;
7126
7129
 
@@ -8881,7 +8884,7 @@
8881
8884
 
8882
8885
  // THE END
8883
8886
 
8884
- CodeMirror.version = "5.10.0";
8887
+ CodeMirror.version = "5.11.0";
8885
8888
 
8886
8889
  return CodeMirror;
8887
8890
  });
@@ -63,7 +63,7 @@
63
63
  }
64
64
  for (var i = ranges.length - 1; i >= 0; i--) {
65
65
  var cur = ranges[i].head;
66
- cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1));
66
+ cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1), "+delete");
67
67
  }
68
68
  }
69
69
 
@@ -20,7 +20,7 @@
20
20
  cm.off("viewportChange", onViewportChange);
21
21
  cm.off("fold", onFold);
22
22
  cm.off("unfold", onFold);
23
- cm.off("swapDoc", updateInViewport);
23
+ cm.off("swapDoc", onChange);
24
24
  }
25
25
  if (val) {
26
26
  cm.state.foldGutter = new State(parseOptions(val));
@@ -30,7 +30,7 @@
30
30
  cm.on("viewportChange", onViewportChange);
31
31
  cm.on("fold", onFold);
32
32
  cm.on("unfold", onFold);
33
- cm.on("swapDoc", updateInViewport);
33
+ cm.on("swapDoc", onChange);
34
34
  }
35
35
  });
36
36
 
@@ -16,13 +16,14 @@
16
16
  // highlighted only if the selected text is a word. showToken, when enabled,
17
17
  // will cause the current token to be highlighted when nothing is selected.
18
18
  // delay is used to specify how much time to wait, in milliseconds, before
19
- // highlighting the matches.
19
+ // highlighting the matches. If annotateScrollbar is enabled, the occurances
20
+ // will be highlighted on the scrollbar via the matchesonscrollbar addon.
20
21
 
21
22
  (function(mod) {
22
23
  if (typeof exports == "object" && typeof module == "object") // CommonJS
23
- mod(require("../../lib/codemirror"));
24
+ mod(require("../../lib/codemirror"), require("./matchesonscrollbar"));
24
25
  else if (typeof define == "function" && define.amd) // AMD
25
- define(["../../lib/codemirror"], mod);
26
+ define(["../../lib/codemirror", "./matchesonscrollbar"], mod);
26
27
  else // Plain browser env
27
28
  mod(CodeMirror);
28
29
  })(function(CodeMirror) {
@@ -40,18 +41,19 @@
40
41
  this.showToken = options.showToken;
41
42
  this.delay = options.delay;
42
43
  this.wordsOnly = options.wordsOnly;
44
+ this.annotateScrollbar = options.annotateScrollbar;
43
45
  }
44
46
  if (this.style == null) this.style = DEFAULT_TOKEN_STYLE;
45
47
  if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS;
46
48
  if (this.delay == null) this.delay = DEFAULT_DELAY;
47
49
  if (this.wordsOnly == null) this.wordsOnly = DEFAULT_WORDS_ONLY;
48
50
  this.overlay = this.timeout = null;
51
+ this.matchesonscroll = null;
49
52
  }
50
53
 
51
54
  CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) {
52
55
  if (old && old != CodeMirror.Init) {
53
- var over = cm.state.matchHighlighter.overlay;
54
- if (over) cm.removeOverlay(over);
56
+ removeOverlay(cm);
55
57
  clearTimeout(cm.state.matchHighlighter.timeout);
56
58
  cm.state.matchHighlighter = null;
57
59
  cm.off("cursorActivity", cursorActivity);
@@ -69,20 +71,39 @@
69
71
  state.timeout = setTimeout(function() {highlightMatches(cm);}, state.delay);
70
72
  }
71
73
 
74
+ function addOverlay(cm, query, hasBoundary, style) {
75
+ var state = cm.state.matchHighlighter;
76
+ cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style));
77
+ if (state.annotateScrollbar) {
78
+ var searchFor = hasBoundary ? new RegExp("\\b" + query + "\\b") : query;
79
+ state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, true,
80
+ {className: "CodeMirror-selection-highlight-scrollbar"});
81
+ }
82
+ }
83
+
84
+ function removeOverlay(cm) {
85
+ var state = cm.state.matchHighlighter;
86
+ if (state.overlay) {
87
+ cm.removeOverlay(state.overlay);
88
+ state.overlay = null;
89
+ if (state.annotateScrollbar) {
90
+ state.matchesonscroll.clear();
91
+ state.matchesonscroll = null;
92
+ }
93
+ }
94
+ }
95
+
72
96
  function highlightMatches(cm) {
73
97
  cm.operation(function() {
74
98
  var state = cm.state.matchHighlighter;
75
- if (state.overlay) {
76
- cm.removeOverlay(state.overlay);
77
- state.overlay = null;
78
- }
99
+ removeOverlay(cm);
79
100
  if (!cm.somethingSelected() && state.showToken) {
80
101
  var re = state.showToken === true ? /[\w$]/ : state.showToken;
81
102
  var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start;
82
103
  while (start && re.test(line.charAt(start - 1))) --start;
83
104
  while (end < line.length && re.test(line.charAt(end))) ++end;
84
105
  if (start < end)
85
- cm.addOverlay(state.overlay = makeOverlay(line.slice(start, end), re, state.style));
106
+ addOverlay(cm, line.slice(start, end), re, state.style);
86
107
  return;
87
108
  }
88
109
  var from = cm.getCursor("from"), to = cm.getCursor("to");
@@ -90,7 +111,7 @@
90
111
  if (state.wordsOnly && !isWord(cm, from, to)) return;
91
112
  var selection = cm.getRange(from, to).replace(/^\s+|\s+$/g, "");
92
113
  if (selection.length >= state.minChars)
93
- cm.addOverlay(state.overlay = makeOverlay(selection, false, state.style));
114
+ addOverlay(cm, selection, false, state.style);
94
115
  });
95
116
  }
96
117
 
@@ -264,9 +264,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
264
264
  function cppHook(stream, state) {
265
265
  if (!state.startOfLine) return false
266
266
  for (var ch, next = null; ch = stream.peek();) {
267
- if (!ch) {
268
- break
269
- } else if (ch == "\\" && stream.match(/^.$/)) {
267
+ if (ch == "\\" && stream.match(/^.$/)) {
270
268
  next = cppHook
271
269
  break
272
270
  } else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) {
@@ -59,7 +59,8 @@ CodeMirror.defineMode("clojure", function (options) {
59
59
  sign: /[+-]/,
60
60
  exponent: /e/i,
61
61
  keyword_char: /[^\s\(\[\;\)\]]/,
62
- symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/
62
+ symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/,
63
+ block_indent: /^(?:def|with)[^\/]+$|\/(?:def|with)/
63
64
  };
64
65
 
65
66
  function stateStack(indent, type, prev) { // represents a state stack object
@@ -96,6 +97,9 @@ CodeMirror.defineMode("clojure", function (options) {
96
97
  if ( '.' == stream.peek() ) {
97
98
  stream.eat('.');
98
99
  stream.eatWhile(tests.digit);
100
+ } else if ('/' == stream.peek() ) {
101
+ stream.eat('/');
102
+ stream.eatWhile(tests.digit);
99
103
  }
100
104
 
101
105
  if ( stream.eat(tests.exponent) ) {
@@ -139,7 +143,7 @@ CodeMirror.defineMode("clojure", function (options) {
139
143
  }
140
144
 
141
145
  // skip spaces
142
- if (stream.eatSpace()) {
146
+ if (state.mode != "string" && stream.eatSpace()) {
143
147
  return null;
144
148
  }
145
149
  var returnType = null;
@@ -187,7 +191,7 @@ CodeMirror.defineMode("clojure", function (options) {
187
191
  }
188
192
 
189
193
  if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) ||
190
- /^(?:def|with)/.test(keyWord))) { // indent-word
194
+ tests.block_indent.test(keyWord))) { // indent-word
191
195
  pushStack(state, indentTemp + INDENT_WORD_SKIP, ch);
192
196
  } else { // non-indent word
193
197
  // we continue eating the spaces
@@ -240,5 +244,6 @@ CodeMirror.defineMode("clojure", function (options) {
240
244
  });
241
245
 
242
246
  CodeMirror.defineMIME("text/x-clojure", "clojure");
247
+ CodeMirror.defineMIME("text/x-clojurescript", "clojure");
243
248
 
244
249
  });
@@ -452,8 +452,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
452
452
  "animation-direction", "animation-duration", "animation-fill-mode",
453
453
  "animation-iteration-count", "animation-name", "animation-play-state",
454
454
  "animation-timing-function", "appearance", "azimuth", "backface-visibility",
455
- "background", "background-attachment", "background-clip", "background-color",
456
- "background-image", "background-origin", "background-position",
455
+ "background", "background-attachment", "background-blend-mode", "background-clip",
456
+ "background-color", "background-image", "background-origin", "background-position",
457
457
  "background-repeat", "background-size", "baseline-shift", "binding",
458
458
  "bleed", "bookmark-label", "bookmark-level", "bookmark-state",
459
459
  "bookmark-target", "border", "border-bottom", "border-bottom-color",
@@ -597,11 +597,12 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
597
597
  "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret",
598
598
  "cell", "center", "checkbox", "circle", "cjk-decimal", "cjk-earthly-branch",
599
599
  "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
600
- "col-resize", "collapse", "column", "column-reverse", "compact", "condensed", "contain", "content",
600
+ "col-resize", "collapse", "color", "color-burn", "color-dodge", "column", "column-reverse",
601
+ "compact", "condensed", "contain", "content",
601
602
  "content-box", "context-menu", "continuous", "copy", "counter", "counters", "cover", "crop",
602
- "cross", "crosshair", "currentcolor", "cursive", "cyclic", "dashed", "decimal",
603
+ "cross", "crosshair", "currentcolor", "cursive", "cyclic", "darken", "dashed", "decimal",
603
604
  "decimal-leading-zero", "default", "default-button", "destination-atop",
604
- "destination-in", "destination-out", "destination-over", "devanagari",
605
+ "destination-in", "destination-out", "destination-over", "devanagari", "difference",
605
606
  "disc", "discard", "disclosure-closed", "disclosure-open", "document",
606
607
  "dot-dash", "dot-dot-dash",
607
608
  "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out",
@@ -612,23 +613,23 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
612
613
  "ethiopic-halehame-gez", "ethiopic-halehame-om-et",
613
614
  "ethiopic-halehame-sid-et", "ethiopic-halehame-so-et",
614
615
  "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig",
615
- "ethiopic-numeric", "ew-resize", "expanded", "extends", "extra-condensed",
616
+ "ethiopic-numeric", "ew-resize", "exclusion", "expanded", "extends", "extra-condensed",
616
617
  "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "flex", "flex-end", "flex-start", "footnotes",
617
618
  "forwards", "from", "geometricPrecision", "georgian", "graytext", "groove",
618
- "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hebrew",
619
+ "gujarati", "gurmukhi", "hand", "hangul", "hangul-consonant", "hard-light", "hebrew",
619
620
  "help", "hidden", "hide", "higher", "highlight", "highlighttext",
620
- "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "icon", "ignore",
621
+ "hiragana", "hiragana-iroha", "horizontal", "hsl", "hsla", "hue", "icon", "ignore",
621
622
  "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite",
622
623
  "infobackground", "infotext", "inherit", "initial", "inline", "inline-axis",
623
624
  "inline-block", "inline-flex", "inline-table", "inset", "inside", "intrinsic", "invert",
624
625
  "italic", "japanese-formal", "japanese-informal", "justify", "kannada",
625
626
  "katakana", "katakana-iroha", "keep-all", "khmer",
626
627
  "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal",
627
- "landscape", "lao", "large", "larger", "left", "level", "lighter",
628
+ "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten",
628
629
  "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem",
629
630
  "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
630
631
  "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
631
- "lower-roman", "lowercase", "ltr", "malayalam", "match", "matrix", "matrix3d",
632
+ "lower-roman", "lowercase", "ltr", "luminosity", "malayalam", "match", "matrix", "matrix3d",
632
633
  "media-controls-background", "media-current-time-display",
633
634
  "media-fullscreen-button", "media-mute-button", "media-play-button",
634
635
  "media-return-to-realtime-button", "media-rewind-button",
@@ -637,7 +638,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
637
638
  "media-volume-slider-container", "media-volume-sliderthumb", "medium",
638
639
  "menu", "menulist", "menulist-button", "menulist-text",
639
640
  "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic",
640
- "mix", "mongolian", "monospace", "move", "multiple", "myanmar", "n-resize",
641
+ "mix", "mongolian", "monospace", "move", "multiple", "multiply", "myanmar", "n-resize",
641
642
  "narrower", "ne-resize", "nesw-resize", "no-close-quote", "no-drop",
642
643
  "no-open-quote", "no-repeat", "none", "normal", "not-allowed", "nowrap",
643
644
  "ns-resize", "numbers", "numeric", "nw-resize", "nwse-resize", "oblique", "octal", "open-quote",
@@ -651,7 +652,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
651
652
  "repeating-radial-gradient", "repeat-x", "repeat-y", "reset", "reverse",
652
653
  "rgb", "rgba", "ridge", "right", "rotate", "rotate3d", "rotateX", "rotateY",
653
654
  "rotateZ", "round", "row", "row-resize", "row-reverse", "rtl", "run-in", "running",
654
- "s-resize", "sans-serif", "scale", "scale3d", "scaleX", "scaleY", "scaleZ",
655
+ "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
655
656
  "scroll", "scrollbar", "se-resize", "searchfield",
656
657
  "searchfield-cancel-button", "searchfield-decoration",
657
658
  "searchfield-results-button", "searchfield-results-decoration",
@@ -659,7 +660,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
659
660
  "simp-chinese-formal", "simp-chinese-informal", "single",
660
661
  "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
661
662
  "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
662
- "small", "small-caps", "small-caption", "smaller", "solid", "somali",
663
+ "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
663
664
  "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "spell-out", "square",
664
665
  "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
665
666
  "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "table",
@@ -61,7 +61,7 @@
61
61
 
62
62
  // Ignore completely any stream series that do not match the
63
63
  // Django template opening tags.
64
- while (stream.next() != null && !stream.match("{{", false) && !stream.match("{%", false)) {}
64
+ while (stream.next() != null && !stream.match(/\{[{%#]/, false)) {}
65
65
  return null;
66
66
  }
67
67
 
@@ -317,9 +317,8 @@
317
317
 
318
318
  // Mark everything as comment inside the tag and the tag itself.
319
319
  function inComment (stream, state) {
320
- if (stream.match("#}")) {
321
- state.tokenize = tokenBase;
322
- }
320
+ if (stream.match(/^.*?#\}/)) state.tokenize = tokenBase
321
+ else stream.skipToEnd()
323
322
  return "comment";
324
323
  }
325
324
 
@@ -0,0 +1,43 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function (mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"), require("../haskell/haskell"))
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../haskell/haskell"], mod)
9
+ else // Plain browser env
10
+ mod(CodeMirror)
11
+ })(function (CodeMirror) {
12
+ "use strict"
13
+
14
+ CodeMirror.defineMode("haskell-literate", function (config, parserConfig) {
15
+ var baseMode = CodeMirror.getMode(config, (parserConfig && parserConfig.base) || "haskell")
16
+
17
+ return {
18
+ startState: function () {
19
+ return {
20
+ inCode: false,
21
+ baseState: CodeMirror.startState(baseMode)
22
+ }
23
+ },
24
+ token: function (stream, state) {
25
+ if (stream.sol()) {
26
+ if (state.inCode = stream.eat(">"))
27
+ return "meta"
28
+ }
29
+ if (state.inCode) {
30
+ return baseMode.token(stream, state.baseState)
31
+ } else {
32
+ stream.skipToEnd()
33
+ return "comment"
34
+ }
35
+ },
36
+ innerMode: function (state) {
37
+ return state.inCode ? {state: state.baseState, mode: baseMode} : null
38
+ }
39
+ }
40
+ }, "haskell")
41
+
42
+ CodeMirror.defineMIME("text/x-literate-haskell", "haskell-literate")
43
+ })
@@ -74,7 +74,7 @@ CodeMirror.defineMode('jade', function (config) {
74
74
  res.javaScriptArguments = this.javaScriptArguments;
75
75
  res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth;
76
76
  res.isInterpolating = this.isInterpolating;
77
- res.interpolationNesting = this.intpolationNesting;
77
+ res.interpolationNesting = this.interpolationNesting;
78
78
 
79
79
  res.jsState = CodeMirror.copyState(jsMode, this.jsState);
80
80
 
@@ -167,7 +167,7 @@ CodeMirror.defineMode('jade', function (config) {
167
167
  if (state.interpolationNesting < 0) {
168
168
  stream.next();
169
169
  state.isInterpolating = false;
170
- return 'puncutation';
170
+ return 'punctuation';
171
171
  }
172
172
  } else if (stream.peek() === '{') {
173
173
  state.interpolationNesting++;
@@ -583,7 +583,7 @@ CodeMirror.defineMode('jade', function (config) {
583
583
  copyState: copyState,
584
584
  token: nextToken
585
585
  };
586
- });
586
+ }, 'javascript', 'css', 'htmlmixed');
587
587
 
588
588
  CodeMirror.defineMIME('text/x-jade', 'jade');
589
589