summaryrefslogtreecommitdiffstats
path: root/src/state.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-11 04:26:18 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-11 04:26:18 -0500
commit9a8209cc2da7c98966cba4d3e4ebc6223308214e (patch)
tree3fb3aceab318edcfd8172c5a5a8d6a1f7b679c95 /src/state.rs
parent359d577ab3b237ca71d6c87f31e6b260b2f72f3e (diff)
downloadnbsh-9a8209cc2da7c98966cba4d3e4ebc6223308214e.tar.gz
nbsh-9a8209cc2da7c98966cba4d3e4ebc6223308214e.zip
make scrolling offscreen work
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/state.rs b/src/state.rs
index eee39ae..888a3ef 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -234,7 +234,8 @@ impl State {
crate::action::Action::Run(ref cmd) => {
let idx =
self.history.run(cmd, action_w.clone()).await.unwrap();
- self.focus = crate::action::Focus::History(idx);
+ self.set_focus(crate::action::Focus::History(idx), None)
+ .await;
self.hide_readline = true;
}
crate::action::Action::UpdateFocus(new_focus) => {
@@ -297,6 +298,13 @@ impl State {
self.focus = new_focus;
self.hide_readline = false;
self.scene = self.default_scene(new_focus, entry).await;
+ self.history
+ .make_focus_visible(
+ self.readline.lines(),
+ self.focus_idx(),
+ matches!(self.focus, crate::action::Focus::Scrolling(_)),
+ )
+ .await;
}
fn focus_idx(&self) -> Option<usize> {