From 7462e74fbfc3f0f622fdc7d1f6936807fc42946a Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 26 Mar 2025 12:28:32 +0200 Subject: [PATCH] Improve `editor::CopyAndTrim` action's discoverability (#27484) Follow-up of https://github.com/zed-industries/zed/pull/27206 Add it to the editor context menu and Zed's app menu near the `Copy` action. Release Notes: - N/A --- crates/editor/src/mouse_context_menu.rs | 2 ++ crates/zed/src/zed/app_menus.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/crates/editor/src/mouse_context_menu.rs b/crates/editor/src/mouse_context_menu.rs index 8d77dda799..3148e03084 100644 --- a/crates/editor/src/mouse_context_menu.rs +++ b/crates/editor/src/mouse_context_menu.rs @@ -1,4 +1,5 @@ use crate::actions::FormatSelections; +use crate::CopyAndTrim; use crate::{ actions::Format, selections_collection::SelectionsCollection, Copy, CopyPermalinkToLine, Cut, DisplayPoint, DisplaySnapshot, Editor, EditorMode, FindAllReferences, GoToDeclaration, @@ -191,6 +192,7 @@ pub fn deploy_context_menu( .separator() .action("Cut", Box::new(Cut)) .action("Copy", Box::new(Copy)) + .action("Copy and trim", Box::new(CopyAndTrim)) .action("Paste", Box::new(Paste)) .separator() .map(|builder| { diff --git a/crates/zed/src/zed/app_menus.rs b/crates/zed/src/zed/app_menus.rs index ed590e9c24..ec310ebe11 100644 --- a/crates/zed/src/zed/app_menus.rs +++ b/crates/zed/src/zed/app_menus.rs @@ -95,6 +95,7 @@ pub fn app_menus() -> Vec { MenuItem::separator(), MenuItem::os_action("Cut", editor::actions::Cut, OsAction::Cut), MenuItem::os_action("Copy", editor::actions::Copy, OsAction::Copy), + MenuItem::action("Copy and trim", editor::actions::CopyAndTrim), MenuItem::os_action("Paste", editor::actions::Paste, OsAction::Paste), MenuItem::separator(), MenuItem::action("Find", search::buffer_search::Deploy::find()),