From 46328de806c5aedcac6ec27dfa35b0bcbbafbb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20H=C3=B6ltje?= Date: Thu, 19 Oct 2023 12:38:23 -0400 Subject: [PATCH] feat(write): ESC should be successful (#433) 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 674b66d..e407a17 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 }