You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did some more investigation, looks like a design flaw in fcitx::Configuration.
Option that wraps a config relies on the subConfigSkeleton() to generate description.
However subConfigSkeleton will always return a copied fcitx::Configuration from "defaultValue_".
The reason for this design is that, subConfigSkeleton not only returns the directly wrapped Configuration subclass, but also strip vector from vector. In the vector case, there is no Configuration object, so it has to be a new instance.
Copy constructor defined with FCITX_CONFIGURATION, will only copy the option value and leave all the annotation untouched.
So in short, two issues:
subConfigSkeleton always return a new instance. The function signature is std::unique_ptr, so unfortunately, it has to be a new instance for now. One possible way is solve this is to create a new Configuration and do a forwarding from existing object, instead of return a real new instance.
the value returned by subConfigSkeleton only copies values. In the past, we are having a similar issue for defaultValue. At that time, syncDefaultValueToCurrent is introduced. Maybe, we can introduce a new method to copy annotation value too.
wengxt
transferred this issue from fcitx/fcitx5-chinese-addons
Sep 25, 2024
The option
partialSp
is declared asOptionWithAnnotation<bool, OptionalHideInDescription>
https://github.com/fcitx/fcitx5-chinese-addons/blob/64e2a072e92ca06b08b9fd82d7549f86cc0699a9/im/pinyin/pinyin.h#L117-L119
and set to hidden in
pyConfig_
https://github.com/fcitx/fcitx5-chinese-addons/blob/64e2a072e92ca06b08b9fd82d7549f86cc0699a9/im/pinyin/pinyin.cpp#L785
but it's still vislble in pinyin options:
The text was updated successfully, but these errors were encountered: