@codemirror/view 6.39.11 → 6.39.13
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 +18 -0
- package/dist/index.cjs +8 -6
- package/dist/index.js +8 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## 6.39.13 (2026-02-08)
|
|
2
|
+
|
|
3
|
+
### Bug fixes
|
|
4
|
+
|
|
5
|
+
Fix an issue where a widget at start or end of line, when wrapped to cover that whole line, could block vertical cursor motion.
|
|
6
|
+
|
|
7
|
+
Fix an issue `EditorView.moveVertically` that would sometimes cause selection-extending vertical motion to get stuck on line wrapping points.
|
|
8
|
+
|
|
9
|
+
## 6.39.12 (2026-01-30)
|
|
10
|
+
|
|
11
|
+
### Bug fixes
|
|
12
|
+
|
|
13
|
+
Fix a bug where the visual selection drawn by `drawSelection` could fail to update properly in some circumstances.
|
|
14
|
+
|
|
15
|
+
Fix a bug where PageUp/PageDown near the edge of the viewport might completely skip to the start/end of the document.
|
|
16
|
+
|
|
17
|
+
Fix a regression that caused mark decorations to be split on text node chunk boundaries again.
|
|
18
|
+
|
|
1
19
|
## 6.39.11 (2026-01-14)
|
|
2
20
|
|
|
3
21
|
### Bug fixes
|
package/dist/index.cjs
CHANGED
|
@@ -2266,7 +2266,7 @@ class TileBuilder {
|
|
|
2266
2266
|
this.flushBuffer();
|
|
2267
2267
|
let parent = this.ensureMarks(marks, openStart);
|
|
2268
2268
|
let prev = parent.lastChild;
|
|
2269
|
-
if (prev && prev.isText() && !(prev.flags & 8 /* TileFlag.Composition */)) {
|
|
2269
|
+
if (prev && prev.isText() && !(prev.flags & 8 /* TileFlag.Composition */) && prev.length + text.length < 512 /* C.Chunk */) {
|
|
2270
2270
|
this.cache.reused.set(prev, 2 /* Reused.DOM */);
|
|
2271
2271
|
let tile = parent.children[parent.children.length - 1] = new TextTile(prev.dom, prev.text + text);
|
|
2272
2272
|
tile.parent = parent;
|
|
@@ -2760,7 +2760,7 @@ class TileUpdate {
|
|
|
2760
2760
|
}
|
|
2761
2761
|
else {
|
|
2762
2762
|
b.ensureLine(pendingLineAttrs);
|
|
2763
|
-
b.addText(chars, active, openStart);
|
|
2763
|
+
b.addText(chars, active, pos == from ? openStart : active.length);
|
|
2764
2764
|
pos += chars.length;
|
|
2765
2765
|
}
|
|
2766
2766
|
pendingLineAttrs = null;
|
|
@@ -3660,7 +3660,7 @@ function moveVertically(view, start, forward, distance) {
|
|
|
3660
3660
|
return state.EditorSelection.cursor(startPos, start.assoc);
|
|
3661
3661
|
let goal = start.goalColumn, startY;
|
|
3662
3662
|
let rect = view.contentDOM.getBoundingClientRect();
|
|
3663
|
-
let startCoords = view.coordsAtPos(startPos, start.assoc || -1), docTop = view.documentTop;
|
|
3663
|
+
let startCoords = view.coordsAtPos(startPos, (start.empty ? start.assoc : 0) || (forward ? 1 : -1)), docTop = view.documentTop;
|
|
3664
3664
|
if (startCoords) {
|
|
3665
3665
|
if (goal == null)
|
|
3666
3666
|
goal = startCoords.left - rect.left;
|
|
@@ -3741,8 +3741,10 @@ function posAtCoords(view, coords, precise, scanY) {
|
|
|
3741
3741
|
if (scanY == null)
|
|
3742
3742
|
break;
|
|
3743
3743
|
if (block.type == exports.BlockType.Text) {
|
|
3744
|
-
|
|
3745
|
-
|
|
3744
|
+
if (scanY < 0 ? block.to < view.viewport.from : block.from > view.viewport.to)
|
|
3745
|
+
break;
|
|
3746
|
+
// Check whether we aren't landing on the top/bottom padding of the line
|
|
3747
|
+
let rect = view.docView.coordsAt(scanY < 0 ? block.from : block.to, scanY > 0 ? -1 : 1);
|
|
3746
3748
|
if (rect && (scanY < 0 ? rect.top <= yOffset + docTop : rect.bottom >= yOffset + docTop))
|
|
3747
3749
|
break;
|
|
3748
3750
|
}
|
|
@@ -9098,7 +9100,7 @@ function rectanglesForRange(view, className, range) {
|
|
|
9098
9100
|
return pieces(top).concat(between).concat(pieces(bottom));
|
|
9099
9101
|
}
|
|
9100
9102
|
function piece(left, top, right, bottom) {
|
|
9101
|
-
return new RectangleMarker(className, left - base.left, top - base.top, right - left, bottom - top);
|
|
9103
|
+
return new RectangleMarker(className, left - base.left, top - base.top, Math.max(0, right - left), bottom - top);
|
|
9102
9104
|
}
|
|
9103
9105
|
function pieces({ top, bottom, horizontal }) {
|
|
9104
9106
|
let pieces = [];
|
package/dist/index.js
CHANGED
|
@@ -2262,7 +2262,7 @@ class TileBuilder {
|
|
|
2262
2262
|
this.flushBuffer();
|
|
2263
2263
|
let parent = this.ensureMarks(marks, openStart);
|
|
2264
2264
|
let prev = parent.lastChild;
|
|
2265
|
-
if (prev && prev.isText() && !(prev.flags & 8 /* TileFlag.Composition */)) {
|
|
2265
|
+
if (prev && prev.isText() && !(prev.flags & 8 /* TileFlag.Composition */) && prev.length + text.length < 512 /* C.Chunk */) {
|
|
2266
2266
|
this.cache.reused.set(prev, 2 /* Reused.DOM */);
|
|
2267
2267
|
let tile = parent.children[parent.children.length - 1] = new TextTile(prev.dom, prev.text + text);
|
|
2268
2268
|
tile.parent = parent;
|
|
@@ -2756,7 +2756,7 @@ class TileUpdate {
|
|
|
2756
2756
|
}
|
|
2757
2757
|
else {
|
|
2758
2758
|
b.ensureLine(pendingLineAttrs);
|
|
2759
|
-
b.addText(chars, active, openStart);
|
|
2759
|
+
b.addText(chars, active, pos == from ? openStart : active.length);
|
|
2760
2760
|
pos += chars.length;
|
|
2761
2761
|
}
|
|
2762
2762
|
pendingLineAttrs = null;
|
|
@@ -3656,7 +3656,7 @@ function moveVertically(view, start, forward, distance) {
|
|
|
3656
3656
|
return EditorSelection.cursor(startPos, start.assoc);
|
|
3657
3657
|
let goal = start.goalColumn, startY;
|
|
3658
3658
|
let rect = view.contentDOM.getBoundingClientRect();
|
|
3659
|
-
let startCoords = view.coordsAtPos(startPos, start.assoc || -1), docTop = view.documentTop;
|
|
3659
|
+
let startCoords = view.coordsAtPos(startPos, (start.empty ? start.assoc : 0) || (forward ? 1 : -1)), docTop = view.documentTop;
|
|
3660
3660
|
if (startCoords) {
|
|
3661
3661
|
if (goal == null)
|
|
3662
3662
|
goal = startCoords.left - rect.left;
|
|
@@ -3737,8 +3737,10 @@ function posAtCoords(view, coords, precise, scanY) {
|
|
|
3737
3737
|
if (scanY == null)
|
|
3738
3738
|
break;
|
|
3739
3739
|
if (block.type == BlockType.Text) {
|
|
3740
|
-
|
|
3741
|
-
|
|
3740
|
+
if (scanY < 0 ? block.to < view.viewport.from : block.from > view.viewport.to)
|
|
3741
|
+
break;
|
|
3742
|
+
// Check whether we aren't landing on the top/bottom padding of the line
|
|
3743
|
+
let rect = view.docView.coordsAt(scanY < 0 ? block.from : block.to, scanY > 0 ? -1 : 1);
|
|
3742
3744
|
if (rect && (scanY < 0 ? rect.top <= yOffset + docTop : rect.bottom >= yOffset + docTop))
|
|
3743
3745
|
break;
|
|
3744
3746
|
}
|
|
@@ -9093,7 +9095,7 @@ function rectanglesForRange(view, className, range) {
|
|
|
9093
9095
|
return pieces(top).concat(between).concat(pieces(bottom));
|
|
9094
9096
|
}
|
|
9095
9097
|
function piece(left, top, right, bottom) {
|
|
9096
|
-
return new RectangleMarker(className, left - base.left, top - base.top, right - left, bottom - top);
|
|
9098
|
+
return new RectangleMarker(className, left - base.left, top - base.top, Math.max(0, right - left), bottom - top);
|
|
9097
9099
|
}
|
|
9098
9100
|
function pieces({ top, bottom, horizontal }) {
|
|
9099
9101
|
let pieces = [];
|