Closed alswl closed 6 years ago
Try deleting the redundant line:
"/" : "/"
When double-quoted, some symbols (including /) have to be escaped. It is recommended to use '/'
instead.
# luna_pinyin.custom.yaml
patch:
punctuator/half_shape:
'/': '/'
以上代碼導致錯誤的結果。half_shape
節點會被替換成字符串值 /
。
相似地:
__patch:
map:
/a: x
/b/c: y
會得到
map:
a: x
b: { c: y }
我可以推測出這跟支持這種用法有關,是允許嘗試對 key 做路徑解析的副作用:
defaults:
list:
- item a
- item b
replaced:
__include: defaults
new_key: value
# the following replaces the list in defaults
list:
- item x
- item y
merged:
__include: defaults
new_key: value
# the /+ suffix merges the sub-node to the list included from defaults
list/+:
- added item c
然而這裏的後綴不同於用作路徑分隔符的 /
。只有 __patch:
這級 map 的 key 需要當節點路徑解讀,其他 map 遞歸合併時,key 裏面的 /
不應該解析爲路徑分隔符,只消匹配 /=
、/+
兩種後綴。
和我之前改過的 https://github.com/rime/librime/commit/a1df9c5f5dcfbcdf979cd24925c56a9f806914d2 成因類似。
'/'
causes error mentioned above when used in patch
. I did not validate before posting my point. It was my fault.
FYI, fixed in https://github.com/rime/librime/releases/tag/rime-1.2.10 .
Error message:
Related configuration:
Version: librime 1:1.2.10-1
System version: Arch latest.
If I use librime-1:1.2.9-8, the configuration works.