chore: resolve undefined-field

This commit is contained in:
Alexander Courtis
2024-10-27 14:37:59 +11:00
parent 5c46c9c58a
commit e82db1c44d
5 changed files with 46 additions and 62 deletions

View File

@@ -1,5 +1,3 @@
local git_utils = require("nvim-tree.git.utils")
local FileNode = require("nvim-tree.node.file")
---@class (exact) FileLinkNode: FileNode
@@ -32,11 +30,16 @@ function FileLinkNode:destroy()
FileNode.destroy(self)
end
-----Update the GitStatus of the target otherwise the link itself
-----@param parent_ignored boolean
-----@param status table|nil
---Update the GitStatus of the target otherwise the link itself
---@param parent_ignored boolean
---@param status table|nil
function FileLinkNode:update_git_status(parent_ignored, status)
self.git_status = git_utils.git_status_file(parent_ignored, status, self.link_to, self.absolute_path)
self.git_status = {}
if parent_ignored then
self.git_status.file = "!!"
elseif status and status.files then
self.git_status.file = status.files[self.link_to] or status.files[self.absolute_path]
end
end
---Create a sanitized partial copy of a node