(&mut self)
| 83 | } |
| 84 | |
| 85 | pub fn handle_backspace(&mut self) { |
| 86 | if self.cursor > 0 && !self.input.is_empty() { |
| 87 | let byte_pos = self.char_pos_to_byte_pos(self.cursor - 1); |
| 88 | if byte_pos < self.input.len() { |
| 89 | self.input.remove(byte_pos); |
| 90 | self.cursor -= 1; |
| 91 | } |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | pub fn handle_delete(&mut self) { |
| 96 | let char_count = self.input.chars().count(); |
no test coverage detected