Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add missing panels to View menu (#60356)

Dino3cbe4c298e78
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs
index 590efaca2b7..d20065cc6ca 100644
--- a/crates/git_ui/src/git_panel.rs
+++ b/crates/git_ui/src/git_panel.rs
@@ -93,7 +93,9 @@ use workspace::{
dock::{DockPosition, Panel, PanelEvent},
notifications::{DetachAndPromptErr, NotificationId, NotifyTaskExt},
};
-use zed_actions::{DecreaseBufferFontSize, IncreaseBufferFontSize, ResetBufferFontSize};
+use zed_actions::{
+ DecreaseBufferFontSize, IncreaseBufferFontSize, ResetBufferFontSize, git_panel::ToggleFocus,
+};
const GIT_PANEL_KEY: &str = "GitPanel";
const UPDATE_DEBOUNCE: Duration = Duration::from_millis(50);
@@ -110,8 +112,6 @@ actions!(
Close,
/// Toggles the git panel.
Toggle,
- /// Toggles focus on the git panel.
- ToggleFocus,
/// Opens the git panel menu.
OpenMenu,
/// Focuses on the commit message editor.
diff --git a/crates/zed/src/zed/app_menus.rs b/crates/zed/src/zed/app_menus.rs
index 29a06747f9e..bb1f3ee7aa1 100644
--- a/crates/zed/src/zed/app_menus.rs
+++ b/crates/zed/src/zed/app_menus.rs
@@ -2,11 +2,9 @@ use collab_ui::collab_panel;
use gpui::{App, Menu, MenuItem, OsAction};
use release_channel::ReleaseChannel;
use terminal_view::terminal_panel;
-use zed_actions::{debug_panel, dev};
+use zed_actions::{Quit, assistant, debug_panel, dev, git_panel, project_panel};
pub fn app_menus(cx: &mut App) -> Vec<Menu> {
- use zed_actions::Quit;
-
let mut view_items = vec![
MenuItem::action(
"Zoom In",
@@ -40,11 +38,13 @@ pub fn app_menus(cx: &mut App) -> Vec<Menu> {
],
}),
MenuItem::separator(),
- MenuItem::action("Project Panel", zed_actions::project_panel::ToggleFocus),
+ MenuItem::action("Project Panel", project_panel::ToggleFocus),
MenuItem::action("Outline Panel", outline_panel::ToggleFocus),
MenuItem::action("Collab Panel", collab_panel::ToggleFocus),
- MenuItem::action("Terminal Panel", terminal_panel::ToggleFocus),
+ MenuItem::action("Terminal Panel", terminal_panel::Toggle),
MenuItem::action("Debugger Panel", debug_panel::ToggleFocus),
+ MenuItem::action("Agent Panel", assistant::ToggleFocus),
+ MenuItem::action("Git Panel", git_panel::ToggleFocus),
MenuItem::separator(),
MenuItem::action("Diagnostics", diagnostics::Deploy),
MenuItem::separator(),
diff --git a/crates/zed_actions/src/lib.rs b/crates/zed_actions/src/lib.rs
index c70e8d3273c..12b34def15c 100644
--- a/crates/zed_actions/src/lib.rs
+++ b/crates/zed_actions/src/lib.rs
@@ -947,3 +947,15 @@ pub mod notebook {
]
);
}
+
+pub mod git_panel {
+ use gpui::actions;
+
+ actions!(
+ git_panel,
+ [
+ /// Toggles focus on the git panel.
+ ToggleFocus,
+ ]
+ );
+}