(&mut self)
| 665 | } |
| 666 | |
| 667 | fn history_next(&mut self) { |
| 668 | let Some(idx) = self.history_index else { |
| 669 | return; |
| 670 | }; |
| 671 | |
| 672 | if idx + 1 < self.history.len() { |
| 673 | let next = idx + 1; |
| 674 | self.history_index = Some(next); |
| 675 | self.input = self.history[next].clone(); |
| 676 | self.cursor_position = self.input.len(); |
| 677 | } else { |
| 678 | self.history_index = None; |
| 679 | self.input = self.history_draft.take().unwrap_or_default(); |
| 680 | self.cursor_position = self.input.len(); |
| 681 | } |
| 682 | self.recompute_suggestions(); |
| 683 | } |
| 684 | |
| 685 | fn reset_history_cursor(&mut self) { |
| 686 | self.history_index = None; |
no test coverage detected