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 `Format Buffer` action to mouse context menu (#16080)

Ihnat12dda5fa1b94
diff --git a/crates/editor/src/mouse_context_menu.rs b/crates/editor/src/mouse_context_menu.rs
index 9c8cf85dda7..113035c8632 100644
--- a/crates/editor/src/mouse_context_menu.rs
+++ b/crates/editor/src/mouse_context_menu.rs
@@ -1,11 +1,10 @@
use std::ops::Range;
-use crate::GoToDeclaration;
use crate::{
- selections_collection::SelectionsCollection, Copy, CopyPermalinkToLine, Cut, DisplayPoint,
- DisplaySnapshot, Editor, EditorMode, FindAllReferences, GoToDefinition, GoToImplementation,
- GoToTypeDefinition, Paste, Rename, RevealInFileManager, SelectMode, ToDisplayPoint,
- ToggleCodeActions,
+ actions::Format, selections_collection::SelectionsCollection, Copy, CopyPermalinkToLine, Cut,
+ DisplayPoint, DisplaySnapshot, Editor, EditorMode, FindAllReferences, GoToDeclaration,
+ GoToDefinition, GoToImplementation, GoToTypeDefinition, Paste, Rename, RevealInFileManager,
+ SelectMode, ToDisplayPoint, ToggleCodeActions,
};
use gpui::prelude::FluentBuilder;
use gpui::{DismissEvent, Pixels, Point, Subscription, View, ViewContext};
@@ -174,6 +173,7 @@ pub fn deploy_context_menu(
deployed_from_indicator: None,
}),
)
+ .action("Format Buffer", Box::new(Format))
.separator()
.action("Cut", Box::new(Cut))
.action("Copy", Box::new(Copy))