Skip to content

v1.5.0

@dimbleby dimbleby tagged this 24 May 23:01
reorder_container and renormalise_aot_order unlink every owned slot
then re-splice them in the new order. When the region starts at the
doc head, the unlink-all transient leaves the doc temporarily
empty (head is None). The subsequent insert_before_head used to fire
its 'empty-doc preamble migration' branch — intended for first-time
inserts into a fresh empty doc with preamble parked in _trailing —
draining doc._trailing onto the new head's leading. The reorder's
re-stitch step then overwrote that leading with positional + remainder
trivia, and the trailing epilogue silently vanished.

Rather than thread a flag, separate the two concerns: insert_before_head
is now a pure mechanical splice, and the preamble migration moves to
a dedicated _promote_trailing_to_preamble helper that the three
genuine empty-doc first-insert sites call explicitly. The reorder
paths simply don't call it, so the bug becomes structurally
impossible to reintroduce.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assets 2
Loading