-
Notifications
You must be signed in to change notification settings - Fork 48
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patching nested YAML map values incorrectly #5
Comments
However, the former patch is acceptable, and reasonable to Rime, in case the user is intentionally replacing the whole map. |
It is really weird for me that the former form will patch the whole "style" but not "style.color_scheme". Will look for a fix ASAP. |
BTW any chance that Rime would support both the two forms you listed above in the exactly same way? After all they are identical in the semantical POV. |
Yes, the two forms are both supported, but the meanings are different.
This effectively clears predefined punctuation table. |
Not requiring changes in Rime lib but the following rules is my pre-assumption when implemented patchValue (seems not the one it really works with though -_-):
After all your method would also work fine and I will change my patchValue method to support it ASAP. |
Unluckily, in YAML syntax,
is just an equivalent representation for
and, if empty maps and empty lists mean nothing significant but absence,
does the same job with
where in the latter form, null values are implied by leaving nothing after the key. On the other hand, finding leaf nodes recursively in the tree introduces unnecessary complexity; |
I've got your point. I will make the 0.4 release focused on this issue in a couple of days. Thanks for the explanation. |
In
*.custom.yaml
, values from the immediate children key-value pairs under the nodepatch:
will substitute values with the same key-path from the YAML document.It's important to specify in the patch a key-path separated with
/
for values in a nested YAML map.For example, the following code in RimeConfigController.m:
generates an incorrect patch
which should be:
The problem with the former patch is, other children of the node
style
would be lost in the patched file, since the YAML value to be patched is the entire map(ROOT)/style
.The text was updated successfully, but these errors were encountered: