mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-24 17:28:40 +00:00
pane: Add "Reveal In File Manager" action to context menu
This commit is contained in:
parent
19641d4c98
commit
d2321fc966
1 changed files with 20 additions and 0 deletions
|
@ -144,6 +144,10 @@ pub struct RevealInProjectPanel {
|
|||
pub entry_id: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize, Default)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct RevealInFileManager {}
|
||||
|
||||
#[derive(Default, PartialEq, Clone, Deserialize)]
|
||||
pub struct DeploySearch {
|
||||
#[serde(default)]
|
||||
|
@ -161,6 +165,7 @@ impl_actions!(
|
|||
CloseInactiveItems,
|
||||
ActivateItem,
|
||||
RevealInProjectPanel,
|
||||
RevealInFileManager,
|
||||
DeploySearch,
|
||||
]
|
||||
);
|
||||
|
@ -2258,6 +2263,21 @@ impl Pane {
|
|||
}),
|
||||
)
|
||||
})
|
||||
.when_some(parent_abs_path.clone(), |menu, parent_abs_path| {
|
||||
let reveal_in_finder_label = if cfg!(target_os = "macos") {
|
||||
"Reveal in Finder"
|
||||
} else {
|
||||
"Reveal in File Manager"
|
||||
};
|
||||
|
||||
menu.entry(
|
||||
reveal_in_finder_label,
|
||||
Some(Box::new(RevealInFileManager {})),
|
||||
cx.handler_for(&pane, move |_, cx| {
|
||||
cx.reveal_path(&parent_abs_path);
|
||||
}),
|
||||
)
|
||||
})
|
||||
.when_some(parent_abs_path, |menu, parent_abs_path| {
|
||||
menu.entry(
|
||||
"Open in Terminal",
|
||||
|
|
Loading…
Reference in a new issue