MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / delete_word_forward

Method delete_word_forward

src/text_input.rs:313–322  ·  view source on GitHub ↗

Delete the word after the cursor (Ctrl+Delete).

(&mut self)

Source from the content-addressed store, hash-verified

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

Callers 2

test_delete_word_forwardFunction · 0.80

Calls 4

char_index_to_byteFunction · 0.85
delete_selectionMethod · 0.80
reset_blinkMethod · 0.80

Tested by 1

test_delete_word_forwardFunction · 0.64