editor: Make blame and inline blame work for multibuffers (#37366)
Release Notes: - Added blame view and inline blame support for multi buffer editors --------- Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
co-authored by
Kirill Bulatov
parent
92283285ae
commit
c1ca7303a8
@@ -735,7 +735,7 @@ impl MultiBuffer {
|
||||
|
||||
pub fn as_singleton(&self) -> Option<Entity<Buffer>> {
|
||||
if self.singleton {
|
||||
return Some(
|
||||
Some(
|
||||
self.buffers
|
||||
.borrow()
|
||||
.values()
|
||||
@@ -743,7 +743,7 @@ impl MultiBuffer {
|
||||
.unwrap()
|
||||
.buffer
|
||||
.clone(),
|
||||
);
|
||||
)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
@@ -2552,6 +2552,10 @@ impl MultiBuffer {
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn all_buffer_ids(&self) -> Vec<BufferId> {
|
||||
self.buffers.borrow().keys().copied().collect()
|
||||
}
|
||||
|
||||
pub fn buffer(&self, buffer_id: BufferId) -> Option<Entity<Buffer>> {
|
||||
self.buffers
|
||||
.borrow()
|
||||
|
||||
Reference in New Issue
Block a user