diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index 8b830513b2c..8b23423a973 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -6015,6 +6015,16 @@ impl ProjectPanel { } }), ) + .on_aux_click( + cx.listener(move |project_panel, event: &gpui::ClickEvent, _, cx| { + if !event.is_middle_click() || show_editor || !kind.is_file() { + return; + } + + project_panel.open_entry(entry_id, true, false, cx); + cx.stop_propagation(); + }), + ) .child( ListItem::new(id) .indent_level(depth) diff --git a/docs/src/project-panel.md b/docs/src/project-panel.md index afee88bbf36..030177af8f6 100644 --- a/docs/src/project-panel.md +++ b/docs/src/project-panel.md @@ -21,6 +21,8 @@ project_panel::CollapseAllEntries} collapses every directory at once. {#kb project_panel::ExpandAllEntries} expands every directory at once. Press {#kb project_panel::Open} or click to preview a selected file, without giving it a permanent tab. Editing the file or double-clicking it promotes it to a permanent tab. +Middle-clicking a file skips the preview and opens it in a permanent, focused tab +right away. ### Auto-reveal