codemirror-rails 5.7 → 5.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/codemirror/rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/codemirror.js +54 -33
  4. data/vendor/assets/javascripts/codemirror/addons/comment/comment.js +20 -7
  5. data/vendor/assets/javascripts/codemirror/addons/hint/show-hint.js +77 -23
  6. data/vendor/assets/javascripts/codemirror/addons/merge/merge.js +3 -6
  7. data/vendor/assets/javascripts/codemirror/addons/mode/multiplex.js +3 -3
  8. data/vendor/assets/javascripts/codemirror/addons/wrap/hardwrap.js +9 -6
  9. data/vendor/assets/javascripts/codemirror/keymaps/sublime.js +3 -1
  10. data/vendor/assets/javascripts/codemirror/modes/clike.js +140 -15
  11. data/vendor/assets/javascripts/codemirror/modes/coffeescript.js +0 -11
  12. data/vendor/assets/javascripts/codemirror/modes/css.js +2 -0
  13. data/vendor/assets/javascripts/codemirror/modes/cypher.js +3 -3
  14. data/vendor/assets/javascripts/codemirror/modes/dart.js +81 -1
  15. data/vendor/assets/javascripts/codemirror/modes/haxe.js +13 -4
  16. data/vendor/assets/javascripts/codemirror/modes/htmlmixed.js +2 -2
  17. data/vendor/assets/javascripts/codemirror/modes/javascript.js +20 -5
  18. data/vendor/assets/javascripts/codemirror/modes/markdown.js +58 -47
  19. data/vendor/assets/javascripts/codemirror/modes/nsis.js +63 -0
  20. data/vendor/assets/javascripts/codemirror/modes/rpm.js +17 -9
  21. data/vendor/assets/stylesheets/codemirror/themes/abcdef.css +1 -1
  22. data/vendor/assets/stylesheets/codemirror/themes/base16-dark.css +1 -1
  23. data/vendor/assets/stylesheets/codemirror/themes/base16-light.css +1 -1
  24. data/vendor/assets/stylesheets/codemirror/themes/bespin.css +34 -0
  25. data/vendor/assets/stylesheets/codemirror/themes/hopscotch.css +34 -0
  26. data/vendor/assets/stylesheets/codemirror/themes/isotope.css +34 -0
  27. data/vendor/assets/stylesheets/codemirror/themes/liquibyte.css +14 -14
  28. data/vendor/assets/stylesheets/codemirror/themes/railscasts.css +34 -0
  29. metadata +6 -2
  30. data/vendor/assets/javascripts/codemirror/modes/kotlin.js +0 -284
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5b46bf2cc4d84c5328446d21e4413549fd7c9ac
4
- data.tar.gz: 88eb7a4719bf7581129e309f5c95878abd1e2938
3
+ metadata.gz: a62ba8fcdd98556c524029b28df974c5a88b1601
4
+ data.tar.gz: fdf40baa6466b4723679d6f3b9834798a7cec253
5
5
  SHA512:
6
- metadata.gz: 8ae50e29d8a8dd42eb29b620cf3a24634051bdff92b18ef65d4b7b3c2806f1e1cf6f87bced7b7564af06f96acd18b7964f35b3929825052d8467cffa24bfb48f
7
- data.tar.gz: 3edf6831421146808b87717e34636a3bfa5d468cf90393802a853205368057e2417fa29d8c336dabedee41aa24b65ed0eb1ba3fca22bc9e0864667b67ce8e0bc
6
+ metadata.gz: 21c62cdaa7357fcaacfcbfe670f755e9bc7daafdbe75e05abf38d29e8aaed85cb50718b00129449bb6553fe59d99e38ffe95ba7d0db1370ad7cc6f11b645e407
7
+ data.tar.gz: b5dfde01f65c7b1d05dd7b9099dcb2fa2ee897ba6e7510a5efa4cb3e46c12248d44eefad1d59ccdd1b613d39554f44d7ec3ac08f35d1b64d37c3f6e9dd6cd998
@@ -1,6 +1,6 @@
1
1
  module Codemirror
2
2
  module Rails
3
- VERSION = '5.7'
4
- CODEMIRROR_VERSION = '5.7'
3
+ VERSION = '5.8'
4
+ CODEMIRROR_VERSION = '5.8'
5
5
  end
6
6
  end
@@ -21,27 +21,29 @@
21
21
 
22
22
  // Kludges for bugs and behavior differences that can't be feature
23
23
  // detected are enabled based on userAgent etc sniffing.
24
+ var userAgent = navigator.userAgent;
25
+ var platform = navigator.platform;
24
26
 
25
- var gecko = /gecko\/\d/i.test(navigator.userAgent);
26
- var ie_upto10 = /MSIE \d/.test(navigator.userAgent);
27
- var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
27
+ var gecko = /gecko\/\d/i.test(userAgent);
28
+ var ie_upto10 = /MSIE \d/.test(userAgent);
29
+ var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent);
28
30
  var ie = ie_upto10 || ie_11up;
29
31
  var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]);
30
- var webkit = /WebKit\//.test(navigator.userAgent);
31
- var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent);
32
- var chrome = /Chrome\//.test(navigator.userAgent);
33
- var presto = /Opera\//.test(navigator.userAgent);
32
+ var webkit = /WebKit\//.test(userAgent);
33
+ var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent);
34
+ var chrome = /Chrome\//.test(userAgent);
35
+ var presto = /Opera\//.test(userAgent);
34
36
  var safari = /Apple Computer/.test(navigator.vendor);
35
- var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);
36
- var phantom = /PhantomJS/.test(navigator.userAgent);
37
+ var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent);
38
+ var phantom = /PhantomJS/.test(userAgent);
37
39
 
38
- var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
40
+ var ios = /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent);
39
41
  // This is woefully incomplete. Suggestions for alternative methods welcome.
40
- var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);
41
- var mac = ios || /Mac/.test(navigator.platform);
42
- var windows = /win/i.test(navigator.platform);
42
+ var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);
43
+ var mac = ios || /Mac/.test(platform);
44
+ var windows = /win/i.test(platform);
43
45
 
44
- var presto_version = presto && navigator.userAgent.match(/Version\/(\d*\.\d*)/);
46
+ var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/);
45
47
  if (presto_version) presto_version = Number(presto_version[1]);
46
48
  if (presto_version && presto_version >= 15) { presto = false; webkit = true; }
47
49
  // Some browsers use the wrong event properties to signal cmd/ctrl on OS X
@@ -3821,9 +3823,15 @@
3821
3823
  if (files && files.length && window.FileReader && window.File) {
3822
3824
  var n = files.length, text = Array(n), read = 0;
3823
3825
  var loadFile = function(file, i) {
3826
+ if (cm.options.allowDropFileTypes &&
3827
+ indexOf(cm.options.allowDropFileTypes, file.type) == -1)
3828
+ return;
3829
+
3824
3830
  var reader = new FileReader;
3825
3831
  reader.onload = operation(cm, function() {
3826
- text[i] = reader.result;
3832
+ var content = reader.result;
3833
+ if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) content = "";
3834
+ text[i] = content;
3827
3835
  if (++read == n) {
3828
3836
  pos = clipPos(cm.doc, pos);
3829
3837
  var change = {from: pos, to: pos,
@@ -3965,8 +3973,9 @@
3965
3973
 
3966
3974
  var display = cm.display, scroll = display.scroller;
3967
3975
  // Quit if there's nothing to scroll here
3968
- if (!(dx && scroll.scrollWidth > scroll.clientWidth ||
3969
- dy && scroll.scrollHeight > scroll.clientHeight)) return;
3976
+ var canScrollX = scroll.scrollWidth > scroll.clientWidth;
3977
+ var canScrollY = scroll.scrollHeight > scroll.clientHeight;
3978
+ if (!(dx && canScrollX || dy && canScrollY)) return;
3970
3979
 
3971
3980
  // Webkit browsers on OS X abort momentum scrolls when the target
3972
3981
  // of the scroll event is removed from the scrollable element.
@@ -3990,10 +3999,15 @@
3990
3999
  // scrolling entirely here. It'll be slightly off from native, but
3991
4000
  // better than glitching out.
3992
4001
  if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
3993
- if (dy)
4002
+ if (dy && canScrollY)
3994
4003
  setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight)));
3995
4004
  setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));
3996
- e_preventDefault(e);
4005
+ // Only prevent default scrolling if vertical scrolling is
4006
+ // actually possible. Otherwise, it causes vertical scroll
4007
+ // jitter on OSX trackpads when deltaX is small and deltaY
4008
+ // is large (issue #3579)
4009
+ if (!dy || (dy && canScrollY))
4010
+ e_preventDefault(e);
3997
4011
  display.wheelStartX = null; // Abort measurement, if in progress
3998
4012
  return;
3999
4013
  }
@@ -4221,6 +4235,7 @@
4221
4235
  // right-click take effect on it.
4222
4236
  function onContextMenu(cm, e) {
4223
4237
  if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) return;
4238
+ if (signalDOMEvent(cm, e, "contextmenu")) return;
4224
4239
  cm.display.input.onContextMenu(e);
4225
4240
  }
4226
4241
 
@@ -5404,6 +5419,7 @@
5404
5419
  });
5405
5420
  option("disableInput", false, function(cm, val) {if (!val) cm.display.input.reset();}, true);
5406
5421
  option("dragDrop", true, dragDropChanged);
5422
+ option("allowDropFileTypes", null);
5407
5423
 
5408
5424
  option("cursorBlinkRate", 530);
5409
5425
  option("cursorScrollMargin", 0);
@@ -5708,8 +5724,8 @@
5708
5724
  var range = cm.listSelections()[i];
5709
5725
  cm.replaceRange(cm.doc.lineSeparator(), range.anchor, range.head, "+input");
5710
5726
  cm.indentLine(range.from().line + 1, null, true);
5711
- ensureCursorVisible(cm);
5712
5727
  }
5728
+ ensureCursorVisible(cm);
5713
5729
  });
5714
5730
  },
5715
5731
  toggleOverwrite: function(cm) {cm.toggleOverwrite();}
@@ -7542,7 +7558,7 @@
7542
7558
  removeLineWidget: function(widget) { widget.clear(); },
7543
7559
 
7544
7560
  markText: function(from, to, options) {
7545
- return markText(this, clipPos(this, from), clipPos(this, to), options, "range");
7561
+ return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range");
7546
7562
  },
7547
7563
  setBookmark: function(pos, options) {
7548
7564
  var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),
@@ -8103,24 +8119,30 @@
8103
8119
  }
8104
8120
  };
8105
8121
 
8122
+ var noHandlers = []
8123
+ function getHandlers(emitter, type, copy) {
8124
+ var arr = emitter._handlers && emitter._handlers[type]
8125
+ if (copy) return arr && arr.length > 0 ? arr.slice() : noHandlers
8126
+ else return arr || noHandlers
8127
+ }
8128
+
8106
8129
  var off = CodeMirror.off = function(emitter, type, f) {
8107
8130
  if (emitter.removeEventListener)
8108
8131
  emitter.removeEventListener(type, f, false);
8109
8132
  else if (emitter.detachEvent)
8110
8133
  emitter.detachEvent("on" + type, f);
8111
8134
  else {
8112
- var arr = emitter._handlers && emitter._handlers[type];
8113
- if (!arr) return;
8114
- for (var i = 0; i < arr.length; ++i)
8115
- if (arr[i] == f) { arr.splice(i, 1); break; }
8135
+ var handlers = getHandlers(emitter, type, false)
8136
+ for (var i = 0; i < handlers.length; ++i)
8137
+ if (handlers[i] == f) { handlers.splice(i, 1); break; }
8116
8138
  }
8117
8139
  };
8118
8140
 
8119
8141
  var signal = CodeMirror.signal = function(emitter, type /*, values...*/) {
8120
- var arr = emitter._handlers && emitter._handlers[type];
8121
- if (!arr) return;
8142
+ var handlers = getHandlers(emitter, type, true)
8143
+ if (!handlers.length) return;
8122
8144
  var args = Array.prototype.slice.call(arguments, 2);
8123
- for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args);
8145
+ for (var i = 0; i < handlers.length; ++i) handlers[i].apply(null, args);
8124
8146
  };
8125
8147
 
8126
8148
  var orphanDelayedCallbacks = null;
@@ -8133,8 +8155,8 @@
8133
8155
  // them to be executed when the last operation ends, or, if no
8134
8156
  // operation is active, when a timeout fires.
8135
8157
  function signalLater(emitter, type /*, values...*/) {
8136
- var arr = emitter._handlers && emitter._handlers[type];
8137
- if (!arr) return;
8158
+ var arr = getHandlers(emitter, type, false)
8159
+ if (!arr.length) return;
8138
8160
  var args = Array.prototype.slice.call(arguments, 2), list;
8139
8161
  if (operationGroup) {
8140
8162
  list = operationGroup.delayedCallbacks;
@@ -8174,8 +8196,7 @@
8174
8196
  }
8175
8197
 
8176
8198
  function hasHandler(emitter, type) {
8177
- var arr = emitter._handlers && emitter._handlers[type];
8178
- return arr && arr.length > 0;
8199
+ return getHandlers(emitter, type).length > 0
8179
8200
  }
8180
8201
 
8181
8202
  // Add on and off methods to a constructor's prototype, to make
@@ -8829,7 +8850,7 @@
8829
8850
 
8830
8851
  // THE END
8831
8852
 
8832
- CodeMirror.version = "5.7.0";
8853
+ CodeMirror.version = "5.8.0";
8833
8854
 
8834
8855
  return CodeMirror;
8835
8856
  });
@@ -21,22 +21,28 @@
21
21
  }
22
22
 
23
23
  CodeMirror.commands.toggleComment = function(cm) {
24
- var minLine = Infinity, ranges = cm.listSelections(), mode = null;
24
+ cm.toggleComment();
25
+ };
26
+
27
+ CodeMirror.defineExtension("toggleComment", function(options) {
28
+ if (!options) options = noOptions;
29
+ var cm = this;
30
+ var minLine = Infinity, ranges = this.listSelections(), mode = null;
25
31
  for (var i = ranges.length - 1; i >= 0; i--) {
26
32
  var from = ranges[i].from(), to = ranges[i].to();
27
33
  if (from.line >= minLine) continue;
28
34
  if (to.line >= minLine) to = Pos(minLine, 0);
29
35
  minLine = from.line;
30
36
  if (mode == null) {
31
- if (cm.uncomment(from, to)) mode = "un";
32
- else { cm.lineComment(from, to); mode = "line"; }
37
+ if (cm.uncomment(from, to, options)) mode = "un";
38
+ else { cm.lineComment(from, to, options); mode = "line"; }
33
39
  } else if (mode == "un") {
34
- cm.uncomment(from, to);
40
+ cm.uncomment(from, to, options);
35
41
  } else {
36
- cm.lineComment(from, to);
42
+ cm.lineComment(from, to, options);
37
43
  }
38
44
  }
39
- };
45
+ });
40
46
 
41
47
  CodeMirror.defineExtension("lineComment", function(from, to, options) {
42
48
  if (!options) options = noOptions;
@@ -57,7 +63,14 @@
57
63
 
58
64
  self.operation(function() {
59
65
  if (options.indent) {
60
- var baseString = firstLine.slice(0, firstNonWS(firstLine));
66
+ var baseString = null;
67
+ for (var i = from.line; i < end; ++i) {
68
+ var line = self.getLine(i);
69
+ var whitespace = line.slice(0, firstNonWS(line));
70
+ if (baseString == null || baseString.length > whitespace.length) {
71
+ baseString = whitespace;
72
+ }
73
+ }
61
74
  for (var i = from.line; i < end; ++i) {
62
75
  var line = self.getLine(i), cut = baseString.length;
63
76
  if (!blankLines && !nonWS.test(line)) continue;
@@ -25,8 +25,18 @@
25
25
  };
26
26
 
27
27
  CodeMirror.defineExtension("showHint", function(options) {
28
- // We want a single cursor position.
29
- if (this.listSelections().length > 1 || this.somethingSelected()) return;
28
+ options = parseOptions(this, this.getCursor("start"), options);
29
+ var selections = this.listSelections()
30
+ if (selections.length > 1) return;
31
+ // By default, don't allow completion when something is selected.
32
+ // A hint function can have a `supportsSelection` property to
33
+ // indicate that it can handle selections.
34
+ if (this.somethingSelected()) {
35
+ if (!options.hint.supportsSelection) return;
36
+ // Don't try with cross-line selections
37
+ for (var i = 0; i < selections.length; i++)
38
+ if (selections[i].head.line != selections[i].anchor.line) return;
39
+ }
30
40
 
31
41
  if (this.state.completionActive) this.state.completionActive.close();
32
42
  var completion = this.state.completionActive = new Completion(this, options);
@@ -38,12 +48,12 @@
38
48
 
39
49
  function Completion(cm, options) {
40
50
  this.cm = cm;
41
- this.options = this.buildOptions(options);
51
+ this.options = options;
42
52
  this.widget = null;
43
53
  this.debounce = 0;
44
54
  this.tick = 0;
45
- this.startPos = this.cm.getCursor();
46
- this.startLen = this.cm.getLine(this.startPos.line).length;
55
+ this.startPos = this.cm.getCursor("start");
56
+ this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;
47
57
 
48
58
  var self = this;
49
59
  cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); });
@@ -124,20 +134,21 @@
124
134
  CodeMirror.signal(data, "shown");
125
135
  }
126
136
  }
127
- },
128
-
129
- buildOptions: function(options) {
130
- var editor = this.cm.options.hintOptions;
131
- var out = {};
132
- for (var prop in defaultOptions) out[prop] = defaultOptions[prop];
133
- if (editor) for (var prop in editor)
134
- if (editor[prop] !== undefined) out[prop] = editor[prop];
135
- if (options) for (var prop in options)
136
- if (options[prop] !== undefined) out[prop] = options[prop];
137
- return out;
138
137
  }
139
138
  };
140
139
 
140
+ function parseOptions(cm, pos, options) {
141
+ var editor = cm.options.hintOptions;
142
+ var out = {};
143
+ for (var prop in defaultOptions) out[prop] = defaultOptions[prop];
144
+ if (editor) for (var prop in editor)
145
+ if (editor[prop] !== undefined) out[prop] = editor[prop];
146
+ if (options) for (var prop in options)
147
+ if (options[prop] !== undefined) out[prop] = options[prop];
148
+ if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)
149
+ return out;
150
+ }
151
+
141
152
  function getText(completion) {
142
153
  if (typeof completion == "string") return completion;
143
154
  else return completion.text;
@@ -336,18 +347,61 @@
336
347
  }
337
348
  };
338
349
 
339
- CodeMirror.registerHelper("hint", "auto", function(cm, options) {
340
- var helpers = cm.getHelpers(cm.getCursor(), "hint"), words;
350
+ function applicableHelpers(cm, helpers) {
351
+ if (!cm.somethingSelected()) return helpers
352
+ var result = []
353
+ for (var i = 0; i < helpers.length; i++)
354
+ if (helpers[i].supportsSelection) result.push(helpers[i])
355
+ return result
356
+ }
357
+
358
+ function resolveAutoHints(cm, pos) {
359
+ var helpers = cm.getHelpers(pos, "hint"), words
341
360
  if (helpers.length) {
342
- for (var i = 0; i < helpers.length; i++) {
343
- var cur = helpers[i](cm, options);
344
- if (cur && cur.list.length) return cur;
361
+ var async = false, resolved
362
+ for (var i = 0; i < helpers.length; i++) if (helpers[i].async) async = true
363
+ if (async) {
364
+ resolved = function(cm, callback, options) {
365
+ var app = applicableHelpers(cm, helpers)
366
+ function run(i, result) {
367
+ if (i == app.length) return callback(null)
368
+ var helper = app[i]
369
+ if (helper.async) {
370
+ helper(cm, function(result) {
371
+ if (result) callback(result)
372
+ else run(i + 1)
373
+ }, options)
374
+ } else {
375
+ var result = helper(cm, options)
376
+ if (result) callback(result)
377
+ else run(i + 1)
378
+ }
379
+ }
380
+ run(0)
381
+ }
382
+ resolved.async = true
383
+ } else {
384
+ resolved = function(cm, options) {
385
+ var app = applicableHelpers(cm, helpers)
386
+ for (var i = 0; i < app.length; i++) {
387
+ var cur = app[i](cm, options)
388
+ if (cur && cur.list.length) return cur
389
+ }
390
+ }
345
391
  }
392
+ resolved.supportsSelection = true
393
+ return resolved
346
394
  } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
347
- if (words) return CodeMirror.hint.fromList(cm, {words: words});
395
+ return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }
348
396
  } else if (CodeMirror.hint.anyword) {
349
- return CodeMirror.hint.anyword(cm, options);
397
+ return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }
398
+ } else {
399
+ return function() {}
350
400
  }
401
+ }
402
+
403
+ CodeMirror.registerHelper("hint", "auto", {
404
+ resolve: resolveAutoHints
351
405
  });
352
406
 
353
407
  CodeMirror.registerHelper("hint", "fromList", function(cm, options) {
@@ -5,7 +5,7 @@
5
5
 
6
6
  (function(mod) {
7
7
  if (typeof exports == "object" && typeof module == "object") // CommonJS
8
- mod(require("../../lib/codemirror"), require("diff_match_patch"));
8
+ mod(require("../../lib/codemirror")); // Note non-packaged dependency diff_match_patch
9
9
  else if (typeof define == "function" && define.amd) // AMD
10
10
  define(["../../lib/codemirror", "diff_match_patch"], mod);
11
11
  else // Plain browser env
@@ -471,13 +471,10 @@
471
471
  if (left) left.init(leftPane, origLeft, options);
472
472
  if (right) right.init(rightPane, origRight, options);
473
473
 
474
- if (options.collapseIdentical) {
475
- updating = true;
474
+ if (options.collapseIdentical)
476
475
  this.editor().operation(function() {
477
476
  collapseIdenticalStretches(self, options.collapseIdentical);
478
477
  });
479
- updating = false;
480
- }
481
478
  if (options.connect == "align") {
482
479
  this.aligners = [];
483
480
  alignChunks(this.left || this.right, true);
@@ -640,7 +637,7 @@
640
637
  mark.clear();
641
638
  cm.removeLineClass(from, "wrap", "CodeMirror-merge-collapsed-line");
642
639
  }
643
- widget.addEventListener("click", clear);
640
+ CodeMirror.on(widget, "click", clear);
644
641
  return {mark: mark, clear: clear};
645
642
  }
646
643
 
@@ -51,7 +51,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
51
51
  if (!other.parseDelimiters) stream.match(other.open);
52
52
  state.innerActive = other;
53
53
  state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0);
54
- return other.delimStyle;
54
+ return other.delimStyle && (other.delimStyle + " " + other.delimStyle + "-open");
55
55
  } else if (found != -1 && found < cutOff) {
56
56
  cutOff = found;
57
57
  }
@@ -70,7 +70,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
70
70
  if (found == stream.pos && !curInner.parseDelimiters) {
71
71
  stream.match(curInner.close);
72
72
  state.innerActive = state.inner = null;
73
- return curInner.delimStyle;
73
+ return curInner.delimStyle && (curInner.delimStyle + " " + curInner.delimStyle + "-close");
74
74
  }
75
75
  if (found > -1) stream.string = oldContent.slice(0, found);
76
76
  var innerToken = curInner.mode.token(stream, state.inner);
@@ -80,7 +80,7 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
80
80
  state.innerActive = state.inner = null;
81
81
 
82
82
  if (curInner.innerStyle) {
83
- if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle;
83
+ if (innerToken) innerToken = innerToken + " " + curInner.innerStyle;
84
84
  else innerToken = curInner.innerStyle;
85
85
  }
86
86