codemirror-rails 5.8 → 5.9

Sign up to get free protection for your applications and to get access to all the features.
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 +36 -20
  4. data/vendor/assets/javascripts/codemirror/addons/fold/comment-fold.js +3 -1
  5. data/vendor/assets/javascripts/codemirror/addons/hint/show-hint.js +8 -1
  6. data/vendor/assets/javascripts/codemirror/addons/runmode/runmode.node.js +1 -0
  7. data/vendor/assets/javascripts/codemirror/addons/scroll/annotatescrollbar.js +1 -1
  8. data/vendor/assets/javascripts/codemirror/addons/search/search.js +1 -1
  9. data/vendor/assets/javascripts/codemirror/addons/tern/tern.js +1 -0
  10. data/vendor/assets/javascripts/codemirror/keymaps/vim.js +1 -1
  11. data/vendor/assets/javascripts/codemirror/modes/clike.js +40 -9
  12. data/vendor/assets/javascripts/codemirror/modes/css.js +1 -1
  13. data/vendor/assets/javascripts/codemirror/modes/dart.js +3 -3
  14. data/vendor/assets/javascripts/codemirror/modes/django.js +8 -8
  15. data/vendor/assets/javascripts/codemirror/modes/haml.js +4 -2
  16. data/vendor/assets/javascripts/codemirror/modes/handlebars.js +2 -2
  17. data/vendor/assets/javascripts/codemirror/modes/javascript.js +6 -8
  18. data/vendor/assets/javascripts/codemirror/modes/julia.js +1 -1
  19. data/vendor/assets/javascripts/codemirror/modes/markdown.js +1 -1
  20. data/vendor/assets/javascripts/codemirror/modes/nsis.js +37 -5
  21. data/vendor/assets/javascripts/codemirror/modes/python.js +17 -28
  22. data/vendor/assets/javascripts/codemirror/modes/rust.js +16 -3
  23. data/vendor/assets/javascripts/codemirror/modes/sql.js +1 -1
  24. data/vendor/assets/stylesheets/codemirror/themes/material.css +4 -4
  25. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a62ba8fcdd98556c524029b28df974c5a88b1601
4
- data.tar.gz: fdf40baa6466b4723679d6f3b9834798a7cec253
3
+ metadata.gz: dd70c9d501e50ef6240ec8c1ac5cb711069a101d
4
+ data.tar.gz: d8350692868e90e6c20ee38c7f4357e394a31b94
5
5
  SHA512:
6
- metadata.gz: 21c62cdaa7357fcaacfcbfe670f755e9bc7daafdbe75e05abf38d29e8aaed85cb50718b00129449bb6553fe59d99e38ffe95ba7d0db1370ad7cc6f11b645e407
7
- data.tar.gz: b5dfde01f65c7b1d05dd7b9099dcb2fa2ee897ba6e7510a5efa4cb3e46c12248d44eefad1d59ccdd1b613d39554f44d7ec3ac08f35d1b64d37c3f6e9dd6cd998
6
+ metadata.gz: 7aeb9c1f1762dc429f13c5750e3e54fc4affe1f42826781f156746bff618072e80e03d84766c3c7c5f30b10e5ea490e84dbc9ce85e66379d90754077ea0659fe
7
+ data.tar.gz: 9f375666986c29e6d43982137a47030c7f07ba6a2e9f129bdf27dee20ca01e32d5cd91bd9d24be84b58eba90596f44fe7a043dbd96cc4bb0440ec4eb167bbbf3
@@ -1,6 +1,6 @@
1
1
  module Codemirror
2
2
  module Rails
3
- VERSION = '5.8'
4
- CODEMIRROR_VERSION = '5.8'
3
+ VERSION = '5.9'
4
+ CODEMIRROR_VERSION = '5.9'
5
5
  end
6
6
  end
@@ -410,7 +410,7 @@
410
410
  if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal");
411
411
  });
412
412
 
413
- this.checkedOverlay = false;
413
+ this.checkedZeroWidth = false;
414
414
  // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
415
415
  if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px";
416
416
  }
@@ -445,29 +445,43 @@
445
445
  this.horiz.firstChild.style.width = "0";
446
446
  }
447
447
 
448
- if (!this.checkedOverlay && measure.clientHeight > 0) {
449
- if (sWidth == 0) this.overlayHack();
450
- this.checkedOverlay = true;
448
+ if (!this.checkedZeroWidth && measure.clientHeight > 0) {
449
+ if (sWidth == 0) this.zeroWidthHack();
450
+ this.checkedZeroWidth = true;
451
451
  }
452
452
 
453
453
  return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0};
454
454
  },
455
455
  setScrollLeft: function(pos) {
456
456
  if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos;
457
+ if (this.disableHoriz) this.enableZeroWidthBar(this.horiz, this.disableHoriz);
457
458
  },
458
459
  setScrollTop: function(pos) {
459
460
  if (this.vert.scrollTop != pos) this.vert.scrollTop = pos;
461
+ if (this.disableVert) this.enableZeroWidthBar(this.vert, this.disableVert);
460
462
  },
461
- overlayHack: function() {
463
+ zeroWidthHack: function() {
462
464
  var w = mac && !mac_geMountainLion ? "12px" : "18px";
463
- this.horiz.style.minHeight = this.vert.style.minWidth = w;
464
- var self = this;
465
- var barMouseDown = function(e) {
466
- if (e_target(e) != self.vert && e_target(e) != self.horiz)
467
- operation(self.cm, onMouseDown)(e);
468
- };
469
- on(this.vert, "mousedown", barMouseDown);
470
- on(this.horiz, "mousedown", barMouseDown);
465
+ this.horiz.style.height = this.vert.style.width = w;
466
+ this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none";
467
+ this.disableHoriz = new Delayed;
468
+ this.disableVert = new Delayed;
469
+ },
470
+ enableZeroWidthBar: function(bar, delay) {
471
+ bar.style.pointerEvents = "auto";
472
+ function maybeDisable() {
473
+ // To find out whether the scrollbar is still visible, we
474
+ // check whether the element under the pixel in the bottom
475
+ // left corner of the scrollbar box is the scrollbar box
476
+ // itself (when the bar is still visible) or its filler child
477
+ // (when the bar is hidden). If it is still visible, we keep
478
+ // it enabled, if it's hidden, we disable pointer events.
479
+ var box = bar.getBoundingClientRect();
480
+ var elt = document.elementFromPoint(box.left + 1, box.bottom - 1);
481
+ if (elt != bar) bar.style.pointerEvents = "none";
482
+ else delay.set(1000, maybeDisable);
483
+ }
484
+ delay.set(1000, maybeDisable);
471
485
  },
472
486
  clear: function() {
473
487
  var parent = this.horiz.parentNode;
@@ -3093,7 +3107,8 @@
3093
3107
 
3094
3108
  if (cm.state.focused && op.updateInput)
3095
3109
  cm.display.input.reset(op.typing);
3096
- if (op.focus && op.focus == activeElt()) ensureFocus(op.cm);
3110
+ if (op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus()))
3111
+ ensureFocus(op.cm);
3097
3112
  }
3098
3113
 
3099
3114
  function endOperation_finish(op) {
@@ -3778,7 +3793,7 @@
3778
3793
 
3779
3794
  // Determines whether an event happened in the gutter, and fires the
3780
3795
  // handlers for the corresponding event.
3781
- function gutterEvent(cm, e, type, prevent, signalfn) {
3796
+ function gutterEvent(cm, e, type, prevent) {
3782
3797
  try { var mX = e.clientX, mY = e.clientY; }
3783
3798
  catch(e) { return false; }
3784
3799
  if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false;
@@ -3795,14 +3810,14 @@
3795
3810
  if (g && g.getBoundingClientRect().right >= mX) {
3796
3811
  var line = lineAtHeight(cm.doc, mY);
3797
3812
  var gutter = cm.options.gutters[i];
3798
- signalfn(cm, type, cm, line, gutter, e);
3813
+ signal(cm, type, cm, line, gutter, e);
3799
3814
  return e_defaultPrevented(e);
3800
3815
  }
3801
3816
  }
3802
3817
  }
3803
3818
 
3804
3819
  function clickInGutter(cm, e) {
3805
- return gutterEvent(cm, e, "gutterClick", true, signalLater);
3820
+ return gutterEvent(cm, e, "gutterClick", true);
3806
3821
  }
3807
3822
 
3808
3823
  // Kludge to work around strange IE behavior where it'll sometimes
@@ -4241,7 +4256,7 @@
4241
4256
 
4242
4257
  function contextMenuInGutter(cm, e) {
4243
4258
  if (!hasHandler(cm, "gutterContextMenu")) return false;
4244
- return gutterEvent(cm, e, "gutterContextMenu", false, signal);
4259
+ return gutterEvent(cm, e, "gutterContextMenu", false);
4245
4260
  }
4246
4261
 
4247
4262
  // UPDATING
@@ -7074,7 +7089,7 @@
7074
7089
  spanEndStyle = "";
7075
7090
  }
7076
7091
  if (m.className) spanStyle += " " + m.className;
7077
- if (m.css) css = m.css;
7092
+ if (m.css) css = (css ? css + ";" : "") + m.css;
7078
7093
  if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle;
7079
7094
  if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle;
7080
7095
  if (m.title && !title) title = m.title;
@@ -7343,6 +7358,7 @@
7343
7358
  this.id = ++nextDocId;
7344
7359
  this.modeOption = mode;
7345
7360
  this.lineSep = lineSep;
7361
+ this.extend = false;
7346
7362
 
7347
7363
  if (typeof text == "string") text = this.splitLines(text);
7348
7364
  updateDoc(this, {from: start, to: start, text: text});
@@ -8850,7 +8866,7 @@
8850
8866
 
8851
8867
  // THE END
8852
8868
 
8853
- CodeMirror.version = "5.8.0";
8869
+ CodeMirror.version = "5.9.0";
8854
8870
 
8855
8871
  return CodeMirror;
8856
8872
  });
@@ -28,7 +28,9 @@ CodeMirror.registerGlobalHelper("fold", "comment", function(mode) {
28
28
  continue;
29
29
  }
30
30
  if (pass == 1 && found < start.ch) return;
31
- if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) {
31
+ if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1))) &&
32
+ (lineText.slice(found - endToken.length, found) == endToken ||
33
+ !/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found))))) {
32
34
  startCh = found + startToken.length;
33
35
  break;
34
36
  }
@@ -295,6 +295,13 @@
295
295
  setTimeout(function(){cm.focus();}, 20);
296
296
  });
297
297
 
298
+ if (completion.options.completeOnSingleClick)
299
+ CodeMirror.on(hints, "mousemove", function(e) {
300
+ var elt = getHintElement(hints, e.target || e.srcElement);
301
+ if (elt && elt.hintId != null)
302
+ widget.changeActive(elt.hintId);
303
+ });
304
+
298
305
  CodeMirror.signal(data, "select", completions[0], hints.firstChild);
299
306
  return true;
300
307
  }
@@ -430,7 +437,7 @@
430
437
  alignWithWord: true,
431
438
  closeCharacters: /[\s()\[\]{};:>,]/,
432
439
  closeOnUnfocus: true,
433
- completeOnSingleClick: false,
440
+ completeOnSingleClick: true,
434
441
  container: null,
435
442
  customKeys: null,
436
443
  extraKeys: null
@@ -176,3 +176,4 @@ exports.runMode = function(string, modespec, callback, options) {
176
176
  };
177
177
 
178
178
  require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")];
179
+ require.cache[require.resolve("../../addon/runmode/runmode")] = require.cache[require.resolve("./runmode.node")];
@@ -51,7 +51,7 @@
51
51
  Annotation.prototype.computeScale = function() {
52
52
  var cm = this.cm;
53
53
  var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight - this.buttonHeight * 2) /
54
- cm.heightAtLine(cm.lastLine() + 1, "local");
54
+ cm.getScrollerElement().scrollHeight
55
55
  if (hScale != this.hScale) {
56
56
  this.hScale = hScale;
57
57
  return true;
@@ -29,7 +29,7 @@
29
29
  query.lastIndex = stream.pos;
30
30
  var match = query.exec(stream.string);
31
31
  if (match && match.index == stream.pos) {
32
- stream.pos += match[0].length;
32
+ stream.pos += match[0].length || 1;
33
33
  return "searching";
34
34
  } else if (match) {
35
35
  stream.pos = match.index;
@@ -135,6 +135,7 @@
135
135
  },
136
136
 
137
137
  destroy: function () {
138
+ closeArgHints(this)
138
139
  if (this.worker) {
139
140
  this.worker.terminate();
140
141
  this.worker = null;
@@ -3208,7 +3208,7 @@
3208
3208
  return cur;
3209
3209
  }
3210
3210
 
3211
- /*
3211
+ /**
3212
3212
  * Returns the boundaries of the next word. If the cursor in the middle of
3213
3213
  * the word, then returns the boundaries of the current word, starting at
3214
3214
  * the cursor. If the cursor is at the start/end of a word, and we are going
@@ -27,7 +27,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
27
27
  indentSwitch = parserConfig.indentSwitch !== false,
28
28
  namespaceSeparator = parserConfig.namespaceSeparator,
29
29
  isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
30
- isNumberChar = parserConfig.isNumberChar || /\d/,
30
+ numberStart = parserConfig.numberStart || /[\d\.]/,
31
+ number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
31
32
  isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
32
33
  endStatement = parserConfig.endStatement || /^[;:,]$/;
33
34
 
@@ -47,9 +48,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
47
48
  curPunc = ch;
48
49
  return null;
49
50
  }
50
- if (isNumberChar.test(ch)) {
51
- stream.eatWhile(/[\w\.]/);
52
- return "number";
51
+ if (numberStart.test(ch)) {
52
+ stream.backUp(1)
53
+ if (stream.match(number)) return "number"
54
+ stream.next()
53
55
  }
54
56
  if (ch == "/") {
55
57
  if (stream.eat("*")) {
@@ -220,6 +222,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
220
222
  }
221
223
  var closing = firstChar == ctx.type;
222
224
  var switchBlock = ctx.prev && ctx.prev.type == "switchstatement";
225
+ if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
226
+ while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
227
+ return ctx.indented
228
+ }
223
229
  if (isStatement(ctx.type))
224
230
  return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
225
231
  if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
@@ -252,8 +258,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
252
258
  }
253
259
  }
254
260
  var cKeywords = "auto if break case register continue return default do sizeof " +
255
- "static else struct switch extern typedef float union for " +
256
- "goto while enum const volatile";
261
+ "static else struct switch extern typedef union for goto while enum const volatile";
257
262
  var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";
258
263
 
259
264
  function cppHook(stream, state) {
@@ -530,19 +535,36 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
530
535
  modeProps: {closeBrackets: {triples: '"'}}
531
536
  });
532
537
 
538
+ function tokenKotlinString(tripleString){
539
+ return function (stream, state) {
540
+ var escaped = false, next, end = false;
541
+ while (!stream.eol()) {
542
+ if (!tripleString && !escaped && stream.match('"') ) {end = true; break;}
543
+ if (tripleString && stream.match('"""')) {end = true; break;}
544
+ next = stream.next();
545
+ if(!escaped && next == "$" && stream.match('{'))
546
+ stream.skipTo("}");
547
+ escaped = !escaped && next == "\\" && !tripleString;
548
+ }
549
+ if (end || !tripleString)
550
+ state.tokenize = null;
551
+ return "string";
552
+ }
553
+ }
554
+
533
555
  def("text/x-kotlin", {
534
556
  name: "clike",
535
557
  keywords: words(
536
558
  /*keywords*/
537
559
  "package as typealias class interface this super val " +
538
560
  "var fun for is in This throw return " +
539
- "break continue object if else while do try when !in !is as?" +
561
+ "break continue object if else while do try when !in !is as? " +
540
562
 
541
563
  /*soft keywords*/
542
564
  "file import where by get set abstract enum open inner override private public internal " +
543
565
  "protected catch finally out final vararg reified dynamic companion constructor init " +
544
566
  "sealed field property receiver param sparam lateinit data inline noinline tailrec " +
545
- "external annotation crossinline"
567
+ "external annotation crossinline const operator infix"
546
568
  ),
547
569
  types: words(
548
570
  /* package java.lang */
@@ -551,10 +573,18 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
551
573
  "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
552
574
  "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
553
575
  ),
576
+ intendSwitch: false,
577
+ indentStatements: false,
554
578
  multiLineStrings: true,
555
579
  blockKeywords: words("catch class do else finally for if where try while enum"),
556
580
  defKeywords: words("class val var object package interface fun"),
557
581
  atoms: words("true false null this"),
582
+ hooks: {
583
+ '"': function(stream, state) {
584
+ state.tokenize = tokenKotlinString(stream.match('""'));
585
+ return state.tokenize(stream, state);
586
+ }
587
+ },
558
588
  modeProps: {closeBrackets: {triples: '"'}}
559
589
  });
560
590
 
@@ -703,7 +733,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
703
733
  " native optional sealed see serializable shared suppressWarnings tagged throws variable"),
704
734
  isPunctuationChar: /[\[\]{}\(\),;\:\.`]/,
705
735
  isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
706
- isNumberChar: /[\d#$]/,
736
+ numberStart: /[\d#$]/,
737
+ number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
707
738
  multiLineStrings: true,
708
739
  typeFirstDefinitions: true,
709
740
  atoms: words("true false null larger smaller equal empty finished"),
@@ -228,7 +228,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
228
228
  if (type == "}" || type == "{") return popAndPass(type, stream, state);
229
229
  if (type == "(") return pushContext(state, stream, "parens");
230
230
 
231
- if (type == "hash" && !/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(stream.current())) {
231
+ if (type == "hash" && !/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(stream.current())) {
232
232
  override += " error";
233
233
  } else if (type == "word") {
234
234
  wordAsValue(stream);
@@ -15,7 +15,7 @@
15
15
  "implements get native operator set typedef with enum throw rethrow " +
16
16
  "assert break case continue default in return new deferred async await " +
17
17
  "try catch finally do else for if switch while import library export " +
18
- "part of show hide is").split(" ");
18
+ "part of show hide is as").split(" ");
19
19
  var blockKeywords = "try catch finally do else for if switch while".split(" ");
20
20
  var atoms = "true false null".split(" ");
21
21
  var builtins = "void bool num int double dynamic var String".split(" ");
@@ -46,7 +46,7 @@
46
46
  atoms: set(atoms),
47
47
  hooks: {
48
48
  "@": function(stream) {
49
- stream.eatWhile(/[\w\$_]/);
49
+ stream.eatWhile(/[\w\$_\.]/);
50
50
  return "meta";
51
51
  },
52
52
 
@@ -95,7 +95,7 @@
95
95
  state.tokenize = null;
96
96
  break;
97
97
  }
98
- escaped = !escaped && next == "\\";
98
+ escaped = !raw && !escaped && next == "\\";
99
99
  }
100
100
  return "string";
101
101
  }
@@ -14,14 +14,14 @@
14
14
  "use strict";
15
15
 
16
16
  CodeMirror.defineMode("django:inner", function() {
17
- var keywords = ["block", "endblock", "for", "endfor", "true", "false",
18
- "loop", "none", "self", "super", "if", "endif", "as",
19
- "else", "import", "with", "endwith", "without", "context", "ifequal", "endifequal",
20
- "ifnotequal", "endifnotequal", "extends", "include", "load", "comment",
21
- "endcomment", "empty", "url", "static", "trans", "blocktrans", "now", "regroup",
22
- "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle", "csrf_token",
23
- "autoescape", "endautoescape", "spaceless", "ssi", "templatetag",
24
- "verbatim", "endverbatim", "widthratio"],
17
+ var keywords = ["block", "endblock", "for", "endfor", "true", "false", "filter", "endfilter",
18
+ "loop", "none", "self", "super", "if", "elif", "endif", "as", "else", "import",
19
+ "with", "endwith", "without", "context", "ifequal", "endifequal", "ifnotequal",
20
+ "endifnotequal", "extends", "include", "load", "comment", "endcomment",
21
+ "empty", "url", "static", "trans", "blocktrans", "endblocktrans", "now",
22
+ "regroup", "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle",
23
+ "csrf_token", "autoescape", "endautoescape", "spaceless", "endspaceless",
24
+ "ssi", "templatetag", "verbatim", "endverbatim", "widthratio"],
25
25
  filters = ["add", "addslashes", "capfirst", "center", "cut", "date",
26
26
  "default", "default_if_none", "dictsort",
27
27
  "dictsortreversed", "divisibleby", "escape", "escapejs",
@@ -85,8 +85,10 @@
85
85
  state.tokenize = rubyInQuote(")");
86
86
  return state.tokenize(stream, state);
87
87
  } else if (ch == "{") {
88
- state.tokenize = rubyInQuote("}");
89
- return state.tokenize(stream, state);
88
+ if (!stream.match(/^\{%.*/)) {
89
+ state.tokenize = rubyInQuote("}");
90
+ return state.tokenize(stream, state);
91
+ }
90
92
  }
91
93
  }
92
94
 
@@ -21,8 +21,8 @@
21
21
  { regex: /\}\}/, pop: true, token: "tag" },
22
22
 
23
23
  // Double and single quotes
24
- { regex: /"(?:[^\\]|\\.)*?"/, token: "string" },
25
- { regex: /'(?:[^\\]|\\.)*?'/, token: "string" },
24
+ { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
25
+ { regex: /'(?:[^\\']|\\.)*'?/, token: "string" },
26
26
 
27
27
  // Handlebars keywords
28
28
  { regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" },
@@ -32,12 +32,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
32
32
  "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
33
33
  "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C,
34
34
  "var": kw("var"), "const": kw("var"), "let": kw("var"),
35
- "async": kw("async"), "function": kw("function"), "catch": kw("catch"),
35
+ "function": kw("function"), "catch": kw("catch"),
36
36
  "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
37
37
  "in": operator, "typeof": operator, "instanceof": operator,
38
38
  "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
39
39
  "this": kw("this"), "class": kw("class"), "super": kw("atom"),
40
- "await": C, "yield": C, "export": kw("export"), "import": kw("import"), "extends": C
40
+ "yield": C, "export": kw("export"), "import": kw("import"), "extends": C
41
41
  };
42
42
 
43
43
  // Extend the 'normal' keywords with the TypeScript language extensions
@@ -121,8 +121,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
121
121
  } else if (stream.eat("/")) {
122
122
  stream.skipToEnd();
123
123
  return ret("comment", "comment");
124
- } else if (state.lastType == "operator" || state.lastType == "keyword c" ||
125
- state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) {
124
+ } else if (/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:])$/.test(state.lastType)) {
126
125
  readRegexp(stream);
127
126
  stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);
128
127
  return ret("regexp", "string-2");
@@ -373,7 +372,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
373
372
 
374
373
  var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
375
374
  if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
376
- if (type == "async") return cont(expression);
377
375
  if (type == "function") return cont(functiondef, maybeop);
378
376
  if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression);
379
377
  if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop);
@@ -452,9 +450,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
452
450
  if (type == "variable") {cx.marked = "property"; return cont();}
453
451
  }
454
452
  function objprop(type, value) {
455
- if (type == "async") {
456
- return cont(objprop);
457
- } else if (type == "variable" || cx.style == "keyword") {
453
+ if (type == "variable" || cx.style == "keyword") {
458
454
  cx.marked = "property";
459
455
  if (value == "get" || value == "set") return cont(getterSetter);
460
456
  return cont(afterprop);
@@ -465,6 +461,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
465
461
  return cont(afterprop);
466
462
  } else if (type == "[") {
467
463
  return cont(expression, expect("]"), afterprop);
464
+ } else if (type == "spread") {
465
+ return cont(expression);
468
466
  }
469
467
  }
470
468
  function getterSetter(type) {
@@ -283,7 +283,7 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
283
283
  if(textAfter=="end" || textAfter=="]" || textAfter=="}" || textAfter=="else" || textAfter=="elseif" || textAfter=="catch" || textAfter=="finally") {
284
284
  delta = -1;
285
285
  }
286
- return (state.scopes.length + delta) * 4;
286
+ return (state.scopes.length + delta) * _conf.indentUnit;
287
287
  },
288
288
 
289
289
  lineComment: "#",
@@ -712,7 +712,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
712
712
  f: s.f,
713
713
 
714
714
  prevLine: s.prevLine,
715
- thisLine: s.this,
715
+ thisLine: s.thisLine,
716
716
 
717
717
  block: s.block,
718
718
  htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),
@@ -17,33 +17,65 @@ CodeMirror.defineSimpleMode("nsis",{
17
17
  start:[
18
18
  // Numbers
19
19
  {regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
20
+
21
+ // Strings
22
+ { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
23
+ { regex: /'(?:[^\\']|\\.)*'?/, token: "string" },
24
+ { regex: /`(?:[^\\`]|\\.)*`?/, token: "string" },
25
+
20
26
  // Compile Time Commands
21
27
  {regex: /(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|finalize|getdllversion|system|tempfile|warning|verbose|define|undef|insertmacro|makensis|searchparse|searchreplace))\b/, token: "keyword"},
28
+
22
29
  // Conditional Compilation
23
30
  {regex: /(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/, token: "keyword", indent: true},
24
31
  {regex: /(?:\!(else|endif|macroend))\b/, token: "keyword", dedent: true},
32
+
25
33
  // Runtime Commands
26
- {regex: /(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetPluginUnload|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"},
34
+ {regex: /\b(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetPluginUnload|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"},
27
35
  {regex: /\b(?:Function|PageEx|Section(?:Group)?)\b/, token: "keyword", indent: true},
28
36
  {regex: /\b(?:(Function|PageEx|Section(?:Group)?)End)\b/, token: "keyword", dedent: true},
29
- // Options
37
+
38
+ // Command Options
30
39
  {regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"},
31
40
  {regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|right|show|silent|silentlog|textonly|top|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"},
32
41
 
33
- // LogicLib
34
- {regex: /\$\{(?:End(If|Unless|While)|Loop(?:Until)|Next)\}/, token: "variable-2", dedent: true},
35
- {regex: /\$\{(?:Do(Until|While)|Else(?:If(?:Not)?)?|For(?:Each)?|(?:(?:And|Else|Or)?If(?:Cmd|Not|Then)?|Unless)|While)\}/, token: "variable-2", indent: true},
42
+ // LogicLib.nsh
43
+ {regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/, token: "variable-2", indent: true},
44
+
45
+ // FileFunc.nsh
46
+ {regex: /\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/, token: "variable-2", dedent: true},
47
+
48
+ // Memento.nsh
49
+ {regex: /\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/, token: "variable-2", dedent: true},
50
+
51
+ // TextFunc.nsh
52
+ {regex: /\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/, token: "variable-2", dedent: true},
53
+
54
+ // WinVer.nsh
55
+ {regex: /\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|10|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/, token: "variable", dedent: true},
56
+
57
+ // WordFunc.nsh
58
+ {regex: /\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/, token: "variable-2", dedent: true},
59
+
60
+ // x64.nsh
61
+ {regex: /\$\{(?:RunningX64)\}/, token: "variable", dedent: true},
62
+ {regex: /\$\{(?:Disable|Enable)X64FSRedirection\}/, token: "variable-2", dedent: true},
36
63
 
37
64
  // Line Comment
38
65
  {regex: /(#|;).*/, token: "comment"},
66
+
39
67
  // Block Comment
40
68
  {regex: /\/\*/, token: "comment", next: "comment"},
69
+
41
70
  // Operator
42
71
  {regex: /[-+\/*=<>!]+/, token: "operator"},
72
+
43
73
  // Variable
44
74
  {regex: /\$[\w]+/, token: "variable"},
75
+
45
76
  // Constant
46
77
  {regex: /\${[\w]+}/,token: "variable-2"},
78
+
47
79
  // Language String
48
80
  {regex: /\$\([\w]+\)/,token: "variable-3"}
49
81
  ],
@@ -48,18 +48,18 @@
48
48
  CodeMirror.defineMode("python", function(conf, parserConf) {
49
49
  var ERRORCLASS = "error";
50
50
 
51
- var singleDelimiters = parserConf.singleDelimiters || new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]");
52
- var doubleOperators = parserConf.doubleOperators || new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))");
53
- var doubleDelimiters = parserConf.doubleDelimiters || new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))");
54
- var tripleDelimiters = parserConf.tripleDelimiters || new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");
51
+ var singleDelimiters = parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.]/;
52
+ var doubleOperators = parserConf.doubleOperators || /^([!<>]==|<>|<<|>>|\/\/|\*\*)/;
53
+ var doubleDelimiters = parserConf.doubleDelimiters || /^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/;
54
+ var tripleDelimiters = parserConf.tripleDelimiters || /^(\/\/=|>>=|<<=|\*\*=)/;
55
55
 
56
56
  if (parserConf.version && parseInt(parserConf.version, 10) == 3){
57
57
  // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator
58
- var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]");
59
- var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*");
58
+ var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/;
59
+ var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;
60
60
  } else {
61
- var singleOperators = parserConf.singleOperators || new RegExp("^[\\+\\-\\*/%&|\\^~<>!]");
62
- var identifiers = parserConf.identifiers|| new RegExp("^[_A-Za-z][_A-Za-z0-9]*");
61
+ var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!]/;
62
+ var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;
63
63
  }
64
64
 
65
65
  var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
@@ -160,13 +160,16 @@
160
160
 
161
161
  // Handle operators and Delimiters
162
162
  if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters))
163
- return null;
163
+ return "punctuation";
164
164
 
165
165
  if (stream.match(doubleOperators) || stream.match(singleOperators))
166
166
  return "operator";
167
167
 
168
168
  if (stream.match(singleDelimiters))
169
- return null;
169
+ return "punctuation";
170
+
171
+ if (state.lastToken == "." && stream.match(identifiers))
172
+ return "property";
170
173
 
171
174
  if (stream.match(keywords) || stream.match(wordOperators))
172
175
  return "keyword";
@@ -246,17 +249,6 @@
246
249
  var style = state.tokenize(stream, state);
247
250
  var current = stream.current();
248
251
 
249
- // Handle '.' connected identifiers
250
- if (current == ".") {
251
- style = stream.match(identifiers, false) ? null : ERRORCLASS;
252
- if (style == null && state.lastStyle == "meta") {
253
- // Apply 'meta' style to '.' connected identifiers when
254
- // appropriate.
255
- style = "meta";
256
- }
257
- return style;
258
- }
259
-
260
252
  // Handle decorators
261
253
  if (current == "@"){
262
254
  if(parserConf.version && parseInt(parserConf.version, 10) == 3){
@@ -267,7 +259,7 @@
267
259
  }
268
260
 
269
261
  if ((style == "variable" || style == "builtin")
270
- && state.lastStyle == "meta")
262
+ && state.lastToken == "meta")
271
263
  style = "meta";
272
264
 
273
265
  // Handle scope changes.
@@ -300,7 +292,6 @@
300
292
  return {
301
293
  tokenize: tokenBase,
302
294
  scopes: [{offset: basecolumn || 0, type: "py", align: null}],
303
- lastStyle: null,
304
295
  lastToken: null,
305
296
  lambda: false,
306
297
  dedent: 0
@@ -312,11 +303,9 @@
312
303
  if (addErr) state.errorToken = false;
313
304
  var style = tokenLexer(stream, state);
314
305
 
315
- state.lastStyle = style;
316
-
317
- var current = stream.current();
318
- if (current && style)
319
- state.lastToken = current;
306
+ if (style && style != "comment")
307
+ state.lastToken = (style == "keyword" || style == "punctuation") ? stream.current() : style;
308
+ if (style == "punctuation") style = null;
320
309
 
321
310
  if (stream.eol() && state.lambda)
322
311
  state.lambda = false;
@@ -12,11 +12,12 @@
12
12
  "use strict";
13
13
 
14
14
  CodeMirror.defineSimpleMode("rust",{
15
- start:[
15
+ start: [
16
16
  // string and byte string
17
- {regex: /b?"(?:[^\\]|\\.)*?"/, token: "string"},
17
+ {regex: /b?"/, token: "string", next: "string"},
18
18
  // raw string and raw byte string
19
- {regex: /(b?r)(#*)(".*?)("\2)/, token: ["string", "string", "string", "string"]},
19
+ {regex: /b?r"/, token: "string", next: "string_raw"},
20
+ {regex: /b?r#+"/, token: "string", next: "string_raw_hash"},
20
21
  // character
21
22
  {regex: /'(?:[^'\\]|\\(?:[nrt0'"]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\}))'/, token: "string-2"},
22
23
  // byte
@@ -39,6 +40,18 @@ CodeMirror.defineSimpleMode("rust",{
39
40
  {regex: /[\{\[\(]/, indent: true},
40
41
  {regex: /[\}\]\)]/, dedent: true}
41
42
  ],
43
+ string: [
44
+ {regex: /"/, token: "string", next: "start"},
45
+ {regex: /(?:[^\\"]|\\(?:.|$))*/, token: "string"}
46
+ ],
47
+ string_raw: [
48
+ {regex: /"/, token: "string", next: "start"},
49
+ {regex: /[^"]*/, token: "string"}
50
+ ],
51
+ string_raw_hash: [
52
+ {regex: /"#+/, token: "string", next: "start"},
53
+ {regex: /(?:[^"]|"(?!#))*/, token: "string"}
54
+ ],
42
55
  comment: [
43
56
  {regex: /.*?\*\//, token: "comment", next: "start"},
44
57
  {regex: /.*/, token: "comment"}
@@ -257,7 +257,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
257
257
  }
258
258
 
259
259
  // these keywords are used by all SQL dialects (however, a mode can still overwrite it)
260
- var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where ";
260
+ var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit";
261
261
 
262
262
  // turn a space-separated list into an array
263
263
  function set(str) {
@@ -32,10 +32,6 @@
32
32
  .cm-s-material .cm-atom { color: #F77669; }
33
33
  .cm-s-material .cm-number { color: #F77669; }
34
34
  .cm-s-material .cm-def { color: rgba(233, 237, 237, 1); }
35
- .cm-s-material .cm-error {
36
- color: rgba(255, 255, 255, 1.0);
37
- background-color: #EC5F67;
38
- }
39
35
  .cm-s-material .cm-string { color: #C3E88D; }
40
36
  .cm-s-material .cm-string-2 { color: #80CBC4; }
41
37
  .cm-s-material .cm-comment { color: #546E7A; }
@@ -47,6 +43,10 @@
47
43
  .cm-s-material .cm-qualifier { color: #DECB6B; }
48
44
  .cm-s-material .cm-variable-3 { color: #DECB6B; }
49
45
  .cm-s-material .cm-tag { color: rgba(255, 83, 112, 1); }
46
+ .cm-s-material .cm-error {
47
+ color: rgba(255, 255, 255, 1.0);
48
+ background-color: #EC5F67;
49
+ }
50
50
  .cm-s-material .CodeMirror-matchingbracket {
51
51
  text-decoration: underline;
52
52
  color: white !important;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codemirror-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: '5.8'
4
+ version: '5.9'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Fixler