(&mut self)
| 89 | } |
| 90 | |
| 91 | pub fn history_prev(&mut self) { |
| 92 | if self.input_history.is_empty() { |
| 93 | return; |
| 94 | } |
| 95 | |
| 96 | let new_index = match self.history_index { |
| 97 | None => 0, |
| 98 | Some(i) if i + 1 < self.input_history.len() => i + 1, |
| 99 | Some(i) => i, |
| 100 | }; |
| 101 | |
| 102 | if let Some(history_item) = self.input_history.get(new_index) { |
| 103 | self.text_input.set_text(history_item); |
| 104 | self.history_index = Some(new_index); |
| 105 | self.refresh_command_menu(); |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | pub fn history_next(&mut self) { |
| 110 | match self.history_index { |
no test coverage detected