Revert "refactor(#2871, #2886): multi instance: node classes created (#2916)"

This reverts commit 38aac09151.
This commit is contained in:
Alexander Courtis
2024-10-08 18:07:47 +11:00
parent 010ae0365a
commit 50e919426a
43 changed files with 742 additions and 835 deletions

View File

@@ -68,14 +68,14 @@ function Builder:new(opts, explorer)
virtual_lines = {},
decorators = {
-- priority order
DecoratorCut:create(opts, explorer),
DecoratorCopied:create(opts, explorer),
DecoratorDiagnostics:create(opts, explorer),
DecoratorBookmarks:create(opts, explorer),
DecoratorModified:create(opts, explorer),
DecoratorHidden:create(opts, explorer),
DecoratorOpened:create(opts, explorer),
DecoratorGit:create(opts, explorer),
DecoratorCut:new(opts, explorer),
DecoratorCopied:new(opts, explorer),
DecoratorDiagnostics:new(opts, explorer),
DecoratorBookmarks:new(opts, explorer),
DecoratorModified:new(opts, explorer),
DecoratorHidden:new(opts, explorer),
DecoratorOpened:new(opts, explorer),
DecoratorGit:new(opts, explorer),
},
hidden_display = Builder:setup_hidden_display_function(opts),
}
@@ -137,7 +137,7 @@ function Builder:unwrap_highlighted_strings(highlighted_strings)
end
---@private
---@param node Node
---@param node table
---@return HighlightedString icon
---@return HighlightedString name
function Builder:build_folder(node)
@@ -189,7 +189,7 @@ function Builder:build_symlink(node)
end
---@private
---@param node Node
---@param node table
---@return HighlightedString icon
---@return HighlightedString name
function Builder:build_file(node)
@@ -369,7 +369,7 @@ function Builder:build_line(node, idx, num_children)
self.index = self.index + 1
node = node:last_group_node()
node = require("nvim-tree.lib").get_last_group_node(node)
if node.open then
self.depth = self.depth + 1
self:build_lines(node)
@@ -487,7 +487,7 @@ function Builder:build()
return self
end
---@private
---TODO refactor back to function; this was left here to reduce PR noise
---@param opts table
---@return fun(node: Node): string|nil
function Builder:setup_hidden_display_function(opts)