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

Method backspace

src/text_input.rs:272–283  ·  view source on GitHub ↗

Delete character before cursor (Backspace).

(&mut self)

Source from the content-addressed store, hash-verified

270
271 /// Delete character before cursor (Backspace).
272 pub fn backspace(&mut self) {
273 if self.delete_selection() {
274 return;
275 }
276 if self.cursor_pos > 0 {
277 self.cursor_pos -= 1;
278 let byte_pos = char_index_to_byte(&self.text, self.cursor_pos);
279 let next_byte = char_index_to_byte(&self.text, self.cursor_pos + 1);
280 self.text.drain(byte_pos..next_byte);
281 }
282 self.reset_blink();
283 }
284
285 /// Delete character after cursor (Delete key).
286 pub fn delete_forward(&mut self) {

Callers 4

test_backspaceFunction · 0.80

Calls 3

char_index_to_byteFunction · 0.85
delete_selectionMethod · 0.80
reset_blinkMethod · 0.80

Tested by 3

test_backspaceFunction · 0.64