fix(WeaselTSF): preserve composition workaround text - #1907
Closed
LeonspaceX wants to merge 1 commit into
Closed
Conversation
Contributor
|
这个操作很久前试过有应用不吃会有问题的,直接不插入其实我试过一点可以输入的,只是自动顶字开始下一个合成的时候有问题,典型例子是五笔自动顶字,我还有个pr挂那未修好 #1462 |
Author
|
不知道我加的_fCUASWorkaroundEnabled能不能解决某些应用不吃字的问题,我暂时没在本地复现出来有应用吃字。如果方便的话能不能说说是什么应用?(或许也可以试试其他零宽...?如果真的还是吃字大概是治标不治本吧) |
Contributor
|
不是,是直接崩 |
Author
|
那有点严重 我再看看 |
Author
|
如果说的是类似 #895 的问题的话,我暂时还没复现出来,试了去除(我pr里)新加的_fCUASWorkaroundEnabled判断,把selection改回TF_ANCHOR_END,写入改成U+200B都没有导致设置闪退 |
Contributor
Author
|
好的!太感谢了 |
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.
概述
当inline_preedit设置为false时,在例如Telegram Web等网页中无法弹出候选框,需要输入框非空才可以弹出候选框。(见issue #1579 )
问题原因
这是由于小狼毫输入法在启动CUAS定位候选框时向输入框中插入了空格字符,而telegram web将空格视为空内容并执行replaceChildren(),导致composition结束造成的。

将空格替换为U+200B(普通零宽空格)并不能修复该问题,因为零宽空格在chromium TSF管线下会被格式化为空格,导致网页接收到的内容实际上还是空格,因此我将其改为了U+2060(WORD JOINER),不会被chromium TSF格式化,更不会被trim()视为空白,暂未发现副作用(希望没有吧...)。
同时注意到_fCUASWorkaroundEnabled虽然传入CStartCompositionEditSession但并未参与判断,已增加判断条件,暂未发现副作用。