diff --git a/assets/keymaps/default-linux.json b/assets/keymaps/default-linux.json index e060363a32..560ea88ab7 100644 --- a/assets/keymaps/default-linux.json +++ b/assets/keymaps/default-linux.json @@ -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", diff --git a/assets/keymaps/default-macos.json b/assets/keymaps/default-macos.json index b764ac0986..9f5c834501 100644 --- a/assets/keymaps/default-macos.json +++ b/assets/keymaps/default-macos.json @@ -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", diff --git a/assets/keymaps/vim.json b/assets/keymaps/vim.json index 0e98636e41..87ae91925a 100644 --- a/assets/keymaps/vim.json +++ b/assets/keymaps/vim.json @@ -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" diff --git a/crates/editor/src/actions.rs b/crates/editor/src/actions.rs index 293d9da719..d0d7d912ee 100644 --- a/crates/editor/src/actions.rs +++ b/crates/editor/src/actions.rs @@ -258,7 +258,7 @@ gpui::actions!( RedoSelection, Rename, RestartLanguageServer, - RevealInFinder, + RevealInFileManager, ReverseLines, RevertSelectedHunks, ScrollCursorBottom, diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 4f3eb7d257..a02891e622 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -10333,7 +10333,7 @@ impl Editor { cx.notify(); } - pub fn reveal_in_finder(&mut self, _: &RevealInFinder, cx: &mut ViewContext) { + pub fn reveal_in_finder(&mut self, _: &RevealInFileManager, cx: &mut ViewContext) { 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)); diff --git a/crates/editor/src/mouse_context_menu.rs b/crates/editor/src/mouse_context_menu.rs index a9449762f8..56645ee255 100644 --- a/crates/editor/src/mouse_context_menu.rs +++ b/crates/editor/src/mouse_context_menu.rs @@ -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 { diff --git a/crates/outline_panel/src/outline_panel.rs b/crates/outline_panel/src/outline_panel.rs index 839c965840..acda4ee668 100644 --- a/crates/outline_panel/src/outline_panel.rs +++ b/crates/outline_panel/src/outline_panel.rs @@ -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) { + fn reveal_in_finder(&mut self, _: &RevealInFileManager, cx: &mut ViewContext) { if let Some(abs_path) = self .selected_entry .as_ref() diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index 0751b926cf..ab0a30b2d7 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -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) { + fn reveal_in_finder(&mut self, _: &RevealInFileManager, cx: &mut ViewContext) { if let Some((worktree, entry)) = self.selected_entry(cx) { cx.reveal_path(&worktree.abs_path().join(&entry.path)); } diff --git a/docs/src/key-bindings.md b/docs/src/key-bindings.md index fcec763734..aeff577c39 100644 --- a/docs/src/key-bindings.md +++ b/docs/src/key-bindings.md @@ -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