-
-
Notifications
You must be signed in to change notification settings - Fork 613
upcoming problem with bitflags and key_list ron reading #1929
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
Comments
@extrawurst note that the new format is much much nicer
|
yeah see |
related to #1781 |
so the plan is the 'breaking change' one? I will comment out the 2 tests for now |
Sure I don’t care to break the format pre 1.0 |
For backwards compatibility would it work to map to an enum that has two variants, V1 and V2 with a custom serializer for V1 and a serializer for V2 that defers to the V2 format? Similar to the solution mentioned in https://serde.rs/data-model.html#mapping-into-the-data-model |
While working on the replacement of textinput with tui-textarea I found a problem that is coming down the pipe
when bitflags changed from v1 to v2 they changed their serialization format - see https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md#200-rc2
The current ron files for key mapping use the v1 format - of course
crossterm 0.27 pulls in bitflags v2. This now means that gitui can no longer read its key config files, plus there are two tests that fail.
I upgraded crossterm because tui-textarea asks for 0.27, and anyway I assume gitui would eventually upgrade anyway since its a core dependency
I am not sure if there is a good solution (I dont know serde well enough but have done some reading)
There is a crate that allows reading the old format, but it requires changes to the bitflags definition. The bitflags in key_list ron are defined in crossterm not gitui (
KeyModifiers
) and it seems like an odd change to ask crossterm to make.The only other alternatives would be
I dont know if gitui can specify a custom deserializer for the
KeyModifiers
typeThe text was updated successfully, but these errors were encountered: