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

@@ -1,31 +0,0 @@
local DirectoryNode = require("nvim-tree.node.directory")
local LinkNode = require("nvim-tree.node.link")
local FileNode = require("nvim-tree.node.file")
local Watcher = require("nvim-tree.watcher")
local M = {}
---Factory function to create the appropriate Node
---@param explorer Explorer
---@param parent Node
---@param abs string
---@param stat uv.fs_stat.result? -- on nil stat return nil Node
---@param name string
---@return Node?
function M.create_node(explorer, parent, abs, stat, name)
if not stat then
return nil
end
if stat.type == "directory" and vim.loop.fs_access(abs, "R") and Watcher.is_fs_event_capable(abs) then
return DirectoryNode:create(explorer, parent, abs, name, stat)
elseif stat.type == "file" then
return FileNode:create(explorer, parent, abs, name, stat)
elseif stat.type == "link" then
return LinkNode:create(explorer, parent, abs, name, stat)
end
return nil
end
return M