gpui: Fix Vim jj keybinding intercepting j key from IME on macOS#52192
gpui: Fix Vim jj keybinding intercepting j key from IME on macOS#52192ConradIrwin merged 8 commits intozed-industries:mainfrom
Conversation
MacOS: Vim jj keybinding intercepts j key from CJK IME
|
We require contributors to sign our Contributor License Agreement, and we don't have @kouphasi on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0013f1bfa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Amazing! Thanks for picking this up, it's been a much complained about bug. |
|
Can you please make the linter happy? |
I've fixed it! |
|
@kouphasi I’m using the Rime input method. I can’t trigger the jj key combo when in English mode. |
Fixes
close: #28174
close: #30393
close: #36610
close: #38616
(not closing related issues: #31819, #21136)
Context
There was an issue where CJK input could not be entered correctly when certain keys used during IME composition conflicted with custom keybindings while the CJK IME was enabled.
(In particular, in Vim mode, the
jjkeybinding in INSERT MODE could not be entered correctly.)This issue had already been fixed on Windows, but not on macOS (and judging from the code, it is likely also present on Linux, although this has not been verified).
In this change, we aligned the behavior with Windows.
Currently, on Windows, when the CJK ( or other ) IME is enabled, IME input is prioritized.
Following this behavior, we updated macOS to also prioritize IME input.
KeyboardInputModefalsetrueKeyboardInputModetruefalseKeyboardInputModefalsetrueKeyboardInputModefalsetrueKeyboardLayoutfalsefalseKeyboardLayoutfalsefalseKeyboardLayouttruefalse(Since similar approaches are used in tools like Vim and Neovim, we consider this policy to be appropriate.)
Videos
before fix
before.mp4
after fix
after2.mp4
How to Review
This change modifies the gpui layer rather than Zed itself, so please verify the behavior at the gpui level, not just within Zed.
Self-Review Checklist
Release Notes:
jj