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
---@return boolean
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)
return node
and M.config.modified.enable
and M._modified[node.absolute_path]
and (not dir or M.config.modified.show_on_dirs)
and (not (dir and dir.open) or M.config.modified.show_on_open_dirs)
if dir then
if not M.config.modified.show_on_dirs then
return false
end
if dir.open and not M.config.modified.show_on_open_dirs then
return false
end
end
return true
end
---A buffer exists for the node's absolute path