Skip to content
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

请问如何在向左移动光标后,保持光标后的 preedit.text 分隔符和 preedit_format 效果不变 #868

Open
ccyybn opened this issue May 6, 2024 · 0 comments

Comments

@ccyybn
Copy link

ccyybn commented May 6, 2024

我发现向左移动光标后,光标后 preedit 的内容会变成原始输入内容,分隔符 会消失,preedit_format 也会失效。
这样左右调整位置时,整个内容会不断跳动变化,特别是双拼这种将 长韵母 映射为 单键 的情况,肉眼很难定位,很不舒服
而微软拼音左右移动光标整个 preedit 就不会变,只有光标在动,就很舒服

我尝试修改源码,找到这两行,发现光标前的内容是由 cand->preedit() 生成,光标后就是简单的直接拼接的 full_input 字符串

composition.cc: 63
preedit.text += std::to_string(i) + cand->preedit();
composition.cc: 82
if (end < full_input.length()) {
  preedit.text += full_input.substr(end);
}

然后似乎caret_pos_改变后,update_notifier_(this) 通知了cand 改变其preedit()的内容,不过我没找到在哪,我现在也不知道要怎么改了,而且这好像有点难改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant