@codemirror/state 6.7.5 → 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,9 @@
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
+
1
7
  ## 6.7.5 (2026-09-15)
2
8
 
3
9
  ### 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
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/state",
3
- "version": "6.7.5",
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",