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

Method delete_forward

src/text_input.rs:286–297  ·  view source on GitHub ↗

Delete character after cursor (Delete key).

(&mut self)

Source from the content-addressed store, hash-verified

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) {

Callers 2

test_delete_forwardFunction · 0.80

Calls 3

char_index_to_byteFunction · 0.85
delete_selectionMethod · 0.80
reset_blinkMethod · 0.80

Tested by 1

test_delete_forwardFunction · 0.64