chore: resolve undefined-field

This commit is contained in:
Alexander Courtis
2024-10-26 13:19:47 +11:00
parent 868a5ef751
commit d631ee1ebb
2 changed files with 5 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
local DirectoryNode = require("nvim-tree.node.directory")
local M = {}
---@type table<string, boolean> record of which file is modified
@@ -27,8 +29,8 @@ function M.is_modified(node)
return node
and M.config.modified.enable
and M._modified[node.absolute_path]
and (not node.nodes or M.config.modified.show_on_dirs)
and (not node.open or M.config.modified.show_on_open_dirs)
and (not node:is(DirectoryNode) or M.config.modified.show_on_dirs)
and (not (node:is(DirectoryNode) and node.open) or M.config.modified.show_on_open_dirs)
end
---A buffer exists for the node's absolute path