Also use escape to quit

This commit is contained in:
Christian Rocha
2020-01-10 23:46:46 -05:00
parent c7d28354f7
commit 293c2f6696
2 changed files with 28 additions and 7 deletions

View File

@@ -36,6 +36,8 @@ func update(msg tea.Msg, model tea.Model) (tea.Model, tea.Cmd) {
}
case "q":
fallthrough
case "esc":
return m, tea.Quit
}
@@ -56,7 +58,7 @@ func view(model tea.Model) string {
)
return fmt.Sprintf(
"What to do today?\n\n%s\n\n(press j/k or up/down to select, q to quit)",
"What to do today?\n\n%s\n\n(press j/k or up/down to select, q or esc to quit)",
choices,
)
}