-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 IME delete misalignment #13348
Fix IME delete misalignment #13348
Conversation
This implementation might be wrong, the bug was introduced in #12702 , and this PR modified some other codes, thoughts? |
Get it. I'll revert that PR to see what's going on. I guess the difference is how empty text is handled. 🤔 |
实测 Screen.Recording.2024-06-21.at.15.44.09.mov |
FWIW here are some tests to run through with all the IME changes: zed/crates/gpui/src/platform/mac/window.rs Lines 1175 to 1199 in 4ef7ba2
These things all worked with your PR from a few hours ago. So if there's something else that it broke, it would be great to add that to this list. |
Thank you for your reply. As Junkui says, this bug was introduced by #12702. I'm trying to figure out which part of that PR causes this issue. Once I find and fix it, I'll add some related tests. |
Applying this simple patch to
I'm not too familiar with how IME works and how keys are handled, so this code is somewhat difficult for me to understand. I can see that the only change this patch makes is to let buffering work only for InsertText. According to my understanding, before the change, These are what I've found for now. I'll continue to try to figure it out tomorrow if I have time. |
I will close this PR as #13385 is more correct and reasonable. |
I noticed that when deleting the last letter in the IME, an additional character in the editor is also deleted.
I looked into it and figured out that the only difference between deleting the last letter and others is that the text was empty. After that, I noticed a special logic for
text.is_empty()
. Everything worked fine after I removed it.I'm not sure what
this.unmark_text(cx)
is for, so this change might break other things. I would appreciate it if someone could provide some guidance.Before(from the linked issue):
Screen.Recording.2024-06-11.at.02.40.18.mov
After:
Closes #12862.
Release Notes: