diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-02-05 17:04:10 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | d82f175e79f18756769d91de94458b095130297c (patch) | |
tree | 63c0c5b17a698a5a202a85b930edd0cf9e85ebf7 /pkg/gui/remotes_panel.go | |
parent | 145c69d9ae32ec8fbdd6d1e6116efec466a0a709 (diff) |
refactor contexts
Diffstat (limited to 'pkg/gui/remotes_panel.go')
-rw-r--r-- | pkg/gui/remotes_panel.go | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/pkg/gui/remotes_panel.go b/pkg/gui/remotes_panel.go index 1273ee6ad..f47bd1a01 100644 --- a/pkg/gui/remotes_panel.go +++ b/pkg/gui/remotes_panel.go @@ -4,24 +4,14 @@ import ( "fmt" "strings" - "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/gui/style" ) // list panel functions -func (gui *Gui) getSelectedRemote() *models.Remote { - selectedLine := gui.State.Panels.Remotes.SelectedLineIdx - if selectedLine == -1 || len(gui.State.Model.Remotes) == 0 { - return nil - } - - return gui.State.Model.Remotes[selectedLine] -} - func (gui *Gui) remotesRenderToMain() error { var task updateTask - remote := gui.getSelectedRemote() + remote := gui.State.Contexts.Remotes.GetSelected() if remote == nil { task = NewRenderStringTask("No remotes") } else { |