From 619cd19e91c7a1ae176a706f0e1f47887cd7a1ec Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 11 Nov 2021 04:26:36 -0500 Subject: avoid unnecessary rerenders and focus changes --- src/history.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/history.rs') 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>, - action: async_std::channel::Sender, + action: async_std::channel::Sender, } impl History { pub fn new( - action: async_std::channel::Sender, + action: async_std::channel::Sender, ) -> 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 -- cgit v1.2.3-54-g00ecf