Skip to content
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

ShellBuilder, config load/save tweaks, new shortcut serialization format, enable TOML #416

Merged
merged 15 commits into from
Oct 23, 2023

Conversation

dhardy
Copy link
Collaborator

@dhardy dhardy commented Oct 23, 2023

No description provided.

@dhardy
Copy link
Collaborator Author

dhardy commented Oct 23, 2023

Fixes #414.

@dhardy
Copy link
Collaborator Author

dhardy commented Oct 23, 2023

This PR brings TOML support and a much nicer serialization format:

[shortcuts.none]
F1 = "Help"
F2 = "Rename"
# ...

[shortcuts.shift]
F3 = "FindPrevious"

[shortcuts.alt]
ArrowDown = "NavDown"
ArrowLeft = "NavPrevious"
# ...

[shortcuts.ctrl]
Tab = "TabNext"
ArrowDown = "ViewDown"
ArrowLeft = "WordLeft"
a = "SelectAll"
# ...

[shortcuts.ctrl-shift]
Tab = "TabPrevious"
ArrowDown = "ViewDown"
ArrowLeft = "WordLeft"
# ...

Single-char keys bind to some Key::Character, others bind to Key::Named. Shortcuts using longer Character variants, Unidentified or Dead are serialized using a different format under another (array) table, shortcuts.other.

Limitation: this might not be the most appropriate format for app-specific shortcuts. I'd prefer bindings to e.g. Command::WordLeft, but lack the patience/incentive to wrangle that out of serde for now. (This format is also assumptive that all app-specific bindings would be to a path, though making such a restriction should be acceptable given that the value is just a trigger fed to trigger some widget action.)

Making the crate generic over this is a little bit more
complex than the prior core.
@dhardy dhardy merged commit 78eb7cb into master Oct 23, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant