From a8a99414d0ff5326cbe5b5cd442a32636bcbb0ef Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 14:01:45 -0600 Subject: [PATCH] Fix anchor_in_excerpt on replaced excerpts (cherry-pick #28880) (#28892) Cherry-picked Fix anchor_in_excerpt on replaced excerpts (#28880) Release Notes: - N/A Co-authored-by: Conrad Irwin --- crates/multi_buffer/src/multi_buffer.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/multi_buffer/src/multi_buffer.rs b/crates/multi_buffer/src/multi_buffer.rs index 0dd0d480ec6529aa9146859a7efa312756ddfd51..7c2b7c8f73e0bbe6772d54d4a6d5011b088ace27 100644 --- a/crates/multi_buffer/src/multi_buffer.rs +++ b/crates/multi_buffer/src/multi_buffer.rs @@ -5170,6 +5170,7 @@ impl MultiBufferSnapshot { excerpt_id: ExcerptId, text_anchor: text::Anchor, ) -> Option { + let excerpt_id = self.latest_excerpt_id(excerpt_id); let locator = self.excerpt_locator_for_id(excerpt_id); let mut cursor = self.excerpts.cursor::>(&()); cursor.seek(locator, Bias::Left, &());