Skip to content

Commit a617ebb

Browse files
committed
fix(json-crdt-extensions): 🐛 if position is specified, return EOS point
1 parent 70210ae commit a617ebb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/json-crdt-extensions/peritext/Peritext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class Peritext<T = string> implements Printable {
132132
// TODO: Provide ability to attach to the end of the text?
133133
const str = this.str;
134134
const id = str.find(pos);
135-
if (!id) return this.point(str.id, Anchor.After);
135+
if (!id) return this.point(str.id, pos ? Anchor.Before : Anchor.After);
136136
return this.point(id, anchor);
137137
}
138138

src/json-crdt-extensions/peritext/slice/Slices.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export class Slices<T = string> implements Stateful, Printable {
207207

208208
public toString(tab: string = ''): string {
209209
return (
210-
this.toString() +
210+
this.toStringName() +
211211
printTree(
212212
tab,
213213
[...this.list.entries()].map(

0 commit comments

Comments
 (0)