fix: ターミナルで最初の1文字が二重に入力される問題を修正 - #358
Open
shiina-archelon wants to merge 1 commit into
Open
Conversation
This was referenced Sep 1, 2026
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.
Closes #357
修正
未確定文字列が無い状態で文字キーが押されたら、変換結果を待たずに、押された文字をそのまま暫定の未確定文字列として表示する。変換結果が届いたら本来の内容に置き換える。
ConverterClientEventRouter.provisionalMarkedText(event:context:)を追加。暫定の未確定文字列を表示するかどうか、表示するなら何を表示するかをここで判定するazooKeyMacInputControllerは、変換結果が返るまでに押された文字を暫定の未確定文字列として表示し (通常は 1 文字。結果より先に次のキーが来たときだけ 2 文字以上になる)、結果が届いたrefreshMarkedText()で本来の内容に置き換える。入力元のアプリが切り替わるdeactivateServerでも暫定の文字列は捨てるrefreshMarkedText()からsetMarkedText(_:)を分け、暫定と本番で同じ経路を使う注意点
暫定の未確定文字列には押されたキーの文字をそのまま使うため、変換結果が届くまでの 30〜110ms のあいだ、本来と違う文字が見えることがある。
rを押すと下線付きのrが一瞬見えてからすになるaが一瞬だけ下線付きで見える確認
swift test72 件 passしたprovisionalMarkedTextの判定にテストを 5 件追加したswiftlint --strictpassbが 1 文字だけ入るか、かな入力 (JIS) でr→すになるか、Alfred など通常の text view でも問題ないかチェックした