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

Method history_prev

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

Source from the content-addressed store, hash-verified

89 }
90
91 pub fn history_prev(&mut self) {
92 if self.input_history.is_empty() {
93 return;
94 }
95
96 let new_index = match self.history_index {
97 None => 0,
98 Some(i) if i + 1 < self.input_history.len() => i + 1,
99 Some(i) => i,
100 };
101
102 if let Some(history_item) = self.input_history.get(new_index) {
103 self.text_input.set_text(history_item);
104 self.history_index = Some(new_index);
105 self.refresh_command_menu();
106 }
107 }
108
109 pub fn history_next(&mut self) {
110 match self.history_index {

Callers 1

handle_key_eventMethod · 0.80

Calls 5

set_textMethod · 0.80
is_emptyMethod · 0.45
lenMethod · 0.45
getMethod · 0.45
refresh_command_menuMethod · 0.45

Tested by

no test coverage detected