Skip to content

Commit d19f68b

Browse files
committed
chore: resolve undefined-field
1 parent bb23127 commit d19f68b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lua/nvim-tree/buffers.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ end
2626
---@param node Node
2727
---@return boolean
2828
function M.is_modified(node)
29+
local dir = node:as(DirectoryNode)
2930
return node
3031
and M.config.modified.enable
3132
and M._modified[node.absolute_path]
32-
and (not node:is(DirectoryNode) or M.config.modified.show_on_dirs)
33-
and (not (node:is(DirectoryNode) and node.open) or M.config.modified.show_on_open_dirs)
33+
and (not dir or M.config.modified.show_on_dirs)
34+
and (not (dir and dir.open) or M.config.modified.show_on_open_dirs)
3435
end
3536

3637
---A buffer exists for the node's absolute path

0 commit comments

Comments
 (0)