chore: resolve undefined-field

This commit is contained in:
Alexander Courtis
2024-10-26 12:43:19 +11:00
parent 3d00128041
commit 568d0f15ab
9 changed files with 110 additions and 111 deletions

View File

@@ -1,5 +1,3 @@
local git = require("nvim-tree.git")
local Class = require("nvim-tree.class")
---Abstract Node class.
@@ -52,38 +50,6 @@ function Node:is_dotfile()
return false
end
---@param project table?
---@param root string?
function Node:update_parent_statuses(project, root)
local node = self
while project and node do
-- step up to the containing project
if node.absolute_path == root then
-- stop at the top of the tree
if not node.parent then
break
end
root = git.get_toplevel(node.parent.absolute_path)
-- stop when no more projects
if not root then
break
end
-- update the containing project
project = git.get_project(root)
git.reload_project(root, node.absolute_path, nil)
end
-- update status
node:update_git_status(node.parent and node.parent:is_git_ignored() or false, project)
-- maybe parent
node = node.parent
end
end
---Get the highest parent of grouped nodes, nil when not grouped
---@return DirectoryNode?
function Node:get_parent_of_group()