diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-10 23:07:08 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-10 23:07:08 -0500 |
commit | a87e03fa707cfdd9779334d4bf177188bb54db5b (patch) | |
tree | 8133f5d896ac433268c88e1e3e41b96d1ed78b9a /src/state.rs | |
parent | ed83c606b26affee61d8745bbc9cd9601f8a52e6 (diff) | |
download | nbsh-a87e03fa707cfdd9779334d4bf177188bb54db5b.tar.gz nbsh-a87e03fa707cfdd9779334d4bf177188bb54db5b.zip |
space to recall focused command to the readline
Diffstat (limited to 'src/state.rs')
-rw-r--r-- | src/state.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/state.rs b/src/state.rs index c31eba8..9ab76ce 100644 --- a/src/state.rs +++ b/src/state.rs @@ -139,6 +139,17 @@ impl State { ), )) } + textmode::Key::Char(' ') => { + if let Some(idx) = self.focus_idx() { + self.readline + .set_input(&self.history.history_cmd(idx).await); + Some(crate::action::Action::UpdateFocus( + crate::action::Focus::Readline, + )) + } else { + None + } + } _ => None, } } |