diff --git a/crates/multi_buffer/src/multi_buffer.rs b/crates/multi_buffer/src/multi_buffer.rs index b578acd303..1d7183532b 100644 --- a/crates/multi_buffer/src/multi_buffer.rs +++ b/crates/multi_buffer/src/multi_buffer.rs @@ -3830,6 +3830,11 @@ impl MultiBufferSnapshot { // When there are no more metadata items for this excerpt, move to the next excerpt. else { current_excerpt_metadata.take(); + if let Some((end_excerpt_id, _)) = range_end { + if excerpt.id == end_excerpt_id { + return None; + } + } cursor.next_excerpt(); } })