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:
Antonio Scandurra 2022-02-25 18:30:04 +01:00
parent 7123407f42
commit e278c423d3
5 changed files with 15 additions and 14 deletions

View file

@ -28,7 +28,7 @@ use std::{
sync::Arc,
};
use util::TryFutureExt;
use workspace::{ItemNavHistory, ItemViewHandle as _, Workspace};
use workspace::{ItemHandle, ItemNavHistory, ItemViewHandle as _, Workspace};
action!(Deploy);
action!(OpenExcerpts);
@ -536,8 +536,8 @@ impl workspace::Item for ProjectDiagnostics {
}
impl workspace::ItemView for ProjectDiagnosticsEditor {
fn item_id(&self, _: &AppContext) -> usize {
self.model.id()
fn item(&self, _: &AppContext) -> Box<dyn ItemHandle> {
Box::new(self.model.clone())
}
fn tab_content(&self, style: &theme::Tab, _: &AppContext) -> ElementBox {