Fix anchor_in_excerpt on replaced excerpts (#28880)

Conrad Irwin created

Release Notes:

- N/A

Change summary

crates/multi_buffer/src/multi_buffer.rs | 1 +
1 file changed, 1 insertion(+)

Detailed changes

crates/multi_buffer/src/multi_buffer.rs 🔗

@@ -5170,6 +5170,7 @@ impl MultiBufferSnapshot {
         excerpt_id: ExcerptId,
         text_anchor: text::Anchor,
     ) -> Option<Anchor> {
+        let excerpt_id = self.latest_excerpt_id(excerpt_id);
         let locator = self.excerpt_locator_for_id(excerpt_id);
         let mut cursor = self.excerpts.cursor::<Option<&Locator>>(&());
         cursor.seek(locator, Bias::Left, &());