Skip to content

Conversation

@MokOopsing
Copy link
Contributor

@MokOopsing MokOopsing commented Dec 11, 2025

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, Weasel will skip populating and drawing 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.
  6. With this option, user can dynamic control candidates list by librime-lua script.

The same feature has been merged into Squirrel via #1073

@MokOopsing MokOopsing marked this pull request as ready for review December 11, 2025 06:08
stat.disabled = !!status.is_disabled;
stat.full_shape = !!status.is_full_shape;
stat.hide_candidates =
!!rime_api->get_option(session_id, "_hide_candidate");
Copy link
Member

Choose a reason for hiding this comment

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

這個實現不太環保。

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

@MokOopsing MokOopsing closed this Dec 26, 2025
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.

2 participants