(&mut self, key: KeyEvent)
| 2474 | } |
| 2475 | |
| 2476 | fn handle_command_key(&mut self, key: KeyEvent) { |
| 2477 | match key.code { |
| 2478 | KeyCode::Esc => { |
| 2479 | self.input_mode = InputMode::Normal; |
| 2480 | self.command_input.clear(); |
| 2481 | } |
| 2482 | KeyCode::Enter => { |
| 2483 | self.execute_command(); |
| 2484 | self.input_mode = InputMode::Normal; |
| 2485 | self.command_input.clear(); |
| 2486 | } |
| 2487 | KeyCode::Char(c) => self.command_input.push(c), |
| 2488 | KeyCode::Backspace => { |
| 2489 | self.command_input.pop(); |
| 2490 | } |
| 2491 | _ => {} |
| 2492 | } |
| 2493 | } |
| 2494 | |
| 2495 | fn execute_command(&mut self) { |
| 2496 | let cmd = self.command_input.trim(); |
no test coverage detected