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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user