diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-03 00:08:47 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-03 00:08:47 +0200 |
| commit | eafde55afcdf9dc4c17c6c97c1db472fc9ff9957 (patch) | |
| tree | 838cab985495ead6dc005bd934f9e87c896e4ddd /src/widgets/statusbar.rs | |
| parent | bb9944d086332ed0b8d6064316225e901c456bd7 (diff) | |
add keymap for view and global
Diffstat (limited to 'src/widgets/statusbar.rs')
| -rw-r--r-- | src/widgets/statusbar.rs | 12 |
1 files changed, 7 insertions, 5 deletions
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; + } } } |