From c4a382d7cb93f5fbd3e9bc0821dfb6f74fc64de9 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:04:52 -0700 Subject: [PATCH] vim: Fix jj to exit insert mode (cherry-pick #20890) (#20891) Cherry-picked vim: Fix jj to exit insert mode (#20890) Release Notes: - (Preview only) fixed binding `jj` to exit insert mode Co-authored-by: Conrad Irwin --- crates/gpui/src/window.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs index ba974567a6ce518db1b57a32cd69250d4f3b4a06..80a2dbe6c70f48e5689dfec69bfa16d555ab4ccd 100644 --- a/crates/gpui/src/window.rs +++ b/crates/gpui/src/window.rs @@ -3043,7 +3043,7 @@ impl<'a> WindowContext<'a> { return true; } - if let Some(input) = keystroke.ime_key { + if let Some(input) = keystroke.with_simulated_ime().ime_key { if let Some(mut input_handler) = self.window.platform_window.take_input_handler() { input_handler.dispatch_input(&input, self); self.window.platform_window.set_input_handler(input_handler); @@ -3467,7 +3467,13 @@ impl<'a> WindowContext<'a> { if !self.propagate_event { continue 'replay; } - if let Some(input) = replay.keystroke.ime_key.as_ref().cloned() { + if let Some(input) = replay + .keystroke + .with_simulated_ime() + .ime_key + .as_ref() + .cloned() + { if let Some(mut input_handler) = self.window.platform_window.take_input_handler() { input_handler.dispatch_input(&input, self); self.window.platform_window.set_input_handler(input_handler)