diff options
Diffstat (limited to 'pkg/gui/branches_panel.go')
-rw-r--r-- | pkg/gui/branches_panel.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index 063fc330c..5cf440909 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -19,6 +19,14 @@ func (gui *Gui) getSelectedBranch() *commands.Branch { return gui.State.Branches[selectedLine] } +func (gui *Gui) handleBranchesClick(g *gocui.Gui, v *gocui.View) error { + itemCount := len(gui.State.Branches) + handleSelect := gui.handleBranchSelect + selectedLine := &gui.State.Panels.Branches.SelectedLine + + return gui.handleClick(v, itemCount, selectedLine, handleSelect) +} + // may want to standardise how these select methods work func (gui *Gui) handleBranchSelect(g *gocui.Gui, v *gocui.View) error { if gui.popupPanelFocused() { @@ -30,6 +38,9 @@ func (gui *Gui) handleBranchSelect(g *gocui.Gui, v *gocui.View) error { if _, err := gui.g.SetCurrentView(v.Name()); err != nil { return err } + + gui.getMainView().Title = "Log" + // This really shouldn't happen: there should always be a master branch if len(gui.State.Branches) == 0 { return gui.renderString(g, "main", gui.Tr.SLocalize("NoBranchesThisRepo")) |