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

lua_filter 如何修改 cand.text? #11

Closed
Ace-Who opened this issue Jun 23, 2019 · 2 comments
Closed

lua_filter 如何修改 cand.text? #11

Ace-Who opened this issue Jun 23, 2019 · 2 comments

Comments

@Ace-Who
Copy link

Ace-Who commented Jun 23, 2019

修改 cand.comment 的方法

    cand:get_genuine().comment = foo

用在 cand.text 上不正常,只有标点符号起作用了。

@hchunhui
Copy link
Owner

修改 text 做不到,因为这个属性是只读的(只有 SimpleCandidate 除外)。这是 librime 核心库的限制。

要达到修改的效果,只能在 filter 中重建一个新的 Candidate
但 lua 现在只支持建 SimpleCandidate,所以这么干可能会使该项的调频、组词等功能失效。

@Ace-Who
Copy link
Author

Ace-Who commented Jun 23, 2019

谢谢,明白了。

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

No branches or pull requests

2 participants