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.
Implementation of #179 allowing for more complex actions a window, by giving a command key before selecting the window.
Currently, this adds
x
to kill the window andq
to toggle floating, although this can be extended to much more complex functions. A full screen command and a split and launch [x] seem like good next candidates.The main points:
We add a
WindowCommand
Enum, defining the commands throughWindowCommand.send_to_window()
. If the user gives a key in thekey : WindowCommand
HashMapwindow_cmd_map
then we select that command, otherwise we default toWindowCommand::Focus
.The command keys are currently hard-coded, but if you're happy with the implementation, I'll add something to the command line args.
--kill-window-char [x]
and--focus-window-char [x]
are pretty verbose, but seem to be the simplest way of allowing the user to configure the keys?The Emacs packages used as reference silently ignores any keys used for commands, if they are also present in the
hint_chars
, however, I've decided to make this explicitly return an error, which seems more in line with Rust.Happy for any other feedback!