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

Method backspace_word

src/text_input.rs:300–310  ·  view source on GitHub ↗

Delete the word before the cursor (Ctrl+Backspace).

(&mut self)

Source from the content-addressed store, hash-verified

298
299 /// Delete the word before the cursor (Ctrl+Backspace).
300 pub fn backspace_word(&mut self) {
301 if self.delete_selection() {
302 return;
303 }
304 let target = find_word_boundary_left(&self.text, self.cursor_pos);
305 let byte_start = char_index_to_byte(&self.text, target);
306 let byte_end = char_index_to_byte(&self.text, self.cursor_pos);
307 self.text.drain(byte_start..byte_end);
308 self.cursor_pos = target;
309 self.reset_blink();
310 }
311
312 /// Delete the word after the cursor (Ctrl+Delete).
313 pub fn delete_word_forward(&mut self) {

Callers 2

test_backspace_wordFunction · 0.80

Calls 4

find_word_boundary_leftFunction · 0.85
char_index_to_byteFunction · 0.85
delete_selectionMethod · 0.80
reset_blinkMethod · 0.80

Tested by 1

test_backspace_wordFunction · 0.64