mirror of
https://github.com/zellij-org/zellij.git
synced 2025-01-04 07:14:21 +03:00
fix(input is now only forwarded in normal mode)
This commit is contained in:
commit
a82cc8fbcb
8
rust-toolchain.toml
Normal file
8
rust-toolchain.toml
Normal file
@ -0,0 +1,8 @@
|
||||
# https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file
|
||||
[toolchain]
|
||||
# can be further pinned eg:
|
||||
# date: "stable-2020-07-10"
|
||||
# version: "nightly-1.0.0"
|
||||
channel = "stable"
|
||||
components = [ "rustfmt", "rust-src", "clippy", "rust-analysis"]
|
||||
# targets = [ ]
|
@ -39,6 +39,8 @@ pub enum Action {
|
||||
CloseFocus,
|
||||
/// Create a new tab.
|
||||
NewTab,
|
||||
/// Do nothing.
|
||||
NoOp,
|
||||
/// Go to the next tab.
|
||||
GoToNextTab,
|
||||
/// Go to the previous tab.
|
||||
|
@ -227,6 +227,7 @@ impl InputHandler {
|
||||
.unwrap();
|
||||
self.command_is_executing.wait_until_pane_is_closed();
|
||||
}
|
||||
Action::NoOp => {}
|
||||
}
|
||||
|
||||
should_break
|
||||
|
@ -165,15 +165,16 @@ pub fn key_to_actions(
|
||||
mode: &InputMode,
|
||||
keybinds: &Keybinds,
|
||||
) -> Vec<Action> {
|
||||
if let Some(mode_keybinds) = keybinds.get(mode) {
|
||||
mode_keybinds
|
||||
let mode_keybind_or_action = |action: Action| {
|
||||
keybinds
|
||||
.get(mode)
|
||||
.unwrap_or_else(|| unreachable!("Unrecognized mode: {:?}", mode))
|
||||
.get(key)
|
||||
.cloned()
|
||||
// FIXME in command mode, unbound keystrokes should probably do nothing instead of
|
||||
// writing to the terminal. Will be easier to implement after a big refactor of the
|
||||
// input system (@categorille)
|
||||
.unwrap_or_else(|| vec![Action::Write(input)])
|
||||
} else {
|
||||
unreachable!("Unrecognized mode: {:?}", mode);
|
||||
.unwrap_or_else(|| vec![action])
|
||||
};
|
||||
match *mode {
|
||||
InputMode::Normal => mode_keybind_or_action(Action::Write(input)),
|
||||
_ => mode_keybind_or_action(Action::NoOp),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user