mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-10 04:07:18 +02:00
fix remote branches select sig
This commit is contained in:
parent
43f8bae267
commit
17b84e09c0
@ -521,7 +521,7 @@ func (gui *Gui) onBranchesPanelSearchSelect(selectedLine int) error {
|
||||
return gui.handleRemoteSelect()
|
||||
case "remote-branches":
|
||||
gui.State.Panels.RemoteBranches.SelectedLine = selectedLine
|
||||
return gui.handleRemoteBranchSelect(gui.g, branchesView)
|
||||
return gui.handleRemoteBranchSelect()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -153,8 +153,8 @@ func (gui *Gui) getListViews() []*listView {
|
||||
context: "remote-branches",
|
||||
getItemsLength: func() int { return len(gui.State.RemoteBranches) },
|
||||
getSelectedLineIdxPtr: func() *int { return &gui.State.Panels.RemoteBranches.SelectedLine },
|
||||
handleFocus: gui.handleRemoteBranchSelect,
|
||||
handleItemSelect: gui.handleRemoteBranchSelect,
|
||||
handleFocus: gui.wrappedHandler(gui.handleRemoteBranchSelect),
|
||||
handleItemSelect: gui.wrappedHandler(gui.handleRemoteBranchSelect),
|
||||
gui: gui,
|
||||
rendersToMainView: true,
|
||||
},
|
||||
|
@ -19,14 +19,14 @@ func (gui *Gui) getSelectedRemoteBranch() *commands.RemoteBranch {
|
||||
return gui.State.RemoteBranches[selectedLine]
|
||||
}
|
||||
|
||||
func (gui *Gui) handleRemoteBranchSelect(g *gocui.Gui, v *gocui.View) error {
|
||||
func (gui *Gui) handleRemoteBranchSelect() error {
|
||||
if gui.popupPanelFocused() {
|
||||
return nil
|
||||
}
|
||||
|
||||
gui.State.SplitMainPanel = false
|
||||
|
||||
if _, err := gui.g.SetCurrentView(v.Name()); err != nil {
|
||||
if _, err := gui.g.SetCurrentView("branches"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ func (gui *Gui) handleRemoteBranchSelect(g *gocui.Gui, v *gocui.View) error {
|
||||
return gui.newStringTask("main", "No branches for this remote")
|
||||
}
|
||||
|
||||
v.FocusPoint(0, gui.State.Panels.RemoteBranches.SelectedLine)
|
||||
gui.getBranchesView().FocusPoint(0, gui.State.Panels.RemoteBranches.SelectedLine)
|
||||
|
||||
if gui.inDiffMode() {
|
||||
return gui.renderDiff()
|
||||
@ -64,7 +64,7 @@ func (gui *Gui) renderRemoteBranchesWithSelection() error {
|
||||
displayStrings := presentation.GetRemoteBranchListDisplayStrings(gui.State.RemoteBranches, gui.State.Diff.Ref)
|
||||
gui.renderDisplayStrings(branchesView, displayStrings)
|
||||
if gui.g.CurrentView() == branchesView && branchesView.Context == "remote-branches" {
|
||||
if err := gui.handleRemoteBranchSelect(gui.g, branchesView); err != nil {
|
||||
if err := gui.handleRemoteBranchSelect(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ func (gui *Gui) newLineFocused(g *gocui.Gui, v *gocui.View) error {
|
||||
case "remotes":
|
||||
return gui.handleRemoteSelect()
|
||||
case "remote-branches":
|
||||
return gui.handleRemoteBranchSelect(g, v)
|
||||
return gui.handleRemoteBranchSelect()
|
||||
case "tags":
|
||||
return gui.handleTagSelect(g, v)
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user