-
Notifications
You must be signed in to change notification settings - Fork 3k
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 composed inputs (dead keys) in vim emulation #12523
Conversation
We require contributors to sign our Contributor License Agreement, and we don't have @jorikvanveen 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! |
@jorikvanveen I think we should probably try and fix the linux keyboard handling to more closely match the Mac behavior in this case (as this does work on macOS today - at least with a Brazilian layout - and I'm a bit concerned about special casing the accents). Can you please let me know which keyboard layout you're using, and I'll try and test it on my local linux machine. |
Yes, I must admit this solution is a bit hacky, though for my use case everything seems to work as far as I can tell. I use GNOME wayland with this keyboard layout: |
@jorikvanveen I think #12871 is the right fix here. Does it work for you? I was mistaken, as on macOS we were also triggering the find before composition had completed. The main remaining downside is that it's not obvious that you're in composition mode in this case. I'm not sure what the best fix is, because we don't want to write the character to the buffer itself. Maybe we can use something like the Overlays from #12106 to render a fake IME input in this scenario. |
Yes, that fixes it! Thank you! |
Okay so I built the latest version of Zed on my desktop, and noticed the |
@jorikvanveen uh oh! To clarify: what exactly are the keys you're pressing, and what are you expecting to have to press? It should be the case now that we wait until composition is over before running |
I press the following sequence: In standard vim, when my cursor is between two apostrophes in normal mode (i.e. in a string), this sequence removes everything between between the apostrophes and puts me into insert mode so I can easily change the contents of the string. What happens in the latest zed without my patch is that the sequence gets cancelled when I press the To further clarify, this patch fixes the issue for me:
|
@jorikvanveen I see, sorry about that. I had been looking at |
Superseded by #13185. I added an additional check to only run this in the case that it's likely part of an IME transaction, otherwise |
Thank you so much! Everything is working perfectly now. (and yes I made sure to have a clean git repo this time 😅) |
Great. Sorry for the u-turns along the way! |
This PR fixes actions in vim emulation such as
ci"
ordi'
on keyboard layouts where quotes require multiple keystrokes. The tests that were passing before this commit still pass, but it might be wise to do some additional testing since I jumped into this codebase an hour ago and I have no idea what I'm doing (feedback is very welcome).Release Notes: