(&mut self, c: char)
| 64 | } |
| 65 | |
| 66 | pub fn handle_char(&mut self, c: char) { |
| 67 | if c == '\n' { |
| 68 | self.handle_newline(); |
| 69 | return; |
| 70 | } |
| 71 | if c.is_control() || c == '\u{0}' { |
| 72 | return; |
| 73 | } |
| 74 | let byte_pos = self.char_pos_to_byte_pos(self.cursor); |
| 75 | self.input.insert(byte_pos, c); |
| 76 | self.cursor += 1; |
| 77 | } |
| 78 | |
| 79 | pub fn handle_newline(&mut self) { |
| 80 | let byte_pos = self.char_pos_to_byte_pos(self.cursor); |
no test coverage detected