Gracefully shut down the program when we are done
This commit is contained in:
parent
7affa8d06d
commit
be3bcb02f7
2 changed files with 19 additions and 5 deletions
|
@ -14,8 +14,10 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||
|
||||
case "enter":
|
||||
if m.loaded {
|
||||
// Process the selected item
|
||||
m.processSelection()
|
||||
// Process the selected item, if the return value is true then exit the application
|
||||
if m.processSelection() {
|
||||
return m, tea.Quit
|
||||
}
|
||||
}
|
||||
case "ctrl+z", "backspace":
|
||||
// Go backwards in the model
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue