MCPcopy
hub / github.com/jesseduffield/lazygit / SetTree

Method SetTree

pkg/gui/filetree/file_tree.go:181–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

179}
180
181func (self *FileTree) SetTree() {
182 filesForDisplay := self.getFilesForDisplay()
183 guiConfig := self.common.UserConfig().Gui
184 showRootItem := guiConfig.ShowRootItemInFileTree
185 cmp := NodeSortComparator[models.File](guiConfig.FileTreeSortOrder, guiConfig.FileTreeSortCaseSensitive)
186 if self.showTree {
187 self.tree = BuildTreeFromFiles(filesForDisplay, showRootItem, cmp)
188 } else {
189 self.tree = BuildFlatTreeFromFiles(filesForDisplay, showRootItem, cmp)
190 }
191}
192
193func (self *FileTree) IsCollapsed(path string) bool {
194 return self.collapsedPaths.IsCollapsed(path)

Callers 5

SetStatusFilterMethod · 0.95
ToggleShowTreeMethod · 0.95
SetTextFilterMethod · 0.95
TestRenderFileTreeFunction · 0.95

Calls 5

getFilesForDisplayMethod · 0.95
NodeSortComparatorFunction · 0.85
BuildTreeFromFilesFunction · 0.85
BuildFlatTreeFromFilesFunction · 0.85
UserConfigMethod · 0.80

Tested by 2

TestRenderFileTreeFunction · 0.76