MCPcopy Create free account
hub / github.com/GCWing/BitFun / handle_delete

Method handle_delete

src/apps/cli/src/ui/text_input.rs:95–103  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

93 }
94
95 pub fn handle_delete(&mut self) {
96 let char_count = self.input.chars().count();
97 if self.cursor < char_count {
98 let byte_pos = self.char_pos_to_byte_pos(self.cursor);
99 if byte_pos < self.input.len() {
100 self.input.remove(byte_pos);
101 }
102 }
103 }
104
105 pub fn move_cursor_left(&mut self) {
106 if self.cursor > 0 {

Callers 1

handle_keyMethod · 0.80

Calls 4

char_pos_to_byte_posMethod · 0.80
countMethod · 0.45
lenMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected