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

Method hint_line

crates/opencode-tui/src/components/prompt.rs:1074–1102  ·  view source on GitHub ↗
(&self, theme: &Theme)

Source from the content-addressed store, hash-verified

1072 }
1073
1074 fn hint_line(&self, theme: &Theme) -> Line<'static> {
1075 let keybind = self.context.keybind.read();
1076 let variant_cycle = keybind.print("variant_cycle");
1077 let agent_cycle = keybind.print("agent_cycle");
1078 let command_list = keybind.print("command_list");
1079 drop(keybind);
1080
1081 let mut spans = Vec::new();
1082 if self.context.current_model_variant().is_some() {
1083 spans.push(Span::styled(variant_cycle, Style::default().fg(theme.text)));
1084 spans.push(Span::styled(
1085 " variants",
1086 Style::default().fg(theme.text_muted),
1087 ));
1088 spans.push(Span::raw(" "));
1089 }
1090 spans.push(Span::styled(agent_cycle, Style::default().fg(theme.text)));
1091 spans.push(Span::styled(
1092 " agents",
1093 Style::default().fg(theme.text_muted),
1094 ));
1095 spans.push(Span::raw(" "));
1096 spans.push(Span::styled(command_list, Style::default().fg(theme.text)));
1097 spans.push(Span::styled(
1098 " commands",
1099 Style::default().fg(theme.text_muted),
1100 ));
1101 Line::from(spans)
1102 }
1103}
1104
1105fn truncate_for_status(input: &str, max_chars: usize) -> String {

Callers 2

render_status_lineMethod · 0.80

Calls 4

newFunction · 0.85
readMethod · 0.80
printMethod · 0.80
current_model_variantMethod · 0.80

Tested by

no test coverage detected