@codemirror/lint 6.4.1 → 6.4.2

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.4.2 (2023-09-14)
2
+
3
+ ### Bug fixes
4
+
5
+ Make sure scrolling diagnostic into view in the panel works when the editor is scaled.
6
+
1
7
  ## 6.4.1 (2023-08-26)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -467,10 +467,11 @@ class LintPanel {
467
467
  key: this,
468
468
  read: () => ({ sel: newSelectedItem.dom.getBoundingClientRect(), panel: this.list.getBoundingClientRect() }),
469
469
  write: ({ sel, panel }) => {
470
+ let scaleY = panel.height / this.list.offsetHeight;
470
471
  if (sel.top < panel.top)
471
- this.list.scrollTop -= panel.top - sel.top;
472
+ this.list.scrollTop -= (panel.top - sel.top) / scaleY;
472
473
  else if (sel.bottom > panel.bottom)
473
- this.list.scrollTop += sel.bottom - panel.bottom;
474
+ this.list.scrollTop += (sel.bottom - panel.bottom) / scaleY;
474
475
  }
475
476
  });
476
477
  }
package/dist/index.js CHANGED
@@ -465,10 +465,11 @@ class LintPanel {
465
465
  key: this,
466
466
  read: () => ({ sel: newSelectedItem.dom.getBoundingClientRect(), panel: this.list.getBoundingClientRect() }),
467
467
  write: ({ sel, panel }) => {
468
+ let scaleY = panel.height / this.list.offsetHeight;
468
469
  if (sel.top < panel.top)
469
- this.list.scrollTop -= panel.top - sel.top;
470
+ this.list.scrollTop -= (panel.top - sel.top) / scaleY;
470
471
  else if (sel.bottom > panel.bottom)
471
- this.list.scrollTop += sel.bottom - panel.bottom;
472
+ this.list.scrollTop += (sel.bottom - panel.bottom) / scaleY;
472
473
  }
473
474
  });
474
475
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/lint",
3
- "version": "6.4.1",
3
+ "version": "6.4.2",
4
4
  "description": "Linting support for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",