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

Method open

crates/opencode-tui/src/components/dialogs/theme_list.rs:46–65  ·  view source on GitHub ↗
(&mut self, current_theme: &str)

Source from the content-addressed store, hash-verified

44 }
45
46 pub fn open(&mut self, current_theme: &str) {
47 self.open = true;
48 self.initial_theme = canonical_theme_id(current_theme);
49 self.query.clear();
50 self.filter();
51 let selected = self
52 .filtered
53 .iter()
54 .position(|idx| {
55 self.options
56 .get(*idx)
57 .is_some_and(|item| item.id == self.initial_theme)
58 })
59 .unwrap_or(0);
60 self.state.select(if self.filtered.is_empty() {
61 None
62 } else {
63 Some(selected)
64 });
65 }
66
67 pub fn close(&mut self) {
68 self.open = false;

Callers

nothing calls this directly

Calls 5

canonical_theme_idFunction · 0.85
is_emptyMethod · 0.80
clearMethod · 0.45
filterMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected