-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Make Korean IME input more consistent #4796
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure looks good to me.
@philnach if you've got a couple minutes, do you have any thoughts on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this is fine.
…on't get confused and doubt myself
Hello @DHowett-MSFT! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
I've kicked just the x86 build to re-run; stand by. |
I believe this made emoji input do a weird thing: it only shows the most recently entered letter now |
Summary of the Pull Request
Korean IME was not working correctly due to way we were clearing the input buffer inside of
TSFInputControl
. We wanted to clear our input buffer and tell TSF to clear its input buffer as well when we receive aCompositionCompleted
event. This works fine in some IME languages such as Chinese and Japanese. However, Korean IME composes characters differently in such a way where we can't tell TSF to clear their buffer during aCompositionCompleted
event because it would clear the character that triggered theCompositionCompleted
event in the first place.The solution in this PR is to keep our
_inputBuffer
intact until the user presses Enter or Esc, in which case we clear our buffer and the TSF buffer. I've chosen these two keys because it seems to make sense to clear the buffer after text is sent to the terminal with Enter, and Esc usually means to cancel a current composition anyway.This means we need to keep track of our last known "Composition Start Point", which is represented by
_activeTextStart
. Whenever we complete a composition, we'll send the portion of the input buffer between_activeTextStart
and the end of the input buffer to the terminal. Then, we'll update_activeTextStart
to be the end of the input buffer so that the next time we send text to the terminal, we'll only send the portion of our buffer that's "active".PR Checklist
Validation Steps Performed
Manual testing with Chinese, Japanese, and Korean IME.