@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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## 6.9.4 (2026-02-11)
2
+
3
+ ### Bug fixes
4
+
5
+ Make sure `nextDiagnostic` selects entire diagnostics, even when they overlap with other diagnostics.
6
+
1
7
  ## 6.9.3 (2026-01-27)
2
8
 
3
9
  ### Bug fixes
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.iter(sel.to + 1);
247
- if (!next.value) {
248
- next = field.diagnostics.iter(0);
249
- if (!next.value || next.from == sel.from && next.to == sel.to)
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.iter(sel.to + 1);
245
- if (!next.value) {
246
- next = field.diagnostics.iter(0);
247
- if (!next.value || next.from == sel.from && next.to == sel.to)
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 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/lint",
3
- "version": "6.9.3",
3
+ "version": "6.9.4",
4
4
  "description": "Linting support for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",