MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / ToggleBool

Method ToggleBool

internal/tui/settings.go:142–148  ·  view source on GitHub ↗

ToggleBool toggles the selected boolean value. Returns the key and new value for the caller to act on.

()

Source from the content-addressed store, hash-verified

140// ToggleBool toggles the selected boolean value.
141// Returns the key and new value for the caller to act on.
142func (s *SettingsOverlay) ToggleBool() (key string, newVal bool) {
143 if s.selectedIndex < len(s.items) && s.items[s.selectedIndex].Type == SettingsItemBool {
144 s.items[s.selectedIndex].BoolVal = !s.items[s.selectedIndex].BoolVal
145 return s.items[s.selectedIndex].Key, s.items[s.selectedIndex].BoolVal
146 }
147 return "", false
148}
149
150// RevertToggle reverts the last toggle (used when validation fails).
151func (s *SettingsOverlay) RevertToggle() {

Calls

no outgoing calls