@codemirror/language 6.10.1 → 6.10.2
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 -4
- package/dist/index.js +8 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -2619,9 +2619,13 @@ function buildDeco(view, tree, always) {
|
|
|
2619
2619
|
function clipRTLLines(ranges, doc) {
|
|
2620
2620
|
let cur = doc.iter(), pos = 0, result = [], last = null;
|
|
2621
2621
|
for (let { from, to } of ranges) {
|
|
2622
|
-
if (
|
|
2623
|
-
|
|
2624
|
-
|
|
2622
|
+
if (last && last.to > from) {
|
|
2623
|
+
from = last.to;
|
|
2624
|
+
if (from >= to)
|
|
2625
|
+
continue;
|
|
2626
|
+
}
|
|
2627
|
+
if (pos + cur.value.length < from) {
|
|
2628
|
+
cur.next(from - (pos + cur.value.length));
|
|
2625
2629
|
pos = from;
|
|
2626
2630
|
}
|
|
2627
2631
|
for (;;) {
|
|
@@ -2632,7 +2636,7 @@ function clipRTLLines(ranges, doc) {
|
|
|
2632
2636
|
else
|
|
2633
2637
|
result.push(last = { from: start, to: Math.min(to, end) });
|
|
2634
2638
|
}
|
|
2635
|
-
if (
|
|
2639
|
+
if (end >= to)
|
|
2636
2640
|
break;
|
|
2637
2641
|
pos = end;
|
|
2638
2642
|
cur.next();
|
package/dist/index.js
CHANGED
|
@@ -2617,9 +2617,13 @@ function buildDeco(view, tree, always) {
|
|
|
2617
2617
|
function clipRTLLines(ranges, doc) {
|
|
2618
2618
|
let cur = doc.iter(), pos = 0, result = [], last = null;
|
|
2619
2619
|
for (let { from, to } of ranges) {
|
|
2620
|
-
if (
|
|
2621
|
-
|
|
2622
|
-
|
|
2620
|
+
if (last && last.to > from) {
|
|
2621
|
+
from = last.to;
|
|
2622
|
+
if (from >= to)
|
|
2623
|
+
continue;
|
|
2624
|
+
}
|
|
2625
|
+
if (pos + cur.value.length < from) {
|
|
2626
|
+
cur.next(from - (pos + cur.value.length));
|
|
2623
2627
|
pos = from;
|
|
2624
2628
|
}
|
|
2625
2629
|
for (;;) {
|
|
@@ -2630,7 +2634,7 @@ function clipRTLLines(ranges, doc) {
|
|
|
2630
2634
|
else
|
|
2631
2635
|
result.push(last = { from: start, to: Math.min(to, end) });
|
|
2632
2636
|
}
|
|
2633
|
-
if (
|
|
2637
|
+
if (end >= to)
|
|
2634
2638
|
break;
|
|
2635
2639
|
pos = end;
|
|
2636
2640
|
cur.next();
|