Don't assume that cloning on split will reuse the same underlying model
Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
parent
7123407f42
commit
e278c423d3
5 changed files with 15 additions and 14 deletions
|
@ -158,11 +158,11 @@ impl WeakItemHandle for WeakMultiBufferItemHandle {
|
|||
}
|
||||
|
||||
impl ItemView for Editor {
|
||||
fn item_id(&self, cx: &AppContext) -> usize {
|
||||
fn item(&self, cx: &AppContext) -> Box<dyn ItemHandle> {
|
||||
if let Some(buffer) = self.buffer.read(cx).as_singleton() {
|
||||
buffer.id()
|
||||
Box::new(BufferItemHandle(buffer))
|
||||
} else {
|
||||
self.buffer.id()
|
||||
Box::new(MultiBufferItemHandle(self.buffer.clone()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue