zed icon indicating copy to clipboard operation
zed copied to clipboard

IME pre-edit is unusable on macOS

Open jansol opened this issue 1 year ago • 0 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

When entering text via an IME, there is a pre-edit buffer where the input is held until the user has chosen the right conversion and committed the input to the application. It is possible to navigate within this buffer with the shift and arrow keys to select a subsection of it and convert this selection independently of the rest of the string. However Zed intercepts those keys and moves the cursor in the underlying file buffer in addition to sending them to the IME. As a result IME input lands in a completely different position in the file than where the IME was originally invoked.

How to reproduce (If you are not familiar, try this first in TextEdit to see how it should work):

  1. Enable the "Japanese - Romaji" input source (formerly also known as "Kotoeri") in macOS keyboard settings, in the Input Sources tab; default settings should suffice
  2. Head to Zed, open a buffer with some text and navigate somewhere in the middle of it and activate the Japanese input source
  3. Type "shinnkannsenn", you should see a candidate string like "しんかんせん"
  4. Press space to get an initial conversion attempt, turning the candidate string into "新幹線"
  5. Press shift+left a few times and you should see a highlight under a subsection of the candidate string, beginning from the start of the string with the other end moving as you press shift+arrows
  6. Press up/down or tab to cycle through alternative conversions of the highlighted region, or left/right to move the highlight between the splits created with shift+left/right (try to change the first symbol to 心 for example)
  7. Commit the final result with enter - note that the cursor has moved to a different position in the buffer and the IME input got inserted at the new position rather than where it was at the start of step 3.

If you want to back out while testing you can either discard the current input by pressing escape a few times or switch back to your usual keyboard input source, which commits the current candidate string.

(This can be replicated with the same steps when using a Chinese IME and probably with any other IME that makes nontrivial use of pre-edit.)

Environment

Zed: v0.135.1 (Zed Preview) OS: macOS 12.7.4 Memory: 16 GiB Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

jansol avatar May 14 '24 22:05 jansol