@codemirror/view 0.19.23 → 0.19.24

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
+ ## 0.19.24 (2021-12-01)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix a bug where `lineBlockAt`, for queries inside the viewport, would always return the first line in the viewport.
6
+
1
7
  ## 0.19.23 (2021-11-30)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -4794,7 +4794,7 @@ class ViewState {
4794
4794
  return changed ? 4 /* Viewport */ : 0;
4795
4795
  }
4796
4796
  lineBlockAt(pos) {
4797
- return (pos >= this.viewport.from && pos <= this.viewport.to && this.viewportLines.find(b => b.from <= pos && b.to <= pos)) ||
4797
+ return (pos >= this.viewport.from && pos <= this.viewport.to && this.viewportLines.find(b => b.from <= pos && b.to >= pos)) ||
4798
4798
  scaleBlock(this.heightMap.lineAt(pos, QueryType.ByPos, this.state.doc, 0, 0), this.scaler);
4799
4799
  }
4800
4800
  lineBlockAtHeight(height) {
package/dist/index.js CHANGED
@@ -4788,7 +4788,7 @@ class ViewState {
4788
4788
  return changed ? 4 /* Viewport */ : 0;
4789
4789
  }
4790
4790
  lineBlockAt(pos) {
4791
- return (pos >= this.viewport.from && pos <= this.viewport.to && this.viewportLines.find(b => b.from <= pos && b.to <= pos)) ||
4791
+ return (pos >= this.viewport.from && pos <= this.viewport.to && this.viewportLines.find(b => b.from <= pos && b.to >= pos)) ||
4792
4792
  scaleBlock(this.heightMap.lineAt(pos, QueryType.ByPos, this.state.doc, 0, 0), this.scaler);
4793
4793
  }
4794
4794
  lineBlockAtHeight(height) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "0.19.23",
3
+ "version": "0.19.24",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",