From 3c57a4071cd3e3400a1e0b3329fccb0f0477e1ea Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 19 Nov 2024 20:00:11 -0700 Subject: [PATCH] vim: Fix jj to exit insert mode (#20890) Release Notes: - (Preview only) fixed binding `jj` to exit insert mode --- 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 9a028c1f01dd54734f1bfb1810be2a0d08c559ee..ec1fd601ecb6e72453ac14a703d950baf5f44a54 100644 --- a/crates/gpui/src/window.rs +++ b/crates/gpui/src/window.rs @@ -3038,7 +3038,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); @@ -3482,7 +3482,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)