Skip to content

Conversation

@MokOopsing
Copy link
Contributor

This pull request introduces the ability to control whether the candidate list is displayed through a Rime option (_hide_candidate). This feature was originally implemented in Trime.

When the option is enabled, Squirrel will skip populating and showing the candidate list, allowing users or schemas to dynamically hide candidates without relying on theme configuration.

Usage Example

#in xxx.schema.yaml or xxx.custom.yaml
switches:
  - name: _hide_candidate
    reset: 1
  1. When _hide_candidate is 1, the candidate list remains empty and the candidate window stays hidden.
  2. Default behavior remains unchanged (candidates are shown unless explicitly hidden).
  3. No impact on existing configurations.
  4. The _hide_candidate option is optional and off by default.
  5. Fully compatible with existing themes and styles.

If the name _hide_candidate is not suitable, feel free to rename it to a more appropriate one.

@LEOYoon-Tsaw
Copy link
Member

Looks fine to me, what do you think? @lotem

Copy link
Member

@lotem lotem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
只隐藏候选字,仍会在候选窗显示 preedit 对吗?

@MokOopsing
Copy link
Contributor Author

MokOopsing commented Oct 10, 2025

LGTM 只隐藏候选字,仍会在候选窗显示 preedit 对吗?

是的,不会影响preedit逻辑,如果关掉嵌入功能,则会在候选窗显示preedit,如果开启嵌入功能,preedit则会嵌入在文本输入框内。

image e7082518e5903cb7f7534ae8823efe8a
357db0431cb00f099c37c752f7586f10 image

Copy link
Member

@lotem lotem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

很好很强大。

@LEOYoon-Tsaw LEOYoon-Tsaw merged commit 1d11743 into rime:master Oct 19, 2025
1 check passed
@euwei7
Copy link

euwei7 commented Dec 8, 2025

小狼毫能支持吗?刚刚体验了确实很棒,单位电脑是win,希望小狼毫也能支持。

@MokOopsing
Copy link
Contributor Author

小狼毫能支持吗?刚刚体验了确实很棒,单位电脑是win,希望小狼毫也能支持。

​​抱歉,由于我自己没有用小狼毫,自己调试起来不太方便,所以我暂时无能为力

@MokOopsing
Copy link
Contributor Author

小狼毫能支持吗?刚刚体验了确实很棒,单位电脑是win,希望小狼毫也能支持。

https://github.com/MokOopsing/weasel/actions/runs/20123457964 帮忙试试这里的产物?我已向小狼毫提了pr,不过我自己没有机器验证修改

@lotem
Copy link
Member

lotem commented Dec 13, 2025

這個實現不太環保。

每次顯示候選字都要先查這個選項,要做兩次 map 查詢(Session、Option)。影響了不開這個選項時的性能!

@LEOYoon-Tsaw
Copy link
Member

這個實現不太環保。

每次顯示候選字都要先查這個選項,要做兩次 map 查詢(Session、Option)。影響了不開這個選項時的性能!

確實,應該在加載配置的時候讀進內存,但是最近沒時間寫

@lotem
Copy link
Member

lotem commented Dec 15, 2025

確實,應該在加載配置的時候讀進內存,但是最近沒時間寫

這個想法不錯。

前端可以通過回調監視選項的修改。

在 librime 的 API 裏檢查是不是也行。直接不往 RimeContext 填候選字。

@MokOopsing
Copy link
Contributor Author

確實,應該在加載配置的時候讀進內存,但是最近沒時間寫

這個想法不錯。

前端可以通過回調監視選項的修改。

在 librime 的 API 裏檢查是不是也行。直接不往 RimeContext 填候選字。

那么改librime api吧,然后回退这笔,免得一个端一个端地PR

@MokOopsing
Copy link
Contributor Author

MokOopsing commented Dec 15, 2025

確實,應該在加載配置的時候讀進內存,但是最近沒時間寫

這個想法不錯。

前端可以通過回調監視選項的修改。

在 librime 的 API 裏檢查是不是也行。直接不往 RimeContext 填候選字。

做了此类尝试,发现值更新并没有如预期的及时

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.

4 participants