chore: resolve undefined-field

This commit is contained in:
Alexander Courtis
2024-10-27 09:51:29 +11:00
parent 1f041c3422
commit bed7a072c3

View File

@@ -26,12 +26,26 @@ end
---@param node Node ---@param node Node
---@return boolean ---@return boolean
function M.is_modified(node) function M.is_modified(node)
if not M.config.modified.enable then
return false
end
if not M._modified[node.absolute_path] then
return false
end
local dir = node:as(DirectoryNode) local dir = node:as(DirectoryNode)
return node if dir then
and M.config.modified.enable if not M.config.modified.show_on_dirs then
and M._modified[node.absolute_path] return false
and (not dir or M.config.modified.show_on_dirs) end
and (not (dir and dir.open) or M.config.modified.show_on_open_dirs)
if dir.open and not M.config.modified.show_on_open_dirs then
return false
end
end
return true
end end
---A buffer exists for the node's absolute path ---A buffer exists for the node's absolute path