diff --git a/crates/ui/src/components/keybinding.rs b/crates/ui/src/components/keybinding.rs index 76bd128ed80ada2d8a2606963943de3d5db2cc07..f8ac85528ec3317bb003d3f8763f8c57a7d4bba2 100644 --- a/crates/ui/src/components/keybinding.rs +++ b/crates/ui/src/components/keybinding.rs @@ -392,7 +392,7 @@ pub fn text_for_action(action: &dyn Action, window: &Window, cx: &App) -> Option pub fn text_for_keystrokes(keystrokes: &[Keystroke], cx: &App) -> String { let platform_style = PlatformStyle::platform(); - let vim_enabled = cx.try_global::().is_some(); + let vim_enabled = KeyBinding::is_vim_mode(cx); keystrokes .iter() .map(|keystroke| { @@ -408,7 +408,7 @@ pub fn text_for_keystrokes(keystrokes: &[Keystroke], cx: &App) -> String { pub fn text_for_keybinding_keystrokes(keystrokes: &[KeybindingKeystroke], cx: &App) -> String { let platform_style = PlatformStyle::platform(); - let vim_enabled = cx.try_global::().is_some(); + let vim_enabled = KeyBinding::is_vim_mode(cx); keystrokes .iter() .map(|keystroke| { @@ -424,8 +424,7 @@ pub fn text_for_keybinding_keystrokes(keystrokes: &[KeybindingKeystroke], cx: &A pub fn text_for_keystroke(modifiers: &Modifiers, key: &str, cx: &App) -> String { let platform_style = PlatformStyle::platform(); - let vim_enabled = cx.try_global::().is_some(); - keystroke_text(modifiers, key, platform_style, vim_enabled) + keystroke_text(modifiers, key, platform_style, KeyBinding::is_vim_mode(cx)) } /// Returns a textual representation of the given [`Keystroke`].