1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

controller for viewing sub commits

This commit is contained in:
Jesse Duffield
2022-02-06 14:37:16 +11:00
parent cd31a762b9
commit b93b8cc00a
20 changed files with 210 additions and 86 deletions

View File

@ -61,12 +61,14 @@ func (self *LocalCommitsContext) GetSelectedItemId() string {
type LocalCommitsViewModel struct {
*traits.ListCursor
getModel func() []*models.Commit
limitCommits bool
getModel func() []*models.Commit
}
func NewLocalCommitsViewModel(getModel func() []*models.Commit) *LocalCommitsViewModel {
self := &LocalCommitsViewModel{
getModel: getModel,
getModel: getModel,
limitCommits: true,
}
self.ListCursor = traits.NewListCursor(self)
@ -85,3 +87,11 @@ func (self *LocalCommitsViewModel) GetSelected() *models.Commit {
return self.getModel()[self.GetSelectedLineIdx()]
}
func (self *LocalCommitsViewModel) SetLimitCommits(value bool) {
self.limitCommits = value
}
func (self *LocalCommitsViewModel) GetLimitCommits() bool {
return self.limitCommits
}