From beeaec8647787ee128f498b1c4ce8470b65bef34 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 21 Jul 2022 12:48:36 -0700 Subject: [PATCH] Prevent IME window from appearing while editor's input is disabled (vim) --- crates/editor/src/editor.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index fdcbb875226e3f01f2b13941fa38b58409fe3bb8..7118f3c0ff6859de9572ab85279561a441b8eeff 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -5888,6 +5888,12 @@ impl View for Editor { } fn selected_text_range(&self, cx: &AppContext) -> Option> { + // Prevent the IME menu from appearing when holding down an alphabetic key + // while input is disabled. + if !self.input_enabled { + return None; + } + let range = self.selections.newest::(cx).range(); Some(range.start.0..range.end.0) }