fix: ignore Enter during IME composition in command palette#184
Open
greymoth-jp wants to merge 1 commit into
Open
fix: ignore Enter during IME composition in command palette#184greymoth-jp wants to merge 1 commit into
greymoth-jp wants to merge 1 commit into
Conversation
In TeletypeCore, the Enter handler ran callAction as soon as Enter was pressed. During IME input (Japanese/Chinese/Korean) the first Enter only confirms the composition candidate, so the command palette fired the action on a half-typed query. Guard the handler with !e.isComposing so Enter acts only after composition has ended. Signed-off-by: greymoth <246701683+greymoth-jp@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With a Japanese, Chinese or Korean IME, the first Enter confirms the active composition candidate instead of submitting. In
TeletypeCore,handleInputKeyrancallActionone.key === 'Enter' && !e.shiftKey, so confirming a candidate fired the action (or the fallback action) on a half-typed query.I added
!e.isComposingto that condition, so Enter only acts once composition has ended. A normal Enter is unaffected.Repro: set the OS to a Japanese IME, open the command palette, type a query such as
けんさくand press Enter to pick a candidate.