mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-27 12:32:37 +02:00
always reset branch selected index when creating new branch
This commit is contained in:
parent
1189c2fab7
commit
262ff24c5b
@ -226,6 +226,7 @@ func (gui *Gui) createNewBranchWithName(newBranchName string) error {
|
|||||||
if err := gui.GitCommand.NewBranch(newBranchName, branch.Name); err != nil {
|
if err := gui.GitCommand.NewBranch(newBranchName, branch.Name); err != nil {
|
||||||
return gui.surfaceError(err)
|
return gui.surfaceError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
gui.State.Panels.Branches.SelectedLineIdx = 0
|
gui.State.Panels.Branches.SelectedLineIdx = 0
|
||||||
return gui.refreshSidePanels(refreshOptions{mode: ASYNC})
|
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 {
|
if err := gui.switchContext(gui.Contexts.Branches.Context); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
gui.State.Panels.Branches.SelectedLineIdx = 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gui.State.Panels.Branches.SelectedLineIdx = 0
|
||||||
|
|
||||||
return gui.refreshSidePanels(refreshOptions{mode: ASYNC})
|
return gui.refreshSidePanels(refreshOptions{mode: ASYNC})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user