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
This commit is contained in:
Kirill Bulatov 2025-03-26 12:28:32 +02:00 committed by GitHub
parent de67d93a92
commit 7462e74fbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View file

@ -1,4 +1,5 @@
use crate::actions::FormatSelections; use crate::actions::FormatSelections;
use crate::CopyAndTrim;
use crate::{ use crate::{
actions::Format, selections_collection::SelectionsCollection, Copy, CopyPermalinkToLine, Cut, actions::Format, selections_collection::SelectionsCollection, Copy, CopyPermalinkToLine, Cut,
DisplayPoint, DisplaySnapshot, Editor, EditorMode, FindAllReferences, GoToDeclaration, DisplayPoint, DisplaySnapshot, Editor, EditorMode, FindAllReferences, GoToDeclaration,
@ -191,6 +192,7 @@ pub fn deploy_context_menu(
.separator() .separator()
.action("Cut", Box::new(Cut)) .action("Cut", Box::new(Cut))
.action("Copy", Box::new(Copy)) .action("Copy", Box::new(Copy))
.action("Copy and trim", Box::new(CopyAndTrim))
.action("Paste", Box::new(Paste)) .action("Paste", Box::new(Paste))
.separator() .separator()
.map(|builder| { .map(|builder| {

View file

@ -95,6 +95,7 @@ pub fn app_menus() -> Vec<Menu> {
MenuItem::separator(), MenuItem::separator(),
MenuItem::os_action("Cut", editor::actions::Cut, OsAction::Cut), MenuItem::os_action("Cut", editor::actions::Cut, OsAction::Cut),
MenuItem::os_action("Copy", editor::actions::Copy, OsAction::Copy), 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::os_action("Paste", editor::actions::Paste, OsAction::Paste),
MenuItem::separator(), MenuItem::separator(),
MenuItem::action("Find", search::buffer_search::Deploy::find()), MenuItem::action("Find", search::buffer_search::Deploy::find()),