@jslint-org/jslint 2022.7.20 → 2022.11.20
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.
- package/CHANGELOG.md +9 -1
- package/README.md +27 -15
- package/asset_codemirror_rollup.js +97 -86
- package/jslint.mjs +177 -142
- package/package.json +2 -2
|
@@ -5,26 +5,26 @@ shRawLibFetch
|
|
|
5
5
|
"fetchList": [
|
|
6
6
|
{
|
|
7
7
|
"comment": true,
|
|
8
|
-
"url": "https://github.com/codemirror/
|
|
8
|
+
"url": "https://github.com/codemirror/codemirror5/blob/5.65.10/LICENSE"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
"url": "https://github.com/codemirror/
|
|
12
|
-
"url2": "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.
|
|
11
|
+
"url": "https://github.com/codemirror/codemirror5/blob/5.65.10/codemirror.js",
|
|
12
|
+
"url2": "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.10/codemirror.js"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
"url": "https://github.com/codemirror/
|
|
15
|
+
"url": "https://github.com/codemirror/codemirror5/blob/5.65.10/addon/edit/matchbrackets.js"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
"url": "https://github.com/codemirror/
|
|
18
|
+
"url": "https://github.com/codemirror/codemirror5/blob/5.65.10/addon/edit/trailingspace.js"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
"url": "https://github.com/codemirror/
|
|
21
|
+
"url": "https://github.com/codemirror/codemirror5/blob/5.65.10/addon/lint/lint.js"
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"url": "https://github.com/codemirror/
|
|
24
|
+
"url": "https://github.com/codemirror/codemirror5/blob/5.65.10/addon/selection/active-line.js"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
"url": "https://github.com/codemirror/
|
|
27
|
+
"url": "https://github.com/codemirror/codemirror5/blob/5.65.10/mode/javascript/javascript.js"
|
|
28
28
|
}
|
|
29
29
|
],
|
|
30
30
|
"replaceList": []
|
|
@@ -33,13 +33,13 @@ shRawLibFetch
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
/*
|
|
36
|
-
repo https://github.com/codemirror/
|
|
37
|
-
committed 2022-
|
|
36
|
+
repo https://github.com/codemirror/codemirror5/tree/5.65.10
|
|
37
|
+
committed 2022-11-20T15:35:33Z
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
/*
|
|
42
|
-
file https://github.com/codemirror/
|
|
42
|
+
file https://github.com/codemirror/codemirror5/blob/5.65.10/LICENSE
|
|
43
43
|
*/
|
|
44
44
|
/*
|
|
45
45
|
MIT License
|
|
@@ -67,12 +67,12 @@ THE SOFTWARE.
|
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
/*
|
|
70
|
-
file https://github.com/codemirror/
|
|
70
|
+
file https://github.com/codemirror/codemirror5/blob/5.65.10/codemirror.js
|
|
71
71
|
*/
|
|
72
72
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
73
|
-
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
73
|
+
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
74
74
|
|
|
75
|
-
// This is CodeMirror (https://codemirror.net), a code editor
|
|
75
|
+
// This is CodeMirror (https://codemirror.net/5), a code editor
|
|
76
76
|
// implemented in JavaScript on top of the browser's DOM.
|
|
77
77
|
//
|
|
78
78
|
// You can find some technical background for some of the code below
|
|
@@ -183,15 +183,15 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
183
183
|
} while (child = child.parentNode)
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
function activeElt() {
|
|
186
|
+
function activeElt(doc) {
|
|
187
187
|
// IE and Edge may throw an "Unspecified Error" when accessing document.activeElement.
|
|
188
188
|
// IE < 10 will throw when accessed while the page is loading or in an iframe.
|
|
189
189
|
// IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.
|
|
190
190
|
var activeElement;
|
|
191
191
|
try {
|
|
192
|
-
activeElement =
|
|
192
|
+
activeElement = doc.activeElement;
|
|
193
193
|
} catch(e) {
|
|
194
|
-
activeElement =
|
|
194
|
+
activeElement = doc.body || null;
|
|
195
195
|
}
|
|
196
196
|
while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)
|
|
197
197
|
{ activeElement = activeElement.shadowRoot.activeElement; }
|
|
@@ -215,6 +215,10 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
215
215
|
else if (ie) // Suppress mysterious IE10 errors
|
|
216
216
|
{ selectInput = function(node) { try { node.select(); } catch(_e) {} }; }
|
|
217
217
|
|
|
218
|
+
function doc(cm) { return cm.display.wrapper.ownerDocument }
|
|
219
|
+
|
|
220
|
+
function win(cm) { return doc(cm).defaultView }
|
|
221
|
+
|
|
218
222
|
function bind(f) {
|
|
219
223
|
var args = Array.prototype.slice.call(arguments, 1);
|
|
220
224
|
return function(){return f.apply(null, args)}
|
|
@@ -2644,16 +2648,16 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
2644
2648
|
cm.display.lineNumChars = null;
|
|
2645
2649
|
}
|
|
2646
2650
|
|
|
2647
|
-
function pageScrollX() {
|
|
2651
|
+
function pageScrollX(doc) {
|
|
2648
2652
|
// Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206
|
|
2649
2653
|
// which causes page_Offset and bounding client rects to use
|
|
2650
2654
|
// different reference viewports and invalidate our calculations.
|
|
2651
|
-
if (chrome && android) { return -(
|
|
2652
|
-
return
|
|
2655
|
+
if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) }
|
|
2656
|
+
return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft
|
|
2653
2657
|
}
|
|
2654
|
-
function pageScrollY() {
|
|
2655
|
-
if (chrome && android) { return -(
|
|
2656
|
-
return
|
|
2658
|
+
function pageScrollY(doc) {
|
|
2659
|
+
if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) }
|
|
2660
|
+
return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop
|
|
2657
2661
|
}
|
|
2658
2662
|
|
|
2659
2663
|
function widgetTopHeight(lineObj) {
|
|
@@ -2681,8 +2685,8 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
2681
2685
|
else { yOff -= cm.display.viewOffset; }
|
|
2682
2686
|
if (context == "page" || context == "window") {
|
|
2683
2687
|
var lOff = cm.display.lineSpace.getBoundingClientRect();
|
|
2684
|
-
yOff += lOff.top + (context == "window" ? 0 : pageScrollY());
|
|
2685
|
-
var xOff = lOff.left + (context == "window" ? 0 : pageScrollX());
|
|
2688
|
+
yOff += lOff.top + (context == "window" ? 0 : pageScrollY(doc(cm)));
|
|
2689
|
+
var xOff = lOff.left + (context == "window" ? 0 : pageScrollX(doc(cm)));
|
|
2686
2690
|
rect.left += xOff; rect.right += xOff;
|
|
2687
2691
|
}
|
|
2688
2692
|
rect.top += yOff; rect.bottom += yOff;
|
|
@@ -2696,8 +2700,8 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
2696
2700
|
var left = coords.left, top = coords.top;
|
|
2697
2701
|
// First move into "page" coordinate system
|
|
2698
2702
|
if (context == "page") {
|
|
2699
|
-
left -= pageScrollX();
|
|
2700
|
-
top -= pageScrollY();
|
|
2703
|
+
left -= pageScrollX(doc(cm));
|
|
2704
|
+
top -= pageScrollY(doc(cm));
|
|
2701
2705
|
} else if (context == "local" || !context) {
|
|
2702
2706
|
var localBox = cm.display.sizer.getBoundingClientRect();
|
|
2703
2707
|
left += localBox.left;
|
|
@@ -3513,8 +3517,9 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
3513
3517
|
if (signalDOMEvent(cm, "scrollCursorIntoView")) { return }
|
|
3514
3518
|
|
|
3515
3519
|
var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;
|
|
3520
|
+
var doc = display.wrapper.ownerDocument;
|
|
3516
3521
|
if (rect.top + box.top < 0) { doScroll = true; }
|
|
3517
|
-
else if (rect.bottom + box.top > (
|
|
3522
|
+
else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }
|
|
3518
3523
|
if (doScroll != null && !phantom) {
|
|
3519
3524
|
var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;"));
|
|
3520
3525
|
cm.display.lineSpace.appendChild(scrollNode);
|
|
@@ -3768,13 +3773,13 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
3768
3773
|
NativeScrollbars.prototype.zeroWidthHack = function () {
|
|
3769
3774
|
var w = mac && !mac_geMountainLion ? "12px" : "18px";
|
|
3770
3775
|
this.horiz.style.height = this.vert.style.width = w;
|
|
3771
|
-
this.horiz.style.
|
|
3776
|
+
this.horiz.style.visibility = this.vert.style.visibility = "hidden";
|
|
3772
3777
|
this.disableHoriz = new Delayed;
|
|
3773
3778
|
this.disableVert = new Delayed;
|
|
3774
3779
|
};
|
|
3775
3780
|
|
|
3776
3781
|
NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {
|
|
3777
|
-
bar.style.
|
|
3782
|
+
bar.style.visibility = "";
|
|
3778
3783
|
function maybeDisable() {
|
|
3779
3784
|
// To find out whether the scrollbar is still visible, we
|
|
3780
3785
|
// check whether the element under the pixel in the bottom
|
|
@@ -3785,7 +3790,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
3785
3790
|
var box = bar.getBoundingClientRect();
|
|
3786
3791
|
var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)
|
|
3787
3792
|
: document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);
|
|
3788
|
-
if (elt != bar) { bar.style.
|
|
3793
|
+
if (elt != bar) { bar.style.visibility = "hidden"; }
|
|
3789
3794
|
else { delay.set(1000, maybeDisable); }
|
|
3790
3795
|
}
|
|
3791
3796
|
delay.set(1000, maybeDisable);
|
|
@@ -3966,7 +3971,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
3966
3971
|
cm.display.maxLineChanged = false;
|
|
3967
3972
|
}
|
|
3968
3973
|
|
|
3969
|
-
var takeFocus = op.focus && op.focus == activeElt();
|
|
3974
|
+
var takeFocus = op.focus && op.focus == activeElt(doc(cm));
|
|
3970
3975
|
if (op.preparedSelection)
|
|
3971
3976
|
{ cm.display.input.showSelection(op.preparedSelection, takeFocus); }
|
|
3972
3977
|
if (op.updatedDisplay || op.startHeight != cm.doc.height)
|
|
@@ -4143,11 +4148,11 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
4143
4148
|
|
|
4144
4149
|
function selectionSnapshot(cm) {
|
|
4145
4150
|
if (cm.hasFocus()) { return null }
|
|
4146
|
-
var active = activeElt();
|
|
4151
|
+
var active = activeElt(doc(cm));
|
|
4147
4152
|
if (!active || !contains(cm.display.lineDiv, active)) { return null }
|
|
4148
4153
|
var result = {activeElt: active};
|
|
4149
4154
|
if (window.getSelection) {
|
|
4150
|
-
var sel =
|
|
4155
|
+
var sel = win(cm).getSelection();
|
|
4151
4156
|
if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {
|
|
4152
4157
|
result.anchorNode = sel.anchorNode;
|
|
4153
4158
|
result.anchorOffset = sel.anchorOffset;
|
|
@@ -4159,11 +4164,12 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
4159
4164
|
}
|
|
4160
4165
|
|
|
4161
4166
|
function restoreSelection(snapshot) {
|
|
4162
|
-
if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }
|
|
4167
|
+
if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(snapshot.activeElt.ownerDocument)) { return }
|
|
4163
4168
|
snapshot.activeElt.focus();
|
|
4164
4169
|
if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&
|
|
4165
4170
|
snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
|
|
4166
|
-
var
|
|
4171
|
+
var doc = snapshot.activeElt.ownerDocument;
|
|
4172
|
+
var sel = doc.defaultView.getSelection(), range = doc.createRange();
|
|
4167
4173
|
range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);
|
|
4168
4174
|
range.collapse(false);
|
|
4169
4175
|
sel.removeAllRanges();
|
|
@@ -4480,6 +4486,8 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
4480
4486
|
d.scroller.setAttribute("tabIndex", "-1");
|
|
4481
4487
|
// The element in which the editor lives.
|
|
4482
4488
|
d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
|
|
4489
|
+
// See #6982. FIXME remove when this has been fixed for a while in Chrome
|
|
4490
|
+
if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = "inset(0px)"; }
|
|
4483
4491
|
|
|
4484
4492
|
// This attribute is respected by automatic translation systems such as Google Translate,
|
|
4485
4493
|
// and may also be respected by tools used by human translators.
|
|
@@ -4584,7 +4592,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
4584
4592
|
// On Chrome 102, viewport updates somehow stop wheel-based
|
|
4585
4593
|
// scrolling. Turning off pointer events during the scroll seems
|
|
4586
4594
|
// to avoid the issue.
|
|
4587
|
-
if (chrome && chrome_version
|
|
4595
|
+
if (chrome && chrome_version == 102) {
|
|
4588
4596
|
if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = "none"; }
|
|
4589
4597
|
else { clearTimeout(cm.display.chromeScrollHack); }
|
|
4590
4598
|
cm.display.chromeScrollHack = setTimeout(function () {
|
|
@@ -5275,7 +5283,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
5275
5283
|
var range = sel.ranges[i];
|
|
5276
5284
|
var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];
|
|
5277
5285
|
var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);
|
|
5278
|
-
var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);
|
|
5286
|
+
var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear);
|
|
5279
5287
|
if (out || newAnchor != range.anchor || newHead != range.head) {
|
|
5280
5288
|
if (!out) { out = sel.ranges.slice(0, i); }
|
|
5281
5289
|
out[i] = new Range(newAnchor, newHead);
|
|
@@ -7327,7 +7335,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
7327
7335
|
function onKeyDown(e) {
|
|
7328
7336
|
var cm = this;
|
|
7329
7337
|
if (e.target && e.target != cm.display.input.getField()) { return }
|
|
7330
|
-
cm.curOp.focus = activeElt();
|
|
7338
|
+
cm.curOp.focus = activeElt(doc(cm));
|
|
7331
7339
|
if (signalDOMEvent(cm, e)) { return }
|
|
7332
7340
|
// IE does strange things with escape.
|
|
7333
7341
|
if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }
|
|
@@ -7434,7 +7442,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
7434
7442
|
}
|
|
7435
7443
|
if (clickInGutter(cm, e)) { return }
|
|
7436
7444
|
var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single";
|
|
7437
|
-
|
|
7445
|
+
win(cm).focus();
|
|
7438
7446
|
|
|
7439
7447
|
// #3261: make sure, that we're not starting a second selection
|
|
7440
7448
|
if (button == 1 && cm.state.selectingText)
|
|
@@ -7489,7 +7497,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
7489
7497
|
|
|
7490
7498
|
function leftButtonDown(cm, pos, repeat, event) {
|
|
7491
7499
|
if (ie) { setTimeout(bind(ensureFocus, cm), 0); }
|
|
7492
|
-
else { cm.curOp.focus = activeElt(); }
|
|
7500
|
+
else { cm.curOp.focus = activeElt(doc(cm)); }
|
|
7493
7501
|
|
|
7494
7502
|
var behavior = configureMouse(cm, repeat, event);
|
|
7495
7503
|
|
|
@@ -7559,19 +7567,19 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
7559
7567
|
// Normal selection, as opposed to text dragging.
|
|
7560
7568
|
function leftButtonSelect(cm, event, start, behavior) {
|
|
7561
7569
|
if (ie) { delayBlurEvent(cm); }
|
|
7562
|
-
var display = cm.display, doc = cm.doc;
|
|
7570
|
+
var display = cm.display, doc$1 = cm.doc;
|
|
7563
7571
|
e_preventDefault(event);
|
|
7564
7572
|
|
|
7565
|
-
var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;
|
|
7573
|
+
var ourRange, ourIndex, startSel = doc$1.sel, ranges = startSel.ranges;
|
|
7566
7574
|
if (behavior.addNew && !behavior.extend) {
|
|
7567
|
-
ourIndex = doc.sel.contains(start);
|
|
7575
|
+
ourIndex = doc$1.sel.contains(start);
|
|
7568
7576
|
if (ourIndex > -1)
|
|
7569
7577
|
{ ourRange = ranges[ourIndex]; }
|
|
7570
7578
|
else
|
|
7571
7579
|
{ ourRange = new Range(start, start); }
|
|
7572
7580
|
} else {
|
|
7573
|
-
ourRange = doc.sel.primary();
|
|
7574
|
-
ourIndex = doc.sel.primIndex;
|
|
7581
|
+
ourRange = doc$1.sel.primary();
|
|
7582
|
+
ourIndex = doc$1.sel.primIndex;
|
|
7575
7583
|
}
|
|
7576
7584
|
|
|
7577
7585
|
if (behavior.unit == "rectangle") {
|
|
@@ -7588,18 +7596,18 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
7588
7596
|
|
|
7589
7597
|
if (!behavior.addNew) {
|
|
7590
7598
|
ourIndex = 0;
|
|
7591
|
-
setSelection(doc, new Selection([ourRange], 0), sel_mouse);
|
|
7592
|
-
startSel = doc.sel;
|
|
7599
|
+
setSelection(doc$1, new Selection([ourRange], 0), sel_mouse);
|
|
7600
|
+
startSel = doc$1.sel;
|
|
7593
7601
|
} else if (ourIndex == -1) {
|
|
7594
7602
|
ourIndex = ranges.length;
|
|
7595
|
-
setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),
|
|
7603
|
+
setSelection(doc$1, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),
|
|
7596
7604
|
{scroll: false, origin: "*mouse"});
|
|
7597
7605
|
} else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) {
|
|
7598
|
-
setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
|
|
7606
|
+
setSelection(doc$1, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
|
|
7599
7607
|
{scroll: false, origin: "*mouse"});
|
|
7600
|
-
startSel = doc.sel;
|
|
7608
|
+
startSel = doc$1.sel;
|
|
7601
7609
|
} else {
|
|
7602
|
-
replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);
|
|
7610
|
+
replaceOneSelection(doc$1, ourIndex, ourRange, sel_mouse);
|
|
7603
7611
|
}
|
|
7604
7612
|
|
|
7605
7613
|
var lastPos = start;
|
|
@@ -7609,19 +7617,19 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
7609
7617
|
|
|
7610
7618
|
if (behavior.unit == "rectangle") {
|
|
7611
7619
|
var ranges = [], tabSize = cm.options.tabSize;
|
|
7612
|
-
var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);
|
|
7613
|
-
var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);
|
|
7620
|
+
var startCol = countColumn(getLine(doc$1, start.line).text, start.ch, tabSize);
|
|
7621
|
+
var posCol = countColumn(getLine(doc$1, pos.line).text, pos.ch, tabSize);
|
|
7614
7622
|
var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);
|
|
7615
7623
|
for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));
|
|
7616
7624
|
line <= end; line++) {
|
|
7617
|
-
var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);
|
|
7625
|
+
var text = getLine(doc$1, line).text, leftPos = findColumn(text, left, tabSize);
|
|
7618
7626
|
if (left == right)
|
|
7619
7627
|
{ ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }
|
|
7620
7628
|
else if (text.length > leftPos)
|
|
7621
7629
|
{ ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }
|
|
7622
7630
|
}
|
|
7623
7631
|
if (!ranges.length) { ranges.push(new Range(start, start)); }
|
|
7624
|
-
setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),
|
|
7632
|
+
setSelection(doc$1, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),
|
|
7625
7633
|
{origin: "*mouse", scroll: false});
|
|
7626
7634
|
cm.scrollIntoView(pos);
|
|
7627
7635
|
} else {
|
|
@@ -7636,8 +7644,8 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
7636
7644
|
anchor = maxPos(oldRange.to(), range.head);
|
|
7637
7645
|
}
|
|
7638
7646
|
var ranges$1 = startSel.ranges.slice(0);
|
|
7639
|
-
ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));
|
|
7640
|
-
setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);
|
|
7647
|
+
ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc$1, anchor), head));
|
|
7648
|
+
setSelection(doc$1, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);
|
|
7641
7649
|
}
|
|
7642
7650
|
}
|
|
7643
7651
|
|
|
@@ -7653,9 +7661,9 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
7653
7661
|
var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle");
|
|
7654
7662
|
if (!cur) { return }
|
|
7655
7663
|
if (cmp(cur, lastPos) != 0) {
|
|
7656
|
-
cm.curOp.focus = activeElt();
|
|
7664
|
+
cm.curOp.focus = activeElt(doc(cm));
|
|
7657
7665
|
extendTo(cur);
|
|
7658
|
-
var visible = visibleLines(display, doc);
|
|
7666
|
+
var visible = visibleLines(display, doc$1);
|
|
7659
7667
|
if (cur.line >= visible.to || cur.line < visible.from)
|
|
7660
7668
|
{ setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }
|
|
7661
7669
|
} else {
|
|
@@ -7680,7 +7688,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
7680
7688
|
}
|
|
7681
7689
|
off(display.wrapper.ownerDocument, "mousemove", move);
|
|
7682
7690
|
off(display.wrapper.ownerDocument, "mouseup", up);
|
|
7683
|
-
doc.history.lastSelOrigin = null;
|
|
7691
|
+
doc$1.history.lastSelOrigin = null;
|
|
7684
7692
|
}
|
|
7685
7693
|
|
|
7686
7694
|
var move = operation(cm, function (e) {
|
|
@@ -7837,7 +7845,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
7837
7845
|
for (var i = newBreaks.length - 1; i >= 0; i--)
|
|
7838
7846
|
{ replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }
|
|
7839
7847
|
});
|
|
7840
|
-
option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) {
|
|
7848
|
+
option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g, function (cm, val, old) {
|
|
7841
7849
|
cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g");
|
|
7842
7850
|
if (old != Init) { cm.refresh(); }
|
|
7843
7851
|
});
|
|
@@ -8357,7 +8365,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
8357
8365
|
|
|
8358
8366
|
CodeMirror.prototype = {
|
|
8359
8367
|
constructor: CodeMirror,
|
|
8360
|
-
focus: function(){
|
|
8368
|
+
focus: function(){win(this).focus(); this.display.input.focus();},
|
|
8361
8369
|
|
|
8362
8370
|
setOption: function(option, value) {
|
|
8363
8371
|
var options = this.options, old = options[option];
|
|
@@ -8681,7 +8689,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
8681
8689
|
|
|
8682
8690
|
signal(this, "overwriteToggle", this, this.state.overwrite);
|
|
8683
8691
|
},
|
|
8684
|
-
hasFocus: function() { return this.display.input.getField() == activeElt() },
|
|
8692
|
+
hasFocus: function() { return this.display.input.getField() == activeElt(doc(this)) },
|
|
8685
8693
|
isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },
|
|
8686
8694
|
|
|
8687
8695
|
scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),
|
|
@@ -8862,7 +8870,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
8862
8870
|
function findPosV(cm, pos, dir, unit) {
|
|
8863
8871
|
var doc = cm.doc, x = pos.left, y;
|
|
8864
8872
|
if (unit == "page") {
|
|
8865
|
-
var pageSize = Math.min(cm.display.wrapper.clientHeight,
|
|
8873
|
+
var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight);
|
|
8866
8874
|
var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);
|
|
8867
8875
|
y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;
|
|
8868
8876
|
} else if (unit == "line") {
|
|
@@ -8961,7 +8969,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
8961
8969
|
var kludge = hiddenTextarea(), te = kludge.firstChild;
|
|
8962
8970
|
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
|
|
8963
8971
|
te.value = lastCopied.text.join("\n");
|
|
8964
|
-
var hadFocus = activeElt();
|
|
8972
|
+
var hadFocus = activeElt(div.ownerDocument);
|
|
8965
8973
|
selectInput(te);
|
|
8966
8974
|
setTimeout(function () {
|
|
8967
8975
|
cm.display.lineSpace.removeChild(kludge);
|
|
@@ -8984,7 +8992,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
8984
8992
|
|
|
8985
8993
|
ContentEditableInput.prototype.prepareSelection = function () {
|
|
8986
8994
|
var result = prepareSelection(this.cm, false);
|
|
8987
|
-
result.focus = activeElt() == this.div;
|
|
8995
|
+
result.focus = activeElt(this.div.ownerDocument) == this.div;
|
|
8988
8996
|
return result
|
|
8989
8997
|
};
|
|
8990
8998
|
|
|
@@ -9080,7 +9088,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
9080
9088
|
|
|
9081
9089
|
ContentEditableInput.prototype.focus = function () {
|
|
9082
9090
|
if (this.cm.options.readOnly != "nocursor") {
|
|
9083
|
-
if (!this.selectionInEditor() || activeElt() != this.div)
|
|
9091
|
+
if (!this.selectionInEditor() || activeElt(this.div.ownerDocument) != this.div)
|
|
9084
9092
|
{ this.showSelection(this.prepareSelection(), true); }
|
|
9085
9093
|
this.div.focus();
|
|
9086
9094
|
}
|
|
@@ -9432,6 +9440,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
9432
9440
|
// Used to work around IE issue with selection being forgotten when focus moves away from textarea
|
|
9433
9441
|
this.hasSelection = false;
|
|
9434
9442
|
this.composing = null;
|
|
9443
|
+
this.resetting = false;
|
|
9435
9444
|
};
|
|
9436
9445
|
|
|
9437
9446
|
TextareaInput.prototype.init = function (display) {
|
|
@@ -9564,8 +9573,9 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
9564
9573
|
// Reset the input to correspond to the selection (or to be empty,
|
|
9565
9574
|
// when not typing and nothing is selected)
|
|
9566
9575
|
TextareaInput.prototype.reset = function (typing) {
|
|
9567
|
-
if (this.contextMenuPending || this.composing) { return }
|
|
9576
|
+
if (this.contextMenuPending || this.composing && typing) { return }
|
|
9568
9577
|
var cm = this.cm;
|
|
9578
|
+
this.resetting = true;
|
|
9569
9579
|
if (cm.somethingSelected()) {
|
|
9570
9580
|
this.prevInput = "";
|
|
9571
9581
|
var content = cm.getSelection();
|
|
@@ -9576,6 +9586,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
9576
9586
|
this.prevInput = this.textarea.value = "";
|
|
9577
9587
|
if (ie && ie_version >= 9) { this.hasSelection = null; }
|
|
9578
9588
|
}
|
|
9589
|
+
this.resetting = false;
|
|
9579
9590
|
};
|
|
9580
9591
|
|
|
9581
9592
|
TextareaInput.prototype.getField = function () { return this.textarea };
|
|
@@ -9583,7 +9594,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
9583
9594
|
TextareaInput.prototype.supportsTouch = function () { return false };
|
|
9584
9595
|
|
|
9585
9596
|
TextareaInput.prototype.focus = function () {
|
|
9586
|
-
if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) {
|
|
9597
|
+
if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt(this.textarea.ownerDocument) != this.textarea)) {
|
|
9587
9598
|
try { this.textarea.focus(); }
|
|
9588
9599
|
catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM
|
|
9589
9600
|
}
|
|
@@ -9637,7 +9648,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
9637
9648
|
// possible when it is clear that nothing happened. hasSelection
|
|
9638
9649
|
// will be the case when there is a lot of text in the textarea,
|
|
9639
9650
|
// in which case reading its value would be expensive.
|
|
9640
|
-
if (this.contextMenuPending || !cm.state.focused ||
|
|
9651
|
+
if (this.contextMenuPending || this.resetting || !cm.state.focused ||
|
|
9641
9652
|
(hasSelection(input) && !prevInput && !this.composing) ||
|
|
9642
9653
|
cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)
|
|
9643
9654
|
{ return false }
|
|
@@ -9706,9 +9717,9 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
9706
9717
|
input.wrapper.style.cssText = "position: static";
|
|
9707
9718
|
te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
|
|
9708
9719
|
var oldScrollY;
|
|
9709
|
-
if (webkit) { oldScrollY =
|
|
9720
|
+
if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712)
|
|
9710
9721
|
display.input.focus();
|
|
9711
|
-
if (webkit) {
|
|
9722
|
+
if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); }
|
|
9712
9723
|
display.input.reset();
|
|
9713
9724
|
// Adds "Select all" to context menu in FF
|
|
9714
9725
|
if (!cm.somethingSelected()) { te.value = input.prevInput = " "; }
|
|
@@ -9790,7 +9801,7 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
9790
9801
|
// Set autofocus to true if this textarea is focused, or if it has
|
|
9791
9802
|
// autofocus and no other element is focused.
|
|
9792
9803
|
if (options.autofocus == null) {
|
|
9793
|
-
var hasFocus = activeElt();
|
|
9804
|
+
var hasFocus = activeElt(textarea.ownerDocument);
|
|
9794
9805
|
options.autofocus = hasFocus == textarea ||
|
|
9795
9806
|
textarea.getAttribute("autofocus") != null && hasFocus == document.body;
|
|
9796
9807
|
}
|
|
@@ -9924,17 +9935,17 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
|
|
|
9924
9935
|
|
|
9925
9936
|
addLegacyProps(CodeMirror);
|
|
9926
9937
|
|
|
9927
|
-
CodeMirror.version = "5.65.
|
|
9938
|
+
CodeMirror.version = "5.65.10";
|
|
9928
9939
|
|
|
9929
9940
|
return CodeMirror;
|
|
9930
9941
|
})));
|
|
9931
9942
|
|
|
9932
9943
|
|
|
9933
9944
|
/*
|
|
9934
|
-
file https://github.com/codemirror/
|
|
9945
|
+
file https://github.com/codemirror/codemirror5/blob/5.65.10/addon/edit/matchbrackets.js
|
|
9935
9946
|
*/
|
|
9936
9947
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
9937
|
-
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
9948
|
+
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
9938
9949
|
|
|
9939
9950
|
(function(mod) {
|
|
9940
9951
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
@@ -10096,10 +10107,10 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/addon/edit/matchbrack
|
|
|
10096
10107
|
|
|
10097
10108
|
|
|
10098
10109
|
/*
|
|
10099
|
-
file https://github.com/codemirror/
|
|
10110
|
+
file https://github.com/codemirror/codemirror5/blob/5.65.10/addon/edit/trailingspace.js
|
|
10100
10111
|
*/
|
|
10101
10112
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
10102
|
-
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
10113
|
+
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
10103
10114
|
|
|
10104
10115
|
(function(mod) {
|
|
10105
10116
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
@@ -10128,10 +10139,10 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/addon/edit/trailingsp
|
|
|
10128
10139
|
|
|
10129
10140
|
|
|
10130
10141
|
/*
|
|
10131
|
-
file https://github.com/codemirror/
|
|
10142
|
+
file https://github.com/codemirror/codemirror5/blob/5.65.10/addon/lint/lint.js
|
|
10132
10143
|
*/
|
|
10133
10144
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
10134
|
-
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
10145
|
+
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
10135
10146
|
|
|
10136
10147
|
(function(mod) {
|
|
10137
10148
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
@@ -10424,10 +10435,10 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/addon/lint/lint.js
|
|
|
10424
10435
|
|
|
10425
10436
|
|
|
10426
10437
|
/*
|
|
10427
|
-
file https://github.com/codemirror/
|
|
10438
|
+
file https://github.com/codemirror/codemirror5/blob/5.65.10/addon/selection/active-line.js
|
|
10428
10439
|
*/
|
|
10429
10440
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
10430
|
-
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
10441
|
+
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
10431
10442
|
|
|
10432
10443
|
(function(mod) {
|
|
10433
10444
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
@@ -10501,10 +10512,10 @@ file https://github.com/codemirror/CodeMirror5/blob/5.65.5/addon/selection/activ
|
|
|
10501
10512
|
|
|
10502
10513
|
|
|
10503
10514
|
/*
|
|
10504
|
-
file https://github.com/codemirror/
|
|
10515
|
+
file https://github.com/codemirror/codemirror5/blob/5.65.10/mode/javascript/javascript.js
|
|
10505
10516
|
*/
|
|
10506
10517
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
10507
|
-
// Distributed under an MIT license: https://codemirror.net/LICENSE
|
|
10518
|
+
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
10508
10519
|
|
|
10509
10520
|
(function(mod) {
|
|
10510
10521
|
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
@@ -11284,7 +11295,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
|
|
|
11284
11295
|
if (type == "async" ||
|
|
11285
11296
|
(type == "variable" &&
|
|
11286
11297
|
(value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) &&
|
|
11287
|
-
cx.stream.match(/^\s
|
|
11298
|
+
cx.stream.match(/^\s+#?[\w$\xa1-\uffff]/, false))) {
|
|
11288
11299
|
cx.marked = "keyword";
|
|
11289
11300
|
return cont(classBody);
|
|
11290
11301
|
}
|