1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-10 04:07:18 +02:00

fix remotes select sig

This commit is contained in:
Jesse Duffield 2020-08-15 16:50:30 +10:00
parent b0fe963f8a
commit 43f8bae267
4 changed files with 7 additions and 7 deletions

View File

@ -518,7 +518,7 @@ func (gui *Gui) onBranchesPanelSearchSelect(selectedLine int) error {
return gui.handleBranchSelect()
case "remotes":
gui.State.Panels.Remotes.SelectedLine = selectedLine
return gui.handleRemoteSelect(gui.g, branchesView)
return gui.handleRemoteSelect()
case "remote-branches":
gui.State.Panels.RemoteBranches.SelectedLine = selectedLine
return gui.handleRemoteBranchSelect(gui.g, branchesView)

View File

@ -143,7 +143,7 @@ func (gui *Gui) getListViews() []*listView {
getItemsLength: func() int { return len(gui.State.Remotes) },
getSelectedLineIdxPtr: func() *int { return &gui.State.Panels.Remotes.SelectedLine },
handleFocus: gui.wrappedHandler(gui.renderRemotesWithSelection),
handleItemSelect: gui.handleRemoteSelect,
handleItemSelect: gui.wrappedHandler(gui.handleRemoteSelect),
handleClickSelectedItem: gui.handleRemoteEnter,
gui: gui,
rendersToMainView: true,

View File

@ -22,14 +22,14 @@ func (gui *Gui) getSelectedRemote() *commands.Remote {
return gui.State.Remotes[selectedLine]
}
func (gui *Gui) handleRemoteSelect(g *gocui.Gui, v *gocui.View) error {
func (gui *Gui) handleRemoteSelect() 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
}
@ -39,7 +39,7 @@ func (gui *Gui) handleRemoteSelect(g *gocui.Gui, v *gocui.View) error {
if remote == nil {
return gui.newStringTask("main", "No remotes")
}
v.FocusPoint(0, gui.State.Panels.Remotes.SelectedLine)
gui.getBranchesView().FocusPoint(0, gui.State.Panels.Remotes.SelectedLine)
if gui.inDiffMode() {
return gui.renderDiff()
@ -88,7 +88,7 @@ func (gui *Gui) renderRemotesWithSelection() error {
gui.renderDisplayStrings(branchesView, displayStrings)
if gui.g.CurrentView() == branchesView && branchesView.Context == "remotes" {
if err := gui.handleRemoteSelect(gui.g, branchesView); err != nil {
if err := gui.handleRemoteSelect(); err != nil {
return err
}
}

View File

@ -230,7 +230,7 @@ func (gui *Gui) newLineFocused(g *gocui.Gui, v *gocui.View) error {
case "local-branches":
return gui.handleBranchSelect()
case "remotes":
return gui.handleRemoteSelect(g, v)
return gui.handleRemoteSelect()
case "remote-branches":
return gui.handleRemoteBranchSelect(g, v)
case "tags":