Reveal in files instead of Finder (#13432)

fixes: #12776 

Release Notes:

- Renamed `editor::RevealInFinder` to `editor::RevealInFileManager`

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
francesco-gaglione 2024-07-09 20:54:14 +02:00 committed by GitHub
parent f44e81b3b5
commit 2dd486733b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 38 additions and 21 deletions

View file

@ -296,8 +296,8 @@
"ctrl-shift-]": "editor::UnfoldLines",
"ctrl-space": "editor::ShowCompletions",
"ctrl-.": "editor::ToggleCodeActions",
"alt-ctrl-r": "editor::RevealInFinder",
"ctrl-k r": "editor::RevealInFinder",
"alt-ctrl-r": "editor::RevealInFileManager",
"ctrl-k r": "editor::RevealInFileManager",
"ctrl-k p": "editor::CopyPath",
"ctrl-\\": "pane::SplitRight",
"ctrl-k v": "markdown::OpenPreviewToTheSide",
@ -507,7 +507,7 @@
"right": "outline_panel::ExpandSelectedEntry",
"ctrl-alt-c": "outline_panel::CopyPath",
"alt-ctrl-shift-c": "outline_panel::CopyRelativePath",
"alt-ctrl-r": "outline_panel::RevealInFinder",
"alt-ctrl-r": "outline_panel::RevealInFileManager",
"space": "outline_panel::Open",
"shift-down": "menu::SelectNext",
"shift-up": "menu::SelectPrev"
@ -534,7 +534,7 @@
"delete": ["project_panel::Trash", { "skip_prompt": false }],
"ctrl-backspace": ["project_panel::Delete", { "skip_prompt": false }],
"ctrl-delete": ["project_panel::Delete", { "skip_prompt": false }],
"alt-ctrl-r": "project_panel::RevealInFinder",
"alt-ctrl-r": "project_panel::RevealInFileManager",
"alt-shift-f": "project_panel::NewSearchInDirectory",
"shift-down": "menu::SelectNext",
"shift-up": "menu::SelectPrev",

View file

@ -336,8 +336,8 @@
"alt-cmd-]": "editor::UnfoldLines",
"ctrl-space": "editor::ShowCompletions",
"cmd-.": "editor::ToggleCodeActions",
"alt-cmd-r": "editor::RevealInFinder",
"cmd-k r": "editor::RevealInFinder",
"alt-cmd-r": "editor::RevealInFileManager",
"cmd-k r": "editor::RevealInFileManager",
"cmd-k p": "editor::CopyPath",
"cmd-\\": "pane::SplitRight",
"cmd-k v": "markdown::OpenPreviewToTheSide",
@ -528,7 +528,7 @@
"right": "outline_panel::ExpandSelectedEntry",
"cmd-alt-c": "outline_panel::CopyPath",
"alt-cmd-shift-c": "outline_panel::CopyRelativePath",
"alt-cmd-r": "outline_panel::RevealInFinder",
"alt-cmd-r": "outline_panel::RevealInFileManager",
"space": "outline_panel::Open",
"shift-down": "menu::SelectNext",
"shift-up": "menu::SelectPrev"
@ -553,8 +553,9 @@
"delete": ["project_panel::Trash", { "skip_prompt": false }],
"cmd-backspace": ["project_panel::Trash", { "skip_prompt": true }],
"cmd-delete": ["project_panel::Delete", { "skip_prompt": false }],
"alt-cmd-r": "project_panel::RevealInFileManager",
"cmd-alt-backspace": ["project_panel::Delete", { "skip_prompt": false }],
"alt-cmd-r": "project_panel::RevealInFinder",
"alt-shift-f": "project_panel::NewSearchInDirectory",
"shift-down": "menu::SelectNext",
"shift-up": "menu::SelectPrev",

View file

@ -504,7 +504,7 @@
"t": "project_panel::OpenPermanent",
"v": "project_panel::OpenPermanent",
"p": "project_panel::Open",
"x": "project_panel::RevealInFinder",
"x": "project_panel::RevealInFileManager",
"shift-g": "menu::SelectLast",
"g g": "menu::SelectFirst",
"-": "project_panel::SelectParent"

View file

@ -258,7 +258,7 @@ gpui::actions!(
RedoSelection,
Rename,
RestartLanguageServer,
RevealInFinder,
RevealInFileManager,
ReverseLines,
RevertSelectedHunks,
ScrollCursorBottom,

View file

@ -10333,7 +10333,7 @@ impl Editor {
cx.notify();
}
pub fn reveal_in_finder(&mut self, _: &RevealInFinder, cx: &mut ViewContext<Self>) {
pub fn reveal_in_finder(&mut self, _: &RevealInFileManager, cx: &mut ViewContext<Self>) {
if let Some(buffer) = self.buffer().read(cx).as_singleton() {
if let Some(file) = buffer.read(cx).file().and_then(|f| f.as_local()) {
cx.reveal_path(&file.abs_path(cx));

View file

@ -3,9 +3,10 @@ use std::ops::Range;
use crate::{
selections_collection::SelectionsCollection, Copy, CopyPermalinkToLine, Cut, DisplayPoint,
DisplaySnapshot, Editor, EditorMode, FindAllReferences, GoToDefinition, GoToImplementation,
GoToTypeDefinition, Paste, Rename, RevealInFinder, SelectMode, ToDisplayPoint,
GoToTypeDefinition, Paste, Rename, RevealInFileManager, SelectMode, ToDisplayPoint,
ToggleCodeActions,
};
use gpui::prelude::FluentBuilder;
use gpui::{DismissEvent, Pixels, Point, Subscription, View, ViewContext};
use workspace::OpenInTerminal;
@ -113,7 +114,12 @@ pub fn deploy_context_menu(
.action("Copy", Box::new(Copy))
.action("Paste", Box::new(Paste))
.separator()
.action("Reveal in Finder", Box::new(RevealInFinder))
.when(cfg!(target_os = "macos"), |builder| {
builder.action("Reveal in Finder", Box::new(RevealInFileManager))
})
.when(cfg!(not(target_os = "macos")), |builder| {
builder.action("Reveal in File Manager", Box::new(RevealInFileManager))
})
.action("Open in Terminal", Box::new(OpenInTerminal))
.action("Copy Permalink", Box::new(CopyPermalinkToLine));
match focus {

View file

@ -57,7 +57,7 @@ actions!(
CollapseAllEntries,
CopyPath,
CopyRelativePath,
RevealInFinder,
RevealInFileManager,
Open,
ToggleFocus,
UnfoldDirectory,
@ -796,7 +796,12 @@ impl OutlinePanel {
let context_menu = ContextMenu::build(cx, |menu, _| {
menu.context(self.focus_handle.clone())
.action("Reveal in Finder", Box::new(RevealInFinder))
.when(cfg!(target_os = "macos"), |menu| {
menu.action("Reveal in Finder", Box::new(RevealInFileManager))
})
.when(cfg!(not(target_os = "macos")), |menu| {
menu.action("Reveal in File Manager", Box::new(RevealInFileManager))
})
.action("Open in Terminal", Box::new(OpenInTerminal))
.when(is_unfoldable, |menu| {
menu.action("Unfold Directory", Box::new(UnfoldDirectory))
@ -1079,7 +1084,7 @@ impl OutlinePanel {
}
}
fn reveal_in_finder(&mut self, _: &RevealInFinder, cx: &mut ViewContext<Self>) {
fn reveal_in_finder(&mut self, _: &RevealInFileManager, cx: &mut ViewContext<Self>) {
if let Some(abs_path) = self
.selected_entry
.as_ref()

View file

@ -137,7 +137,7 @@ actions!(
CopyPath,
CopyRelativePath,
Duplicate,
RevealInFinder,
RevealInFileManager,
Cut,
Paste,
Rename,
@ -477,7 +477,12 @@ impl ProjectPanel {
menu.action("New File", Box::new(NewFile))
.action("New Folder", Box::new(NewDirectory))
.separator()
.action("Reveal in Finder", Box::new(RevealInFinder))
.when(cfg!(target_os = "macos"), |menu| {
menu.action("Reveal in Finder", Box::new(RevealInFileManager))
})
.when(cfg!(not(target_os = "macos")), |menu| {
menu.action("Reveal in File Manager", Box::new(RevealInFileManager))
})
.action("Open in Terminal", Box::new(OpenInTerminal))
.when(is_dir, |menu| {
menu.separator()
@ -1353,7 +1358,7 @@ impl ProjectPanel {
}
}
fn reveal_in_finder(&mut self, _: &RevealInFinder, cx: &mut ViewContext<Self>) {
fn reveal_in_finder(&mut self, _: &RevealInFileManager, cx: &mut ViewContext<Self>) {
if let Some((worktree, entry)) = self.selected_entry(cx) {
cx.reveal_path(&worktree.abs_path().join(&entry.path));
}

View file

@ -267,7 +267,7 @@ See the [tasks documentation](/docs/tasks#custom-keybindings-for-tasks) for more
| Redo | Editor | `⌘ + Shift + Z` |
| Redo selection | Editor | `⌘ + Shift + U` |
| Rename | Editor | `F2` |
| Reveal in finder | Editor | `Alt + ⌘ + R` |
| Reveal in File Manager | Editor | `Alt + ⌘ + R` |
| Revert selected hunks | Editor | `⌘ + Alt + Z` |
| Select all | Editor | `⌘ + A` |
| Select all matches | Editor | `⌘ + Shift + L` |
@ -483,7 +483,7 @@ See the [tasks documentation](/docs/tasks#custom-keybindings-for-tasks) for more
| Paste | Project Panel | `⌘ + V` |
| Rename | Project Panel | `Enter` |
| Rename | Project Panel | `F2` |
| Reveal in finder | Project Panel | `Alt + ⌘ + R` |
| Reveal in File Manager | Project Panel | `Alt + ⌘ + R` |
#### Project Search Bar