Closed russell-liu closed 7 months ago
目前的策略就是這樣. 參考其他主流中文輸入法, 快捷鍵做臨時的狀態切換. 而方案選單類似設置程序的作用.
不過這裏可能有 BUG: session 2 裏, 切換方案前後 full_shape 應當不變. 這不是通過保存到 user.yaml 實現的, 而是不清除或重置內存中的狀態. 除非方案裏指名要重置 (如 ascii_mode 通常在切換方案後重置爲 0).
退出 rime_api_console 進程後再運行就不是同一個 session 了.
Understood; thank you for your help. I guess the issue can be closed?
Describe the bug Changing (e.g. toggling) an option to be saved via the options menu successfully persists to
user.yaml
, and therefore persists when changing schemas or exiting and restarting Rime. The persistence fails when changing the option via a keyboard shortcut.To Reproduce Below are high-level reproduction instructions on Weasel and detailed reproduction instructions with librime built from source on Linux (with build dependencies installed).
Weasel
session 1
session 2
librime on Linux (input into shell)
N.B.
full_shape
is an option that needs to be saved session 1session 2
Expected behavior On every platform, in session 2, on lines marked with !!!, the option should show as having been toggled, or on.
Flavor(please complete the following information): Select your flavor:
Package:
Additional context I have been able to fix the bug locally as follows: Comparing calls to
Context::set_option
in switch_translator.cc and key_binder.cc, those in switch_translator.cc are followed by a call toConfig::SetBool
whereas those in key_binder.cc are not. By adding similar statements to key_binder.cc, the bug is fixed. The logic needs to be fixed for all ofradio_select_option
,toggle_option
,set_option
, andunset_option
; perhaps they can share a function which performs the persistence. I am unsure about how to contribute my fix to this project, but am happy to do so. Thank you!