diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 13:44:11 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | 262ff24c5bccd02f18f6ac058de44e24cca00d0a (patch) | |
tree | 421465c3af3f686e20ebfd851a22c1aa9e4297cb /pkg/gui/branches_panel.go | |
parent | 1189c2fab7b499aa4cbf2901b8dbcbd6f4f9aaad (diff) |
always reset branch selected index when creating new branch
Diffstat (limited to 'pkg/gui/branches_panel.go')
-rw-r--r-- | pkg/gui/branches_panel.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index 36c8ab112..e81dbc68a 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -226,6 +226,7 @@ func (gui *Gui) createNewBranchWithName(newBranchName string) error { if err := gui.GitCommand.NewBranch(newBranchName, branch.Name); err != nil { return gui.surfaceError(err) } + gui.State.Panels.Branches.SelectedLineIdx = 0 return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) } @@ -482,9 +483,10 @@ func (gui *Gui) handleNewBranchOffCurrentItem() error { if err := gui.switchContext(gui.Contexts.Branches.Context); err != nil { return err } - gui.State.Panels.Branches.SelectedLineIdx = 0 } + gui.State.Panels.Branches.SelectedLineIdx = 0 + return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) }) } |