Fix bug in split and add line->byte lookup.

This commit is contained in:
2026-07-28 19:18:31 +01:00
parent 784d2736e2
commit d8a59a5f5c
4 changed files with 33 additions and 3 deletions
+2 -2
View File
@@ -125,13 +125,13 @@ std::pair<Shard *, Shard *> split_shard(Shard *n, uint32_t offset) {
Petal *p = (Petal *)n;
auto left = new Petal(
offset,
p->source->count_lines(0, offset),
p->source->count_lines(p->pos, offset),
p->source,
p->pos
);
auto right = new Petal(
p->length - offset,
p->source->count_lines(offset, p->length),
p->source->count_lines(p->pos + offset, p->length - offset),
p->source,
p->pos + offset
);