Skip to content

Commit

Permalink
feat(write): ESC should be successful (#433)
Browse files Browse the repository at this point in the history
Change ESC from aborting to successful quitting.

'vi' users press ESC as an uncontrollable tick, making using 'gum write'
painful when all their work is lost.
  • Loading branch information
docwhat authored Oct 19, 2023
1 parent 8e959e4 commit 46328de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions write/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
case tea.KeyMsg:
switch msg.String() {
case "ctrl+c", "esc":
case "ctrl+c":
m.aborted = true
m.quitting = true
return m, tea.Quit
case "ctrl+d":
case "ctrl+d", "esc":
m.quitting = true
return m, tea.Quit
}
Expand Down

0 comments on commit 46328de

Please sign in to comment.