From eafde55afcdf9dc4c17c6c97c1db472fc9ff9957 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sat, 3 Aug 2024 00:08:47 +0200 Subject: add keymap for view and global --- src/widgets/statusbar.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/widgets/statusbar.rs') diff --git a/src/widgets/statusbar.rs b/src/widgets/statusbar.rs index 9375d95..baa19a7 100644 --- a/src/widgets/statusbar.rs +++ b/src/widgets/statusbar.rs @@ -76,11 +76,13 @@ impl StatusBar { } pub fn set_input_mode(&mut self, input: bool) { - if input { - self.input = Some(String::new()); - self.cursor = 0; - } else { - self.input = None; + if self.input.is_some() != input { + if input { + self.input = Some(String::new()); + self.cursor = 0; + } else { + self.input = None; + } } } -- cgit v1.2.3-70-g09d2