@codemirror/state 6.7.4 → 6.7.6

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,15 @@
1
+ ## 6.7.6 (2026-09-22)
2
+
3
+ ### Bug fixes
4
+
5
+ Make sure cursors produced by `changeByRange` are associated with the text they inserted.
6
+
7
+ ## 6.7.5 (2026-09-15)
8
+
9
+ ### Bug fixes
10
+
11
+ Fix a range set comparison bug that could cause spurious redraws around block wrapper boundaries.
12
+
1
13
  ## 6.7.4 (2026-09-04)
2
14
 
3
15
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -2644,7 +2644,7 @@ class EditorState {
2644
2644
  if (typeof text == "string")
2645
2645
  text = this.toText(text);
2646
2646
  return this.changeByRange(range => ({ changes: { from: range.from, to: range.to, insert: text },
2647
- range: EditorSelection.cursor(range.from + text.length) }));
2647
+ range: EditorSelection.cursor(range.from + text.length, -1) }));
2648
2648
  }
2649
2649
  /**
2650
2650
  Create a set of changes and a new selection by running the given
@@ -3867,8 +3867,10 @@ function compare(a, startA, b, startB, length, comparator) {
3867
3867
  boundChange = false;
3868
3868
  }
3869
3869
  else {
3870
- if (boundChange)
3870
+ if (boundChange) {
3871
3871
  comparator.boundChange(pos);
3872
+ boundChange = false;
3873
+ }
3872
3874
  if (clipEnd > pos && !sameValues(a.active, b.active))
3873
3875
  comparator.compareRange(pos, clipEnd, a.active, b.active);
3874
3876
  if (bounds && clipEnd < endB && (dEnd || a.openEnd(end) != b.openEnd(end)))
package/dist/index.js CHANGED
@@ -2640,7 +2640,7 @@ class EditorState {
2640
2640
  if (typeof text == "string")
2641
2641
  text = this.toText(text);
2642
2642
  return this.changeByRange(range => ({ changes: { from: range.from, to: range.to, insert: text },
2643
- range: EditorSelection.cursor(range.from + text.length) }));
2643
+ range: EditorSelection.cursor(range.from + text.length, -1) }));
2644
2644
  }
2645
2645
  /**
2646
2646
  Create a set of changes and a new selection by running the given
@@ -3863,8 +3863,10 @@ function compare(a, startA, b, startB, length, comparator) {
3863
3863
  boundChange = false;
3864
3864
  }
3865
3865
  else {
3866
- if (boundChange)
3866
+ if (boundChange) {
3867
3867
  comparator.boundChange(pos);
3868
+ boundChange = false;
3869
+ }
3868
3870
  if (clipEnd > pos && !sameValues(a.active, b.active))
3869
3871
  comparator.compareRange(pos, clipEnd, a.active, b.active);
3870
3872
  if (bounds && clipEnd < endB && (dEnd || a.openEnd(end) != b.openEnd(end)))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/state",
3
- "version": "6.7.4",
3
+ "version": "6.7.6",
4
4
  "description": "Editor state data structures for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",