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.

editor: Add Cut, Copy, and Paste actions to the context menu (#11878)

Vitaly Slobodinf2e7c635ac36
diff --git a/crates/editor/src/mouse_context_menu.rs b/crates/editor/src/mouse_context_menu.rs
index 4f5abc4cec1..09cefc0de24 100644
--- a/crates/editor/src/mouse_context_menu.rs
+++ b/crates/editor/src/mouse_context_menu.rs
@@ -1,6 +1,7 @@
use crate::{
- DisplayPoint, Editor, EditorMode, FindAllReferences, GoToDefinition, GoToImplementation,
- GoToTypeDefinition, Rename, RevealInFinder, SelectMode, ToggleCodeActions,
+ Copy, Cut, DisplayPoint, Editor, EditorMode, FindAllReferences, GoToDefinition,
+ GoToImplementation, GoToTypeDefinition, Paste, Rename, RevealInFinder, SelectMode,
+ ToggleCodeActions,
};
use gpui::{DismissEvent, Pixels, Point, Subscription, View, ViewContext};
use workspace::OpenInTerminal;
@@ -85,6 +86,10 @@ pub fn deploy_context_menu(
}),
)
.separator()
+ .action("Cut", Box::new(Cut))
+ .action("Copy", Box::new(Copy))
+ .action("Paste", Box::new(Paste))
+ .separator()
.action("Reveal in Finder", Box::new(RevealInFinder))
.action("Open in Terminal", Box::new(OpenInTerminal));
match focus {