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

Release Notes:

- Fixed a bug causing slowness when viewing multi buffers with lots of
excerpts
This commit is contained in:
Max Brunsfeld 2025-03-06 16:25:27 -08:00 committed by GitHub
parent 349a48d937
commit 40c62cda5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();
}
})