From 9463ca778fe406de06c3a7eed2a3797c13db426d Mon Sep 17 00:00:00 2001 From: Jonathan Talcott Date: Wed, 28 Jan 2026 21:41:34 -0500 Subject: [PATCH 1/2] Added undo and redo implementations for Windows --- src/platform_impl/windows/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/platform_impl/windows/mod.rs b/src/platform_impl/windows/mod.rs index 9f736262..d33751d4 100644 --- a/src/platform_impl/windows/mod.rs +++ b/src/platform_impl/windows/mod.rs @@ -1203,6 +1203,8 @@ unsafe fn menu_selected(hwnd: windows_sys::Win32::Foundation::HWND, item: &mut M PredefinedMenuItemType::SelectAll => { execute_edit_command(EditCommand::SelectAll) } + PredefinedMenuItemType::Undo => execute_edit_command(EditCommand::Undo), + PredefinedMenuItemType::Redo => execute_edit_command(EditCommand::Redo), PredefinedMenuItemType::Separator => {} PredefinedMenuItemType::Minimize => { ShowWindow(hwnd, SW_MINIMIZE); @@ -1253,6 +1255,8 @@ enum EditCommand { Cut, Paste, SelectAll, + Undo, + Redo, } fn execute_edit_command(command: EditCommand) { @@ -1261,6 +1265,8 @@ fn execute_edit_command(command: EditCommand) { EditCommand::Cut => 0x58, // x EditCommand::Paste => 0x56, // v EditCommand::SelectAll => 0x41, // a + EditCommand::Undo => 0x5A, // z + EditCommand::Redo => 0x59, // y }; unsafe { From f03c4cdd0c0dcbe1e94818fb3a08d478415da73c Mon Sep 17 00:00:00 2001 From: Jonathan Talcott Date: Wed, 28 Jan 2026 21:48:55 -0500 Subject: [PATCH 2/2] Update comments to reflect changes --- src/items/predefined.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/items/predefined.rs b/src/items/predefined.rs index 8ed4a342..78c66ac9 100644 --- a/src/items/predefined.rs +++ b/src/items/predefined.rs @@ -63,7 +63,7 @@ impl PredefinedMenuItem { /// /// ## Platform-specific: /// - /// - **Windows / Linux:** Unsupported. + /// - **Linux:** Unsupported. pub fn undo(text: Option<&str>) -> PredefinedMenuItem { PredefinedMenuItem::new(PredefinedMenuItemType::Undo, text) } @@ -71,7 +71,7 @@ impl PredefinedMenuItem { /// /// ## Platform-specific: /// - /// - **Windows / Linux:** Unsupported. + /// - **Linux:** Unsupported. pub fn redo(text: Option<&str>) -> PredefinedMenuItem { PredefinedMenuItem::new(PredefinedMenuItemType::Redo, text) }