diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 3e0bd9936..d07c7afee 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -362,9 +362,6 @@ func (gui *Gui) RunWithSubprocesses() { } } -func (gui *Gui) quit(g *gocui.Gui, v *gocui.View) error { - if v.Name() != "commitMessage" && v.Name() != "confirmation" { - return gocui.ErrQuit - } - return nil +func (gui *Gui) escape(g *gocui.Gui, v *gocui.View) error { + return gocui.ErrQuit } diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index d09ed64b1..f0f2538b2 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -14,9 +14,9 @@ type Binding struct { func (gui *Gui) keybindings(g *gocui.Gui) error { bindings := []Binding{ - {ViewName: "", Key: 'q', Modifier: gocui.ModNone, Handler: gui.quit}, - {ViewName: "", Key: gocui.KeyCtrlC, Modifier: gocui.ModNone, Handler: gui.quit}, - {ViewName: "", Key: gocui.KeyEsc, Modifier: gocui.ModNone, Handler: gui.quit}, + {ViewName: "", Key: 'q', Modifier: gocui.ModNone, Handler: gui.escape}, + {ViewName: "", Key: gocui.KeyCtrlC, Modifier: gocui.ModNone, Handler: gui.escape}, + {ViewName: "", Key: gocui.KeyEsc, Modifier: gocui.ModNone, Handler: gui.escape}, {ViewName: "", Key: gocui.KeyPgup, Modifier: gocui.ModNone, Handler: gui.scrollUpMain}, {ViewName: "", Key: gocui.KeyPgdn, Modifier: gocui.ModNone, Handler: gui.scrollDownMain}, {ViewName: "", Key: gocui.KeyCtrlU, Modifier: gocui.ModNone, Handler: gui.scrollUpMain},