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

Method handle_newline

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

Source from the content-addressed store, hash-verified

77 }
78
79 pub fn handle_newline(&mut self) {
80 let byte_pos = self.char_pos_to_byte_pos(self.cursor);
81 self.input.insert(byte_pos, '\n');
82 self.cursor += 1;
83 }
84
85 pub fn handle_backspace(&mut self) {
86 if self.cursor > 0 && !self.input.is_empty() {

Callers 3

handle_charMethod · 0.45
handle_keyMethod · 0.45
handle_key_eventMethod · 0.45

Calls 2

char_pos_to_byte_posMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected