feat: Add reveal in file manager to pane tab context menu

Add "Reveal in Finder/File Manager" option to tab right-click menu,
matching functionality available in project panel and editor.
This commit is contained in:
Ragul R 2025-08-14 15:19:56 +05:30
parent 23cd5b59b2
commit daaeac2732

View file

@ -205,6 +205,8 @@ actions!(
JoinAll,
/// Reopens the most recently closed item.
ReopenClosedItem,
/// Reveals the current file in the system file manager.
RevealInFileManager,
/// Splits the pane to the left.
SplitLeft,
/// Splits the pane upward.
@ -2750,7 +2752,7 @@ impl Pane {
let entry_id = entry.to_proto();
menu = menu
.separator()
.when_some(entry_abs_path, |menu, abs_path| {
.when_some(entry_abs_path.clone(), |menu, abs_path| {
menu.entry(
"Copy Path",
Some(Box::new(zed_actions::workspace::CopyPath)),
@ -2789,6 +2791,18 @@ impl Pane {
}),
)
})
.when_some(entry_abs_path, |menu, abs_path| {
menu.entry(
#[cfg(target_os = "macos")]
"Reveal in Finder",
#[cfg(not(target_os = "macos"))]
"Reveal in File Manager",
Some(Box::new(RevealInFileManager)),
window.handler_for(&pane, move |_pane, _window, cx| {
cx.reveal_path(&abs_path);
}),
)
})
.when_some(parent_abs_path, |menu, parent_abs_path| {
menu.entry(
"Open in Terminal",