summaryrefslogtreecommitdiffstats
path: root/src/history.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-11-11 04:26:36 -0500
committerJesse Luehrs <doy@tozt.net>2021-11-11 04:26:36 -0500
commit619cd19e91c7a1ae176a706f0e1f47887cd7a1ec (patch)
treef1d922ff835e1cc412f0101dcba44fe29aeecc6a /src/history.rs
parentcf04fbb6427eb10332c5bc143cc453aa2906e84c (diff)
downloadnbsh-619cd19e91c7a1ae176a706f0e1f47887cd7a1ec.tar.gz
nbsh-619cd19e91c7a1ae176a706f0e1f47887cd7a1ec.zip
avoid unnecessary rerenders and focus changes
Diffstat (limited to 'src/history.rs')
-rw-r--r--src/history.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/history.rs b/src/history.rs
index 58de34c..e5ad161 100644
--- a/src/history.rs
+++ b/src/history.rs
@@ -4,12 +4,12 @@ use textmode::Textmode as _;
pub struct History {
entries: Vec<crate::util::Mutex<HistoryEntry>>,
- action: async_std::channel::Sender<crate::state::Action>,
+ action: async_std::channel::Sender<crate::action::Action>,
}
impl History {
pub fn new(
- action: async_std::channel::Sender<crate::state::Action>,
+ action: async_std::channel::Sender<crate::action::Action>,
) -> Self {
Self {
entries: vec![],
@@ -58,7 +58,7 @@ impl History {
}
task_entry.lock_arc().await.running = false;
task_action
- .send(crate::state::Action::UpdateFocus(
+ .send(crate::action::Action::UpdateFocus(
crate::state::Focus::Readline,
))
.await
@@ -67,7 +67,7 @@ impl History {
}
}
task_action
- .send(crate::state::Action::Render)
+ .send(crate::action::Action::Render)
.await
.unwrap();
}
@@ -87,7 +87,7 @@ impl History {
});
self.entries.push(entry);
self.action
- .send(crate::state::Action::UpdateFocus(
+ .send(crate::action::Action::UpdateFocus(
crate::state::Focus::History(self.entries.len() - 1),
))
.await
@@ -108,7 +108,7 @@ impl History {
}
textmode::Key::Ctrl(b'z') => {
self.action
- .send(crate::state::Action::UpdateFocus(
+ .send(crate::action::Action::UpdateFocus(
crate::state::Focus::Readline,
))
.await