@codemirror/lint 6.9.1 → 6.9.3
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 +12 -0
- package/dist/index.cjs +9 -2
- package/dist/index.js +9 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 6.9.3 (2026-01-27)
|
|
2
|
+
|
|
3
|
+
### Bug fixes
|
|
4
|
+
|
|
5
|
+
Fix an issue where the lint panel inappropriately blocks the default behavior of key combinations with Ctrl, Alt, or Cmd held.
|
|
6
|
+
|
|
7
|
+
## 6.9.2 (2025-11-03)
|
|
8
|
+
|
|
9
|
+
### Bug fixes
|
|
10
|
+
|
|
11
|
+
Fix an infinite loop that would occur when a diagnostic pointed beyond the end of the document.
|
|
12
|
+
|
|
1
13
|
## 6.9.1 (2025-10-23)
|
|
2
14
|
|
|
3
15
|
### Bug fixes
|
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ class LintState {
|
|
|
24
24
|
diagnostics = diagnosticFilter(diagnostics, state$1);
|
|
25
25
|
let sorted = diagnostics.slice().sort((a, b) => a.from - b.from || a.to - b.to);
|
|
26
26
|
let deco = new state.RangeSetBuilder(), active = [], pos = 0;
|
|
27
|
-
let scan = state$1.doc.iter(), scanPos = 0;
|
|
27
|
+
let scan = state$1.doc.iter(), scanPos = 0, docLen = state$1.doc.length;
|
|
28
28
|
for (let i = 0;;) {
|
|
29
29
|
let next = i == sorted.length ? null : sorted[i];
|
|
30
30
|
if (!next && !active.length)
|
|
@@ -36,6 +36,8 @@ class LintState {
|
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
38
|
from = next.from;
|
|
39
|
+
if (from > docLen)
|
|
40
|
+
break;
|
|
39
41
|
to = next.to;
|
|
40
42
|
active.push(next);
|
|
41
43
|
i++;
|
|
@@ -52,8 +54,9 @@ class LintState {
|
|
|
52
54
|
break;
|
|
53
55
|
}
|
|
54
56
|
}
|
|
57
|
+
to = Math.min(to, docLen);
|
|
55
58
|
let widget = false;
|
|
56
|
-
if (active.some(d => d.from == from && d.to == to)) {
|
|
59
|
+
if (active.some(d => d.from == from && (d.to == to || to == docLen))) {
|
|
57
60
|
widget = from == to;
|
|
58
61
|
if (!widget && to - from < 10) {
|
|
59
62
|
let behind = from - (scanPos + scan.value.length);
|
|
@@ -90,6 +93,8 @@ class LintState {
|
|
|
90
93
|
}));
|
|
91
94
|
}
|
|
92
95
|
pos = to;
|
|
96
|
+
if (pos == docLen)
|
|
97
|
+
break;
|
|
93
98
|
for (let i = 0; i < active.length; i++)
|
|
94
99
|
if (active[i].to <= pos)
|
|
95
100
|
active.splice(i--, 1);
|
|
@@ -455,6 +460,8 @@ class LintPanel {
|
|
|
455
460
|
this.view = view;
|
|
456
461
|
this.items = [];
|
|
457
462
|
let onkeydown = (event) => {
|
|
463
|
+
if (event.ctrlKey || event.altKey || event.metaKey)
|
|
464
|
+
return;
|
|
458
465
|
if (event.keyCode == 27) { // Escape
|
|
459
466
|
closeLintPanel(this.view);
|
|
460
467
|
this.view.focus();
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ class LintState {
|
|
|
22
22
|
diagnostics = diagnosticFilter(diagnostics, state);
|
|
23
23
|
let sorted = diagnostics.slice().sort((a, b) => a.from - b.from || a.to - b.to);
|
|
24
24
|
let deco = new RangeSetBuilder(), active = [], pos = 0;
|
|
25
|
-
let scan = state.doc.iter(), scanPos = 0;
|
|
25
|
+
let scan = state.doc.iter(), scanPos = 0, docLen = state.doc.length;
|
|
26
26
|
for (let i = 0;;) {
|
|
27
27
|
let next = i == sorted.length ? null : sorted[i];
|
|
28
28
|
if (!next && !active.length)
|
|
@@ -34,6 +34,8 @@ class LintState {
|
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
36
|
from = next.from;
|
|
37
|
+
if (from > docLen)
|
|
38
|
+
break;
|
|
37
39
|
to = next.to;
|
|
38
40
|
active.push(next);
|
|
39
41
|
i++;
|
|
@@ -50,8 +52,9 @@ class LintState {
|
|
|
50
52
|
break;
|
|
51
53
|
}
|
|
52
54
|
}
|
|
55
|
+
to = Math.min(to, docLen);
|
|
53
56
|
let widget = false;
|
|
54
|
-
if (active.some(d => d.from == from && d.to == to)) {
|
|
57
|
+
if (active.some(d => d.from == from && (d.to == to || to == docLen))) {
|
|
55
58
|
widget = from == to;
|
|
56
59
|
if (!widget && to - from < 10) {
|
|
57
60
|
let behind = from - (scanPos + scan.value.length);
|
|
@@ -88,6 +91,8 @@ class LintState {
|
|
|
88
91
|
}));
|
|
89
92
|
}
|
|
90
93
|
pos = to;
|
|
94
|
+
if (pos == docLen)
|
|
95
|
+
break;
|
|
91
96
|
for (let i = 0; i < active.length; i++)
|
|
92
97
|
if (active[i].to <= pos)
|
|
93
98
|
active.splice(i--, 1);
|
|
@@ -453,6 +458,8 @@ class LintPanel {
|
|
|
453
458
|
this.view = view;
|
|
454
459
|
this.items = [];
|
|
455
460
|
let onkeydown = (event) => {
|
|
461
|
+
if (event.ctrlKey || event.altKey || event.metaKey)
|
|
462
|
+
return;
|
|
456
463
|
if (event.keyCode == 27) { // Escape
|
|
457
464
|
closeLintPanel(this.view);
|
|
458
465
|
this.view.focus();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemirror/lint",
|
|
3
|
-
"version": "6.9.
|
|
3
|
+
"version": "6.9.3",
|
|
4
4
|
"description": "Linting support for the CodeMirror code editor",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "cm-runtests",
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|
|
37
37
|
"type": "git",
|
|
38
|
-
"url": "https://github.com/codemirror/lint.git"
|
|
38
|
+
"url": "git+https://github.com/codemirror/lint.git"
|
|
39
39
|
}
|
|
40
40
|
}
|