Skip to content

Commit bed7a07

Browse files
committed
chore: resolve undefined-field
1 parent 1f041c3 commit bed7a07

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

lua/nvim-tree/buffers.lua

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,26 @@ end
2626
---@param node Node
2727
---@return boolean
2828
function M.is_modified(node)
29+
if not M.config.modified.enable then
30+
return false
31+
end
32+
33+
if not M._modified[node.absolute_path] then
34+
return false
35+
end
36+
2937
local dir = node:as(DirectoryNode)
30-
return node
31-
and M.config.modified.enable
32-
and M._modified[node.absolute_path]
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)
38+
if dir then
39+
if not M.config.modified.show_on_dirs then
40+
return false
41+
end
42+
43+
if dir.open and not M.config.modified.show_on_open_dirs then
44+
return false
45+
end
46+
end
47+
48+
return true
3549
end
3650

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

0 commit comments

Comments
 (0)