Delete character after cursor (Delete key).
(&mut self)
| 284 | |
| 285 | /// Delete character after cursor (Delete key). |
| 286 | pub fn delete_forward(&mut self) { |
| 287 | if self.delete_selection() { |
| 288 | return; |
| 289 | } |
| 290 | let len = self.text.chars().count(); |
| 291 | if self.cursor_pos < len { |
| 292 | let byte_pos = char_index_to_byte(&self.text, self.cursor_pos); |
| 293 | let next_byte = char_index_to_byte(&self.text, self.cursor_pos + 1); |
| 294 | self.text.drain(byte_pos..next_byte); |
| 295 | } |
| 296 | self.reset_blink(); |
| 297 | } |
| 298 | |
| 299 | /// Delete the word before the cursor (Ctrl+Backspace). |
| 300 | pub fn backspace_word(&mut self) { |