Send user input, returns the input text if non-empty
(&mut self)
| 11 | |
| 12 | /// Send user input, returns the input text if non-empty |
| 13 | pub fn send_input(&mut self) -> Option<String> { |
| 14 | let text = self.text_input.take_input()?; |
| 15 | |
| 16 | self.input_history.push_front(text.clone()); |
| 17 | if self.input_history.len() > 50 { |
| 18 | self.input_history.pop_back(); |
| 19 | } |
| 20 | self.history_index = None; |
| 21 | self.refresh_command_menu(); |
| 22 | |
| 23 | Some(text) |
| 24 | } |
| 25 | |
| 26 | pub fn handle_char(&mut self, c: char) { |
| 27 | self.text_input.handle_char(c); |
no test coverage detected