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

@ -12,7 +12,7 @@ use std::{
ops::Range,
path::PathBuf,
};
use workspace::{Item, ItemNavHistory, ItemView, Settings, Workspace};
use workspace::{Item, ItemHandle, ItemNavHistory, ItemView, Settings, Workspace};
action!(Deploy);
action!(Search);
@ -223,8 +223,8 @@ impl ItemView for ProjectFindView {
.update(cx, |editor, cx| editor.deactivated(cx));
}
fn item_id(&self, _: &gpui::AppContext) -> usize {
self.model.id()
fn item(&self, _: &gpui::AppContext) -> Box<dyn ItemHandle> {
Box::new(self.model.clone())
}
fn tab_content(&self, style: &theme::Tab, _: &gpui::AppContext) -> ElementBox {