1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

move getModel functions into contexts

This commit is contained in:
Jesse Duffield
2023-03-21 21:16:30 +11:00
parent 47b91f1ef5
commit 0e5a4c7a36
12 changed files with 36 additions and 49 deletions

View File

@ -18,12 +18,15 @@ var (
)
func NewCommitFilesContext(
getModel func() []*models.CommitFile,
getDisplayStrings func(startIdx int, length int) [][]string,
c *types.HelperCommon,
) *CommitFilesContext {
viewModel := filetree.NewCommitFileTreeViewModel(getModel, c.Log, c.UserConfig.Gui.ShowFileTree)
viewModel := filetree.NewCommitFileTreeViewModel(
func() []*models.CommitFile { return c.Model().CommitFiles },
c.Log,
c.UserConfig.Gui.ShowFileTree,
)
return &CommitFilesContext{
CommitFileTreeViewModel: viewModel,