diff --git a/pkg/gui/merge_panel.go b/pkg/gui/merge_panel.go index 627e3229f..bfe3536fe 100644 --- a/pkg/gui/merge_panel.go +++ b/pkg/gui/merge_panel.go @@ -12,6 +12,7 @@ import ( "strings" "github.com/fatih/color" + "github.com/go-errors/errors" "github.com/golang-collections/collections/stack" "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" @@ -255,17 +256,17 @@ func (gui *Gui) refreshMergePanel() error { func (gui *Gui) catSelectedFile(g *gocui.Gui) (string, error) { item := gui.getSelectedFile() if item == nil { - return "", gui.newStringTask("main", gui.Tr.SLocalize("NoFilesDisplay")) + return "", errors.New(gui.Tr.SLocalize("NoFilesDisplay")) } if item.Type != "file" { - return "", gui.newStringTask("main", gui.Tr.SLocalize("NotAFile")) + return "", errors.New(gui.Tr.SLocalize("NotAFile")) } cat, err := gui.GitCommand.CatFile(item.Name) if err != nil { gui.Log.Error(err) - return "", gui.newStringTask("main", err.Error()) + return "", err } return cat, nil } diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index df3dc5ece..3d5353ea9 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -266,6 +266,9 @@ func (gui *Gui) currentViewName() string { func (gui *Gui) resizeCurrentPopupPanel() error { v := gui.g.CurrentView() + if v == nil { + return nil + } if gui.isPopupPanel(v.Name()) { return gui.resizePopupPanel(v) }