diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 3ca5798af451bbab8f38622946deb09121ec9adc..df7a6c7eba716b766651862909617f4efb0f0fce 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -4952,6 +4952,9 @@ impl Editor { ); let offsets = snapshot.summaries_for_anchors::(anchors_with_status.iter().map(|a| &a.1)); + assert_eq!(anchors_with_status.len(), 2 * self.selections.len()); + assert_eq!(offsets.len(), anchors_with_status.len()); + let offsets = offsets.chunks(2); let statuses = anchors_with_status .chunks(2) diff --git a/crates/editor/src/multi_buffer.rs b/crates/editor/src/multi_buffer.rs index c267ea775fe7800c1d9d1ebc457e360c211fcaf5..4a6169e5d362833acbed6eaa228443081b404d0f 100644 --- a/crates/editor/src/multi_buffer.rs +++ b/crates/editor/src/multi_buffer.rs @@ -3664,10 +3664,9 @@ mod tests { } // Anchor resolution - for (anchor, resolved_offset) in anchors - .iter() - .zip(snapshot.summaries_for_anchors::(&anchors)) - { + let summaries = snapshot.summaries_for_anchors::(&anchors); + assert_eq!(anchors.len(), summaries.len()); + for (anchor, resolved_offset) in anchors.iter().zip(summaries) { assert!(resolved_offset <= snapshot.len()); assert_eq!( snapshot.summary_for_anchor::(anchor),