mirror of
https://github.com/charmbracelet/gum.git
synced 2024-10-05 18:29:23 +03:00
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.
This commit is contained in:
parent
8e959e4cdc
commit
46328de806
@ -46,11 +46,11 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
}
|
}
|
||||||
case tea.KeyMsg:
|
case tea.KeyMsg:
|
||||||
switch msg.String() {
|
switch msg.String() {
|
||||||
case "ctrl+c", "esc":
|
case "ctrl+c":
|
||||||
m.aborted = true
|
m.aborted = true
|
||||||
m.quitting = true
|
m.quitting = true
|
||||||
return m, tea.Quit
|
return m, tea.Quit
|
||||||
case "ctrl+d":
|
case "ctrl+d", "esc":
|
||||||
m.quitting = true
|
m.quitting = true
|
||||||
return m, tea.Quit
|
return m, tea.Quit
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user