From e175878008d7de282e34864b83ffde6c0a9f7fd7 Mon Sep 17 00:00:00 2001 From: Smit Barmase Date: Tue, 11 Mar 2025 13:12:02 +0000 Subject: [PATCH] macOS: Remove multi-keystroke rendering in title of menu item (#26448) Closes #25483 Currently, macOS doesn't support showing multi-keystroke shortcuts in menu items. We can use an attributed string to differentiate them, but that breaks consistency with traditional shortcuts. This PR removes the hack of concatenating the multi-keystroke shortcut to the title, as it looked a bit janky. Release Notes: - N/A --- crates/gpui/src/platform/mac/platform.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/crates/gpui/src/platform/mac/platform.rs b/crates/gpui/src/platform/mac/platform.rs index a678c778961817cc41e13e8e7e8c42da15a3f4bd..edc8fdfea294b16598e5b8be88407c824633709f 100644 --- a/crates/gpui/src/platform/mac/platform.rs +++ b/crates/gpui/src/platform/mac/platform.rs @@ -347,20 +347,7 @@ impl MacPlatform { msg_send![item, setAllowsAutomaticKeyEquivalentLocalization: NO]; } item.setKeyEquivalentModifierMask_(mask); - } - // For multi-keystroke bindings, render the keystroke as part of the title. - else { - use std::fmt::Write; - - let mut name = format!("{name} ["); - for (i, keystroke) in keystrokes.iter().enumerate() { - if i > 0 { - name.push(' '); - } - write!(&mut name, "{}", keystroke).unwrap(); - } - name.push(']'); - + } else { item = NSMenuItem::alloc(nil) .initWithTitle_action_keyEquivalent_( ns_string(&name),