mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
Collapse/expand all files in tree
Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
This commit is contained in:
committed by
Stefan Haller
parent
14a91d9829
commit
7bea41534b
@ -25,6 +25,20 @@ type CommitFileTree struct {
|
||||
collapsedPaths *CollapsedPaths
|
||||
}
|
||||
|
||||
func (self *CommitFileTree) CollapseAll() {
|
||||
dirPaths := lo.FilterMap(self.GetAllItems(), func(file *CommitFileNode, index int) (string, bool) {
|
||||
return file.Path, !file.IsFile()
|
||||
})
|
||||
|
||||
for _, path := range dirPaths {
|
||||
self.collapsedPaths.Collapse(path)
|
||||
}
|
||||
}
|
||||
|
||||
func (self *CommitFileTree) ExpandAll() {
|
||||
self.collapsedPaths.ExpandAll()
|
||||
}
|
||||
|
||||
var _ ICommitFileTree = &CommitFileTree{}
|
||||
|
||||
func NewCommitFileTree(getFiles func() []*models.CommitFile, log *logrus.Entry, showTree bool) *CommitFileTree {
|
||||
|
Reference in New Issue
Block a user