(msg tea.Msg)
| 171 | func (m launchWizardModel) Init() tea.Cmd { return nil } |
| 172 | |
| 173 | func (m launchWizardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { |
| 174 | key, ok := msg.(tea.KeyMsg) |
| 175 | if !ok { |
| 176 | return m, nil |
| 177 | } |
| 178 | if m.manualEntry { |
| 179 | return m.updateManualEntry(key) |
| 180 | } |
| 181 | step := m.activeStep() |
| 182 | if step == nil { |
| 183 | // Defensive: should not happen. |
| 184 | m.aborted = true |
| 185 | return m, tea.Quit |
| 186 | } |
| 187 | action := step.update(key) |
| 188 | switch action { |
| 189 | case pickerActionAbort: |
| 190 | m.aborted = true |
| 191 | return m, tea.Quit |
| 192 | case pickerActionBack: |
| 193 | m.stepBack() |
| 194 | return m, nil |
| 195 | case pickerActionAdvance: |
| 196 | return m.advanceFromStep(*step) |
| 197 | } |
| 198 | return m, nil |
| 199 | } |
| 200 | |
| 201 | func (m launchWizardModel) View() string { |
| 202 | if m.manualEntry { |
nothing calls this directly
no test coverage detected