diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/command.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/command.rs b/src/command.rs index d80f1f2..f5a24c9 100644 --- a/src/command.rs +++ b/src/command.rs | |||
@@ -81,6 +81,9 @@ impl CommandBox { | |||
81 | } | 81 | } |
82 | 82 | ||
83 | pub fn hist_prev(&mut self) { | 83 | pub fn hist_prev(&mut self) { |
84 | if self.history.items.is_empty() { | ||
85 | return; | ||
86 | } | ||
84 | if let Some(idx) = self.hist_idx { | 87 | if let Some(idx) = self.hist_idx { |
85 | if !(idx + 1 >= self.history.items.len()) { | 88 | if !(idx + 1 >= self.history.items.len()) { |
86 | self.hist_idx = Some(idx + 1); | 89 | self.hist_idx = Some(idx + 1); |