Delete the word after the cursor (Ctrl+Delete).
(&mut self)
| 311 | |
| 312 | /// Delete the word after the cursor (Ctrl+Delete). |
| 313 | pub fn delete_word_forward(&mut self) { |
| 314 | if self.delete_selection() { |
| 315 | return; |
| 316 | } |
| 317 | let target = find_word_delete_boundary_right(&self.text, self.cursor_pos); |
| 318 | let byte_start = char_index_to_byte(&self.text, self.cursor_pos); |
| 319 | let byte_end = char_index_to_byte(&self.text, target); |
| 320 | self.text.drain(byte_start..byte_end); |
| 321 | self.reset_blink(); |
| 322 | } |
| 323 | |
| 324 | /// Set cursor position from a click at pixel x within the element. |
| 325 | /// `char_x_positions` should be a sorted list of x-positions for each character boundary |