refactor(renderer): extract build line function
This commit is contained in:
@@ -182,8 +182,7 @@ function Builder:_build_file(node, padding, git_highlight)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function Builder:build(tree)
|
function Builder:_build_line(tree, node, idx)
|
||||||
for idx, node in ipairs(tree.nodes) do
|
|
||||||
local padding = pad.get_padding(self.depth, idx, tree, node, self.markers)
|
local padding = pad.get_padding(self.depth, idx, tree, node, self.markers)
|
||||||
|
|
||||||
if self.depth > 0 then
|
if self.depth > 0 then
|
||||||
@@ -211,6 +210,11 @@ function Builder:build(tree)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Builder:build(tree)
|
||||||
|
for idx, node in ipairs(tree.nodes) do
|
||||||
|
self:_build_line(tree, node, idx)
|
||||||
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user