MCPcopy Create free account
hub / github.com/go-task/task / Update

Method Update

internal/input/input.go:163–186  ·  view source on GitHub ↗
(msg tea.Msg)

Source from the content-addressed store, hash-verified

161}
162
163func (m selectModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
164 switch msg := msg.(type) {
165 case tea.KeyPressMsg:
166 switch msg.Keystroke() {
167 case "ctrl+c", "escape":
168 m.cancelled = true
169 m.done = true
170 return m, tea.Quit
171 case "up", "shift+tab", "k":
172 if m.cursor > 0 {
173 m.cursor--
174 }
175 case "down", "tab", "j":
176 if m.cursor < len(m.options)-1 {
177 m.cursor++
178 }
179 case "enter":
180 m.done = true
181 return m, tea.Quit
182 }
183 }
184
185 return m, nil
186}
187
188func (m selectModel) View() tea.View {
189 if m.done {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected