1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-21 22:43:27 +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() return gui.handleBranchSelect()
case "remotes": case "remotes":
gui.State.Panels.Remotes.SelectedLine = selectedLine gui.State.Panels.Remotes.SelectedLine = selectedLine
return gui.handleRemoteSelect(gui.g, branchesView) return gui.handleRemoteSelect()
case "remote-branches": case "remote-branches":
gui.State.Panels.RemoteBranches.SelectedLine = selectedLine gui.State.Panels.RemoteBranches.SelectedLine = selectedLine
return gui.handleRemoteBranchSelect(gui.g, branchesView) 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) }, getItemsLength: func() int { return len(gui.State.Remotes) },
getSelectedLineIdxPtr: func() *int { return &gui.State.Panels.Remotes.SelectedLine }, getSelectedLineIdxPtr: func() *int { return &gui.State.Panels.Remotes.SelectedLine },
handleFocus: gui.wrappedHandler(gui.renderRemotesWithSelection), handleFocus: gui.wrappedHandler(gui.renderRemotesWithSelection),
handleItemSelect: gui.handleRemoteSelect, handleItemSelect: gui.wrappedHandler(gui.handleRemoteSelect),
handleClickSelectedItem: gui.handleRemoteEnter, handleClickSelectedItem: gui.handleRemoteEnter,
gui: gui, gui: gui,
rendersToMainView: true, rendersToMainView: true,

View File

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

View File

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