Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

workspace: Fix auto-reveal-in-project-panel for Images, Notebooks and.. Terminals? (#40128)

Piotr Osiewicz5c4649bd3742
diff --git a/crates/image_viewer/src/image_viewer.rs b/crates/image_viewer/src/image_viewer.rs
index 20f3be1045a..47a20ad58b7 100644
--- a/crates/image_viewer/src/image_viewer.rs
+++ b/crates/image_viewer/src/image_viewer.rs
@@ -188,6 +188,9 @@ impl Item for ImageView {
fn has_deleted_file(&self, cx: &App) -> bool {
self.image_item.read(cx).file.disk_state() == DiskState::Deleted
}
+ fn buffer_kind(&self, _: &App) -> workspace::item::ItemBufferKind {
+ workspace::item::ItemBufferKind::Singleton
+ }
}
fn breadcrumbs_text_for_image(project: &Project, image: &ImageItem, cx: &App) -> String {
diff --git a/crates/repl/src/notebook/notebook_ui.rs b/crates/repl/src/notebook/notebook_ui.rs
index 20b2bc62e00..6f92fe51152 100644
--- a/crates/repl/src/notebook/notebook_ui.rs
+++ b/crates/repl/src/notebook/notebook_ui.rs
@@ -716,6 +716,10 @@ impl Item for NotebookEditor {
Some(cx.new(|cx| Self::new(self.project.clone(), self.notebook_item.clone(), window, cx)))
}
+ fn buffer_kind(&self, _: &App) -> workspace::item::ItemBufferKind {
+ workspace::item::ItemBufferKind::Singleton
+ }
+
fn for_each_project_item(
&self,
cx: &App,
diff --git a/crates/terminal_view/src/terminal_view.rs b/crates/terminal_view/src/terminal_view.rs
index 0f4f745b877..e89e435b0c5 100644
--- a/crates/terminal_view/src/terminal_view.rs
+++ b/crates/terminal_view/src/terminal_view.rs
@@ -1211,6 +1211,10 @@ impl Item for TerminalView {
None
}
+ fn buffer_kind(&self, _: &App) -> workspace::item::ItemBufferKind {
+ workspace::item::ItemBufferKind::Singleton
+ }
+
fn clone_on_split(
&self,
workspace_id: Option<WorkspaceId>,