@codemirror/view 6.15.2 → 6.15.3

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.15.3 (2023-07-18)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix another crash regression for compositions before line breaks.
6
+
1
7
  ## 6.15.2 (2023-07-18)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -2617,14 +2617,17 @@ class DocView extends ContentView {
2617
2617
  openStart = before.openStart;
2618
2618
  openEnd = after.openEnd;
2619
2619
  let compLine = this.compositionView(composition);
2620
- if (after.content.length) {
2620
+ if (after.breakAtStart) {
2621
+ compLine.breakAfter = 1;
2622
+ }
2623
+ else if (after.content.length &&
2624
+ compLine.merge(compLine.length, compLine.length, after.content[0], false, after.openStart, 0)) {
2621
2625
  compLine.breakAfter = after.content[0].breakAfter;
2622
- if (compLine.merge(compLine.length, compLine.length, after.content[0], false, after.openStart, 0))
2623
- after.content.shift();
2626
+ after.content.shift();
2624
2627
  }
2625
- if (before.content.length) {
2626
- if (compLine.merge(0, 0, before.content[before.content.length - 1], true, 0, before.openEnd))
2627
- before.content.pop();
2628
+ if (before.content.length &&
2629
+ compLine.merge(0, 0, before.content[before.content.length - 1], true, 0, before.openEnd)) {
2630
+ before.content.pop();
2628
2631
  }
2629
2632
  content = before.content.concat(compLine).concat(after.content);
2630
2633
  }
package/dist/index.js CHANGED
@@ -2611,14 +2611,17 @@ class DocView extends ContentView {
2611
2611
  openStart = before.openStart;
2612
2612
  openEnd = after.openEnd;
2613
2613
  let compLine = this.compositionView(composition);
2614
- if (after.content.length) {
2614
+ if (after.breakAtStart) {
2615
+ compLine.breakAfter = 1;
2616
+ }
2617
+ else if (after.content.length &&
2618
+ compLine.merge(compLine.length, compLine.length, after.content[0], false, after.openStart, 0)) {
2615
2619
  compLine.breakAfter = after.content[0].breakAfter;
2616
- if (compLine.merge(compLine.length, compLine.length, after.content[0], false, after.openStart, 0))
2617
- after.content.shift();
2620
+ after.content.shift();
2618
2621
  }
2619
- if (before.content.length) {
2620
- if (compLine.merge(0, 0, before.content[before.content.length - 1], true, 0, before.openEnd))
2621
- before.content.pop();
2622
+ if (before.content.length &&
2623
+ compLine.merge(0, 0, before.content[before.content.length - 1], true, 0, before.openEnd)) {
2624
+ before.content.pop();
2622
2625
  }
2623
2626
  content = before.content.concat(compLine).concat(after.content);
2624
2627
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "6.15.2",
3
+ "version": "6.15.3",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",