@adecore/editor-core 0.49.6 → 0.49.7
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/dist/document.js +10 -3
- package/package.json +1 -1
- package/src/document.ts +13 -3
package/dist/document.js
CHANGED
|
@@ -1980,9 +1980,16 @@ export class DocumentModel {
|
|
|
1980
1980
|
for (const range of this.structure()) {
|
|
1981
1981
|
candidates.push({ from: range.innerFrom, to: range.innerTo }, range);
|
|
1982
1982
|
}
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
.
|
|
1983
|
+
let smallest;
|
|
1984
|
+
for (const range of candidates) {
|
|
1985
|
+
if (range.from > from || range.to < to || (range.from === from && range.to === to)) {
|
|
1986
|
+
continue;
|
|
1987
|
+
}
|
|
1988
|
+
if (smallest === undefined || range.to - range.from < smallest.to - smallest.from) {
|
|
1989
|
+
smallest = range;
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
return smallest;
|
|
1986
1993
|
}
|
|
1987
1994
|
shrinkSelection() {
|
|
1988
1995
|
const previous = this.selectionHistory.pop();
|
package/package.json
CHANGED
package/src/document.ts
CHANGED
|
@@ -2778,9 +2778,19 @@ export class DocumentModel {
|
|
|
2778
2778
|
candidates.push({ from: range.innerFrom, to: range.innerTo }, range);
|
|
2779
2779
|
}
|
|
2780
2780
|
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2781
|
+
let smallest: OffsetRange | undefined;
|
|
2782
|
+
|
|
2783
|
+
for (const range of candidates) {
|
|
2784
|
+
if (range.from > from || range.to < to || (range.from === from && range.to === to)) {
|
|
2785
|
+
continue;
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2788
|
+
if (smallest === undefined || range.to - range.from < smallest.to - smallest.from) {
|
|
2789
|
+
smallest = range;
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2793
|
+
return smallest;
|
|
2784
2794
|
}
|
|
2785
2795
|
|
|
2786
2796
|
private shrinkSelection(): boolean {
|