From 068119fe19945e51cf48dc599d9d976341cc7d83 Mon Sep 17 00:00:00 2001 From: daa Date: Mon, 30 Oct 2017 23:04:28 +0300 Subject: [PATCH] Hide cursor in terminal mode (busy_on event) --- src/cursor.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cursor.rs b/src/cursor.rs index 0de86c0..500c7af 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -89,15 +89,21 @@ impl Cursor { } pub fn reset_state(&mut self) { - self.start(); + if self.state.borrow().anim_phase != AnimPhase::Busy { + self.start(); + } } pub fn enter_focus(&mut self) { - self.start(); + if self.state.borrow().anim_phase != AnimPhase::Busy { + self.start(); + } } pub fn leave_focus(&mut self) { - self.state.borrow_mut().reset_to(AnimPhase::NoFocus); + if self.state.borrow().anim_phase != AnimPhase::Busy { + self.state.borrow_mut().reset_to(AnimPhase::NoFocus); + } } pub fn busy_on(&mut self) {