diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-03-23 12:02:03 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-04-30 13:19:53 +1000 |
commit | f08135894344583394240f240377015ea874b03b (patch) | |
tree | 07375df50c6b9a390a04f422e9f1a9ff60f759e6 /pkg/gui/context/remotes_context.go | |
parent | 0c6ab4b43e96763088c1d19039a9c4eba81a25f1 (diff) |
move getDisplayStrings funcs into contexts
Diffstat (limited to 'pkg/gui/context/remotes_context.go')
-rw-r--r-- | pkg/gui/context/remotes_context.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pkg/gui/context/remotes_context.go b/pkg/gui/context/remotes_context.go index 402c1bef4..a194baec8 100644 --- a/pkg/gui/context/remotes_context.go +++ b/pkg/gui/context/remotes_context.go @@ -2,6 +2,7 @@ package context import ( "github.com/jesseduffield/lazygit/pkg/commands/models" + "github.com/jesseduffield/lazygit/pkg/gui/presentation" "github.com/jesseduffield/lazygit/pkg/gui/types" ) @@ -15,13 +16,13 @@ var ( _ types.DiffableContext = (*RemotesContext)(nil) ) -func NewRemotesContext( - getDisplayStrings func(startIdx int, length int) [][]string, - - c *types.HelperCommon, -) *RemotesContext { +func NewRemotesContext(c *types.HelperCommon) *RemotesContext { viewModel := NewBasicViewModel(func() []*models.Remote { return c.Model().Remotes }) + getDisplayStrings := func(startIdx int, length int) [][]string { + return presentation.GetRemoteListDisplayStrings(c.Model().Remotes, c.Modes().Diffing.Ref) + } + return &RemotesContext{ BasicViewModel: viewModel, ListContextTrait: &ListContextTrait{ |