weasel
weasel copied to clipboard
使用句号翻页会把句号也追加到 preedit 里面
上报前请检查
- [x] 我遇到的问题没有其他人在 issue 里提到过
- [x] 我的小狼毫版本于 rime/weasel 下载
- [x] 我在使用小狼毫的最新发布版本,或最新发布版本后的 CI 构建
操作系统信息
- OS 详细版本: Windows 10 22H2 19045.4291
- 小狼毫版本: 0.15.0.0-0507bf7
描述遇到的问题
使用句号翻页,翻到第二页时,输入更多编码,新输入的编码前会出现一个句号。
复现步骤
- 输入任意编码,比如
wo; - 单击 .,翻到第二页;
- 再追加任意编码,比如
s; - 观察到 preedit 中的内容变成了
wo.s
(更一般的,只要翻到偶数页,就会发生上述的现象,翻到奇数页则不会)
预期行为
. 只应用于翻页,不应用于编码
截图
敲击 w o 的效果:
敲击 w o . 的效果:
敲击 w o . s 的效果:
敲击 w o . s ←Backspace 的效果:
用户文件
default.custom.yaml:
customization:
distribution_code_name: Weasel
distribution_version: 0.15.0.0
generator: "Rime::SwitcherSettings"
modified_time: "Wed Apr 17 17:03:16 2024"
rime_version: 1.11.0
patch:
key_binder/bindings/+:
- {accept: Control+Shift+Space, select: .next, when: always}
- {accept: Control+Shift+J, select: japanese, when: always}
- {accept: Control+Shift+H, select: double_pinyin_flypy, when: always}
- {accept: Control+Shift+M, select: moran_sentence, when: always}
- {accept: semicolon, send: 2, when: has_menu}
- {accept: apostrophe, send: 3, when: has_menu}
menu/page_size: 3
schema_list:
- {schema: japanese}
- {schema: double_pinyin_flypy}
- {schema: moran_sentence}
symbols.custom.yaml:
patch:
punctuator/half_shape:
__include: punctuation:/half_shape
punctuator/full_shape:
__include: punctuation:/full_shape
punctuation.custom.yaml:
patch:
half_shape:
# 常规的中文标点(¥ 除外,因为要拿 $ 来打 LaTeX 公式)
'!' : !
'?' : ?
'.' : 。
'^' : ……
';' : ;
':' : :
',' : ,
'\' : 、
'_' : ——
# 括号
'(' : (
')' : )
'[' : 【
']' : 】
'<' : 《
'>' : 》
# 方引号
'''' : { pair: [ 『, 』 ] }
'"' : { pair: [ 「, 」] }
一个简单的fix是把key_binder放在recognizer前面。
这是KeyBinder::ReinterpretPagingKey产生的结果。但是 last_key_ 的逻辑有点问题,会造成按下 . 偶数和奇数次的效果不同…… RFC @lotem
故意这样做的。 句点之后跟字母有可能是输入网址。