@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 +6 -0
- package/dist/index.cjs +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
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
|
}
|