diff --git a/confirmation_panel.go b/confirmation_panel.go index 16f9ac0c9..521361dfd 100644 --- a/confirmation_panel.go +++ b/confirmation_panel.go @@ -101,10 +101,8 @@ func setKeyBindings(g *gocui.Gui, handleYes, handleNo func(*gocui.Gui, *gocui.Vi if err := g.SetKeybinding("confirmation", gocui.KeyEnter, gocui.ModNone, wrappedConfirmationFunction(handleYes)); err != nil { return err } - if err := g.SetKeybinding("confirmation", gocui.KeyEsc, gocui.ModNone, wrappedConfirmationFunction(handleNo)); err != nil { - return err - } - return nil + + return g.SetKeybinding("confirmation", gocui.KeyEsc, gocui.ModNone, wrappedConfirmationFunction(handleNo)) } func createMessagePanel(g *gocui.Gui, currentView *gocui.View, title, prompt string) error { diff --git a/files_panel.go b/files_panel.go index 52d4137e3..ad4f9e809 100644 --- a/files_panel.go +++ b/files_panel.go @@ -59,11 +59,8 @@ func handleFilePress(g *gocui.Gui, v *gocui.View) error { if err := refreshFiles(g); err != nil { return err } - if err := handleFileSelect(g, v); err != nil { - return err - } - return nil + return handleFileSelect(g, v) } func getSelectedFile(g *gocui.Gui) (GitFile, error) { diff --git a/gui.go b/gui.go index 040cfdafd..98654d5a0 100644 --- a/gui.go +++ b/gui.go @@ -196,10 +196,8 @@ func keybindings(g *gocui.Gui) error { if err := g.SetKeybinding("stash", 'k', gocui.ModNone, handleStashPop); err != nil { return err } - if err := g.SetKeybinding("stash", 'd', gocui.ModNone, handleStashDrop); err != nil { - return err - } - return nil + + return g.SetKeybinding("stash", 'd', gocui.ModNone, handleStashDrop) } func layout(g *gocui.Gui) error {