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

Method View

internal/input/input.go:188–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

186}
187
188func (m selectModel) View() tea.View {
189 if m.done {
190 return tea.NewView("")
191 }
192
193 var b strings.Builder
194
195 b.WriteString(promptStyle.Render(fmt.Sprintf("? Select value for %s:", m.varName)))
196 b.WriteString("\n")
197
198 for i, opt := range m.options {
199 if i == m.cursor {
200 b.WriteString(cursorStyle.Render("❯ "))
201 b.WriteString(selectedStyle.Render(opt))
202 } else {
203 b.WriteString(" " + opt)
204 }
205 b.WriteString("\n")
206 }
207
208 b.WriteString(dimStyle.Render(" (↑/↓ to move, enter to select, esc to cancel)"))
209
210 return tea.NewView(b.String())
211}

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected