@codemirror/view 6.28.3 → 6.28.4

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.28.4 (2024-07-03)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix a bug where EditContext-based editing could corrupt the document in some situations.
6
+
1
7
  ## 6.28.3 (2024-07-01)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -7106,7 +7106,7 @@ class EditContextManager {
7106
7106
  change.from = anchor;
7107
7107
  else if (change.to == this.to && anchor > this.to)
7108
7108
  change.to = anchor;
7109
- // Edit context sometimes fire empty changes
7109
+ // Edit contexts sometimes fire empty changes
7110
7110
  if (change.from == change.to && !change.insert.length)
7111
7111
  return;
7112
7112
  this.pendingContextChange = change;
@@ -7165,6 +7165,7 @@ class EditContextManager {
7165
7165
  if (pending.from == fromA && pending.to == toA && pending.insert.eq(insert)) {
7166
7166
  pending = this.pendingContextChange = null; // Match
7167
7167
  off += dLen;
7168
+ this.to += dLen;
7168
7169
  return;
7169
7170
  }
7170
7171
  else { // Mismatch, revert
package/dist/index.js CHANGED
@@ -7101,7 +7101,7 @@ class EditContextManager {
7101
7101
  change.from = anchor;
7102
7102
  else if (change.to == this.to && anchor > this.to)
7103
7103
  change.to = anchor;
7104
- // Edit context sometimes fire empty changes
7104
+ // Edit contexts sometimes fire empty changes
7105
7105
  if (change.from == change.to && !change.insert.length)
7106
7106
  return;
7107
7107
  this.pendingContextChange = change;
@@ -7160,6 +7160,7 @@ class EditContextManager {
7160
7160
  if (pending.from == fromA && pending.to == toA && pending.insert.eq(insert)) {
7161
7161
  pending = this.pendingContextChange = null; // Match
7162
7162
  off += dLen;
7163
+ this.to += dLen;
7163
7164
  return;
7164
7165
  }
7165
7166
  else { // Mismatch, revert
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "6.28.3",
3
+ "version": "6.28.4",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",