Add command, window mode, and keybinding logic #315
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Most hardcoded shortcuts were replaced with a mode-dependent configurable shortcuts, which are mapped to abstract commands handled for easier handling.
The concept of window modes was introduced to allow conditioning bindings on e.g. whether the help mode is active or whether a message is selected. Most bindings were moved to
WindowMode.Normal
, which has the lowest priority and does not get considered when the help popup or the channel modal is shown.WindowMode.Anywhere
takes precedence over all other modes. The remaining modes are usually inserted in between if they are active (Multiline, MessageSelected, Normal
).Keybindings are serialised from toml at startup. The default keybinding is active by default and can be overwritten via the configuration, e.g.
Suggested tasks
App
or if there's a better wayREADME.md
Enter
to be passed throughI'd appreciate your feedback on these changes.