Skip to content

Conversation

@lotem
Copy link
Member

@lotem lotem commented Jul 16, 2025

the complex logic handles the happy path, but the indices can be wrong eg. when the preedit is a complex structure containing prompt text.

code that removes remaining code from the candidate preview is particularly dangerous.

the current fix is not perfect and can produce wrong selection range. let's improve it by adding librime APIs that provide segmented and detailed data of the composition.

Fixes #1047 #1045

the complex logic handles the happy path, but the indices can be wrong
eg. when the preedit is a complex structure containing prompt text.

code that removes remaining code from the candidate preview is
particularly dangerous.

the current fix is not perfect and can produce wrong selection range.
let's improve it by adding librime APIs that provide segmented and
detailed data of the composition.
@lotem lotem requested a review from LEOYoon-Tsaw July 16, 2025 16:35
@lotem lotem changed the title fix crash when enabled inline_candidate fix crash when enabled style/inline_candidate Jul 16, 2025
@lotem lotem requested a review from a team July 17, 2025 02:30
@lotem
Copy link
Member Author

lotem commented Jul 17, 2025

沒人提出意見我就要提交了哦。

用起來感覺可以。
原先光標位置不對的情況,改過之後光標位置對了。

唯一「退步」的是 style: { inline_preedit: false, inline_candidate: true} 配置下,
翻頁指定較短的候選字,剩餘編碼會在候選字之後顯示。

「消除」剩餘編碼的邏輯,是對 librime「逆向工程」的結果,沒有保證。
librime API 給帶上編碼,從實用角度也確實是有用的提示,那不妨就先原樣顯示出來。

@lotem lotem merged commit 6137702 into master Jul 17, 2025
2 checks passed
@lotem lotem deleted the fix branch July 17, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 在Chrome的文本框中移动选字光标会导致崩溃

2 participants