Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug where the IME pre-edit would desync from Zed #12651

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

mikayla-maki
Copy link
Contributor

@mikayla-maki mikayla-maki commented Jun 4, 2024

fixes #11829

In #7494, we introduced IME event buffering, so that we could preempt the IME with a keystroke event in some cases. However, this caused a desynchronization bug in long multi-step IME composition, such as the pre-edit used in the Japanese Romaji keyboard (and other languages). We found that this was due to the IME issuing actions, and then immediately querying the editor's state before we had applied those actions. Therefore, this PR removes IME action buffering.

We have tested all of the cases in the handle_key_event documentation and added a few of our own.

Release Notes:

  • Fixed an issue where the IME pre-edit could desynchronize from the editor on macOS (#11829)

…desync

from Zed's composer

co-authored-by: Jan Solanti <jhs@psonet.com>
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jun 4, 2024
@mikayla-maki mikayla-maki marked this pull request as ready for review June 4, 2024 18:48
@mikayla-maki mikayla-maki merged commit 1a0708f into main Jun 4, 2024
8 checks passed
@mikayla-maki mikayla-maki deleted the fix-ime-pre-edit branch June 4, 2024 19:17
SomeoneToIgnore added a commit that referenced this pull request Jun 5, 2024
SomeoneToIgnore added a commit that referenced this pull request Jun 5, 2024
…" (#12678)

This reverts commit 1a0708f since after
that, default task-related keybindings (alt-t and alt-shift-t) started
to leave `†` and `ˇ` symbols in the text editors before triggering
actions.


Release Notes:

- N/A
mikayla-maki added a commit that referenced this pull request Jun 5, 2024
Follow up to #12678
fixes #11829

In this solution, we only buffer Insert Text actions from the macOS IME.
The marked text and unmark actions are eagerly processed, so that the
IME state is synchronized with the editor state during multi step
pre-edit composition.

Release Notes:

- Fixed an issue where the IME pre-edit could desynchronize from the
editor on macOS
([#11829](#12651)).

Co-authored-by: Conrad <conrad@zed.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IME pre-edit is unusable on macOS
2 participants