Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix early return when reaching end excerpt in `lift_buffer_metadata` (#26253)

Max Brunsfeld40c62cda5fff
diff --git a/crates/multi_buffer/src/multi_buffer.rs b/crates/multi_buffer/src/multi_buffer.rs
index b578acd3036..1d7183532bf 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();
}
})