From 8792204870fbcb448d619425eb8d0a1358dfdcc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20H=C3=B6ltje?= Date: Thu, 28 Sep 2023 15:12:35 -0400 Subject: [PATCH] feat(write): ESC should be successful 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. --- write/write.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/write/write.go b/write/write.go index 674b66dc0..e407a17d0 100644 --- a/write/write.go +++ b/write/write.go @@ -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 }