-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Input Method (IME) fails to receive 'j' when 'j k' mapping is active in insertmode #36610
Copy link
Copy link
Closed
Copy link
Labels
area:controls/imearea:editorFeedback for code editing, formatting, editor iterations, etcFeedback for code editing, formatting, editor iterations, etcarea:internationalizationFeedback for human language support, translations, etcFeedback for human language support, translations, etcarea:parity/vimFeedback for Vim parity featuresFeedback for Vim parity featuresfrequency:uncommonBugs that happen for a small subset of users, special configurations, rare circumstances, etcBugs that happen for a small subset of users, special configurations, rare circumstances, etcpriority:P3Papercuts, minor issues with a clear workaround, cosmetic bugsPapercuts, minor issues with a clear workaround, cosmetic bugsstate:needs reproNeeds reproduction steps and/or someone to reproduceNeeds reproduction steps and/or someone to reproduce
Metadata
Metadata
Assignees
Labels
area:controls/imearea:editorFeedback for code editing, formatting, editor iterations, etcFeedback for code editing, formatting, editor iterations, etcarea:internationalizationFeedback for human language support, translations, etcFeedback for human language support, translations, etcarea:parity/vimFeedback for Vim parity featuresFeedback for Vim parity featuresfrequency:uncommonBugs that happen for a small subset of users, special configurations, rare circumstances, etcBugs that happen for a small subset of users, special configurations, rare circumstances, etcpriority:P3Papercuts, minor issues with a clear workaround, cosmetic bugsPapercuts, minor issues with a clear workaround, cosmetic bugsstate:needs reproNeeds reproduction steps and/or someone to reproduceNeeds reproduction steps and/or someone to reproduce
Type
Fields
Give feedbackNo fields configured for Bug.
Summary
When using an Input Method Editor (IME) for Chinese (or other CJK languages), typing a letter like
jto start a composition (e.g., typing pinyin "jiang") fails to register the initialjif a keybinding likej kis configured to triggervim::NormalBefore.Zed Version and System Specs
🐞 GitHub Issue: Input Method (IME) fails to receive 'j' when 'j k' mapping is active in insert mode
Describe the bug
When using an Input Method Editor (IME) for Chinese (or other CJK languages), typing a letter like
jto start a composition (e.g., typing pinyin "jiang") fails to register the initialjif a keybinding likej kis configured to triggervim::NormalBefore.This happens because Zed's keybinding system intercepts the
jpress immediately, waiting for a potentialkto complete the chord, even during IME composition (compositionstart). As a result:j.j.j-prefixed chords are used.This issue occurs in both insert mode and visual mode when the following keybindings are set.
To Reproduce
{ "context": "Editor && vim_mode == insert", "bindings": { "j k": "vim::NormalBefore" } }, { "context": "Editor && vim_mode == visual", "bindings": { "j k": "vim::NormalBefore" } }j, intending to type a word like "你好" via pinyin (e.g.,ni hao, or starting withjia).jdoes not appear in the IME candidate window.kis pressed next.Expected Behavior
compositionstart), key chords likej kshould be ignored or deferred.jkey should be passed to the IME to begin composition.Actual Behavior
jkey is consumed by the keybinding system.j.Workarounds
k j,f d,jj).j,q,x,z,c,s) as the first key in a chord.Escinstead of a chord (recommended for IME users).Possible Fix (Suggestion)
Zed should detect when an IME is active (
compositionstartevent) and:compositionend.This is consistent with how other editors (e.g., VS Code, Neovim with
:help iminsert) handle IME + keybinding conflicts.Environment
Additional Context
This is a critical usability issue for non-English Vim users relying on IMEs. While changing the chord helps, the editor should respect IME semantics by default.