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

Method send_input

src/apps/cli/src/ui/chat/input.rs:13–24  ·  view source on GitHub ↗

Send user input, returns the input text if non-empty

(&mut self)

Source from the content-addressed store, hash-verified

11
12 /// Send user input, returns the input text if non-empty
13 pub fn send_input(&mut self) -> Option<String> {
14 let text = self.text_input.take_input()?;
15
16 self.input_history.push_front(text.clone());
17 if self.input_history.len() > 50 {
18 self.input_history.pop_back();
19 }
20 self.history_index = None;
21 self.refresh_command_menu();
22
23 Some(text)
24 }
25
26 pub fn handle_char(&mut self, c: char) {
27 self.text_input.handle_char(c);

Callers 1

handle_key_eventMethod · 0.80

Calls 4

take_inputMethod · 0.80
cloneMethod · 0.45
lenMethod · 0.45
refresh_command_menuMethod · 0.45

Tested by

no test coverage detected