From 241d0a41db589ace21db1ebd6672854b576a2995 Mon Sep 17 00:00:00 2001 From: Youssef Azriouil Date: Sun, 8 Nov 2026 16:13:58 +0100 Subject: [PATCH] Copy: drop the second pass over anchored stories in the clipping --- crates/engine/src/cmd/edit.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index d40e59d15..ef7e95224 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -638,11 +638,7 @@ pub(crate) fn clip_doc(s: &Session) -> Result { for p in d.parents.iter_mut() { Arc::make_mut(p).items.clear(); } - // Stories shown by text frames anchored in the kept stories go along (and theirs). - let anchored: std::collections::HashSet = - d.stories.values().filter(|st| st.frames.iter().any(|f| frames.contains(f))).flat_map(|st| d.anchored_stories(st).into_keys()).collect(); - d.stories.retain(|id, st| st.frames.iter().any(|f| frames.contains(f)) || anchored.contains(id)); - frames.extend(d.anchored_items().into_iter().map(|(_, i)| i.id)); + d.stories.retain(|_, st| st.frames.iter().any(|f| frames.contains(f))); for st in d.stories.values_mut() { Arc::make_mut(st).frames.retain(|f| frames.contains(f)); }