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

Method history_next

src/apps/cli/src/ui/chat/input.rs:109–126  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

107 }
108
109 pub fn history_next(&mut self) {
110 match self.history_index {
111 None => {}
112 Some(0) => {
113 self.text_input.clear();
114 self.history_index = None;
115 self.refresh_command_menu();
116 }
117 Some(i) => {
118 let new_index = i - 1;
119 if let Some(history_item) = self.input_history.get(new_index) {
120 self.text_input.set_text(history_item);
121 self.history_index = Some(new_index);
122 self.refresh_command_menu();
123 }
124 }
125 }
126 }
127}

Callers 1

handle_key_eventMethod · 0.80

Calls 4

set_textMethod · 0.80
clearMethod · 0.45
refresh_command_menuMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected