-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Fix duplicate key issue #585
base: main
Are you sure you want to change the base?
Conversation
Nice job with the PR! Thanks for the refactor as well! And for writing tests! |
Thank you! It's a pleasure working with you. |
Thinking through a doc example we now figured out how to sort it in this scenario. Would you be okay with us replacing the type of KeyConfigs field with a new a Action struct of the following form: This way the name of the config field/action would be defined in one place, preventing errors from misspellings of e.g. "previous-tab" between e.g. update and check and providing more debug information for functions like check(key conflict), at close to zero cost. The downside is that taskwarrior-tui would have to introduce a lifetime parameter to Action if you'd want to add dynamic shortcuts, as the action names wouldn't be static anymore. The lifetime should be trivial, but could still be annoying to work with. |
Let's keep that out of this PR and discuss it more in a separate issue or PR? I was toying with the idea of doing this: #[derive(Clone, Debug, Default, Deref, DerefMut)]
pub struct KeyBindings(pub HashMap<Mode, HashMap<Vec<KeyEvent>, Action>>); and experimented with it a bunch as part of other projects. I wrote a template for But haven't found the time to pull in those ideas here. If we can make it a We'd be able to have shortcut keys configured per {
"keybindings": {
"Home": {
"<q>": "Quit", // Quit the application
"<Ctrl-c><Ctrl-c>": "Quit", // Yet another way to quit
"<g><g>": "GoToTop"
},
}
} That is my goal ideally but open to suggestions. One related issue is #520 |
Cause of Issue #579 was found in line
taskwarrior-tui/src/keyconfig.rs
Line 166 in a768ee4
We needed something to distract ourselves today, so we decided to cleanup the keyconfig.rs while we were at it.
An issue for a bug I found has been created at #586