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

Function RenderFileTree

pkg/gui/presentation/files.go:22–36  ·  view source on GitHub ↗
(
	tree filetree.IFileTree,
	submoduleConfigs []*models.SubmoduleConfig,
	showFileIcons bool,
	showNumstat bool,
	customIconsConfig *config.CustomIconsConfig,
	showRootItem bool,
)

Source from the content-addressed store, hash-verified

20)
21
22func RenderFileTree(
23 tree filetree.IFileTree,
24 submoduleConfigs []*models.SubmoduleConfig,
25 showFileIcons bool,
26 showNumstat bool,
27 customIconsConfig *config.CustomIconsConfig,
28 showRootItem bool,
29) []string {
30 collapsedPaths := tree.CollapsedPaths()
31 return renderAux(tree.GetRoot().Raw(), collapsedPaths, -1, -1, func(node *filetree.Node[models.File], treeDepth int, visualDepth int, isCollapsed bool) string {
32 fileNode := filetree.NewFileNode(node)
33
34 return getFileLine(isCollapsed, fileNode.GetHasUnstagedChanges(), fileNode.GetHasStagedChanges(), treeDepth, visualDepth, showNumstat, showFileIcons, submoduleConfigs, node, customIconsConfig, showRootItem)
35 })
36}
37
38func RenderCommitFileTree(
39 tree *filetree.CommitFileTreeViewModel,

Callers 2

NewWorkingTreeContextFunction · 0.92
TestRenderFileTreeFunction · 0.85

Calls 8

GetHasUnstagedChangesMethod · 0.95
GetHasStagedChangesMethod · 0.95
NewFileNodeFunction · 0.92
renderAuxFunction · 0.85
getFileLineFunction · 0.85
CollapsedPathsMethod · 0.65
GetRootMethod · 0.65
RawMethod · 0.45

Tested by 1

TestRenderFileTreeFunction · 0.68