@codemirror/lint 6.9.3 → 6.9.4
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 +6 -0
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -243,10 +243,10 @@ const nextDiagnostic = (view) => {
|
|
|
243
243
|
let field = view.state.field(lintState, false);
|
|
244
244
|
if (!field)
|
|
245
245
|
return false;
|
|
246
|
-
let sel = view.state.selection.main, next = field.diagnostics
|
|
247
|
-
if (!next
|
|
248
|
-
next = field.diagnostics
|
|
249
|
-
if (!next
|
|
246
|
+
let sel = view.state.selection.main, next = findDiagnostic(field.diagnostics, null, sel.to + 1);
|
|
247
|
+
if (!next) {
|
|
248
|
+
next = findDiagnostic(field.diagnostics, null, 0);
|
|
249
|
+
if (!next || next.from == sel.from && next.to == sel.to)
|
|
250
250
|
return false;
|
|
251
251
|
}
|
|
252
252
|
view.dispatch({ selection: { anchor: next.from, head: next.to }, scrollIntoView: true });
|
package/dist/index.js
CHANGED
|
@@ -241,10 +241,10 @@ const nextDiagnostic = (view) => {
|
|
|
241
241
|
let field = view.state.field(lintState, false);
|
|
242
242
|
if (!field)
|
|
243
243
|
return false;
|
|
244
|
-
let sel = view.state.selection.main, next = field.diagnostics
|
|
245
|
-
if (!next
|
|
246
|
-
next = field.diagnostics
|
|
247
|
-
if (!next
|
|
244
|
+
let sel = view.state.selection.main, next = findDiagnostic(field.diagnostics, null, sel.to + 1);
|
|
245
|
+
if (!next) {
|
|
246
|
+
next = findDiagnostic(field.diagnostics, null, 0);
|
|
247
|
+
if (!next || next.from == sel.from && next.to == sel.to)
|
|
248
248
|
return false;
|
|
249
249
|
}
|
|
250
250
|
view.dispatch({ selection: { anchor: next.from, head: next.to }, scrollIntoView: true });
|