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
|
||||
|
||||
function Builder:build(tree)
|
||||
for idx, node in ipairs(tree.nodes) do
|
||||
function Builder:_build_line(tree, node, idx)
|
||||
local padding = pad.get_padding(self.depth, idx, tree, node, self.markers)
|
||||
|
||||
if self.depth > 0 then
|
||||
@@ -211,6 +210,11 @@ function Builder:build(tree)
|
||||
end
|
||||
end
|
||||
|
||||
function Builder:build(tree)
|
||||
for idx, node in ipairs(tree.nodes) do
|
||||
self:_build_line(tree, node, idx)
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user