diff --git a/crates/pi-ast/src/summary.rs b/crates/pi-ast/src/summary.rs index af58602a9..96e5f35e4 100644 --- a/crates/pi-ast/src/summary.rs +++ b/crates/pi-ast/src/summary.rs @@ -108,10 +108,13 @@ impl ElidableForest { /// BFS unfold. Start with every root span folded (matches the legacy /// outermost-only behavior) and progressively replace folded spans with /// their elidable children, breadth-first, until the visible line count -/// reaches `unfold_until`. A candidate unfold that would push the visible -/// count past `unfold_limit` is rejected and aborts the loop ("revert the -/// last unfold because it overflew"). `unfold_until == 0` short-circuits -/// to the legacy behavior. +/// reaches `unfold_until`. A candidate unfold whose revealed lines would +/// push the visible count past `unfold_limit` is skipped — that span stays +/// folded and its subtree is not explored — while the BFS keeps unfolding +/// the remaining queued siblings. A single oversized, un-unfoldable leaf +/// (e.g. a `\n\n
\n