@codemirror/state 0.19.8 → 0.19.9
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 +6 -0
- package/dist/index.cjs +8 -1
- package/dist/index.js +8 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -685,7 +685,14 @@ class SelectionRange {
|
|
|
685
685
|
updated document.
|
|
686
686
|
*/
|
|
687
687
|
map(change, assoc = -1) {
|
|
688
|
-
let from
|
|
688
|
+
let from, to;
|
|
689
|
+
if (this.empty) {
|
|
690
|
+
from = to = change.mapPos(this.from, assoc);
|
|
691
|
+
}
|
|
692
|
+
else {
|
|
693
|
+
from = change.mapPos(this.from, 1);
|
|
694
|
+
to = change.mapPos(this.to, -1);
|
|
695
|
+
}
|
|
689
696
|
return from == this.from && to == this.to ? this : new SelectionRange(from, to, this.flags);
|
|
690
697
|
}
|
|
691
698
|
/**
|
package/dist/index.js
CHANGED
|
@@ -681,7 +681,14 @@ class SelectionRange {
|
|
|
681
681
|
updated document.
|
|
682
682
|
*/
|
|
683
683
|
map(change, assoc = -1) {
|
|
684
|
-
let from
|
|
684
|
+
let from, to;
|
|
685
|
+
if (this.empty) {
|
|
686
|
+
from = to = change.mapPos(this.from, assoc);
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
from = change.mapPos(this.from, 1);
|
|
690
|
+
to = change.mapPos(this.to, -1);
|
|
691
|
+
}
|
|
685
692
|
return from == this.from && to == this.to ? this : new SelectionRange(from, to, this.flags);
|
|
686
693
|
}
|
|
687
694
|
/**
|