MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / push_history

Method push_history

crates/opencode-tui/src/components/prompt.rs:690–703  ·  view source on GitHub ↗
(&mut self, entry: String)

Source from the content-addressed store, hash-verified

688 }
689
690 fn push_history(&mut self, entry: String) {
691 if self
692 .history
693 .last()
694 .is_some_and(|existing| existing == &entry)
695 {
696 return;
697 }
698 self.history.push(entry);
699 if self.history.len() > MAX_HISTORY_ENTRIES {
700 let overflow = self.history.len().saturating_sub(MAX_HISTORY_ENTRIES);
701 self.history.drain(0..overflow);
702 }
703 }
704
705 fn bump_frecency(&mut self, key: &str) {
706 let key = key.trim();

Callers 1

take_inputMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected