feat(#2799): filesystem_watchers.ignore_dirs and git.disable_for_dirs may be functions (#2800)

feat(#2799): filesystem_watchers.ignore_dirs and git.disable_for_dirs may be functions
This commit is contained in:
Alexander Courtis
2024-06-23 11:44:45 +10:00
committed by GitHub
parent 2086e564c4
commit 8b2c5c678b
4 changed files with 31 additions and 12 deletions

View File

@@ -40,10 +40,14 @@ local function is_folder_ignored(path)
end
end
for _, ignore_dir in ipairs(M.config.filesystem_watchers.ignore_dirs) do
if vim.fn.match(path, ignore_dir) ~= -1 then
return true
if type(M.config.filesystem_watchers.ignore_dirs) == "table" then
for _, ignore_dir in ipairs(M.config.filesystem_watchers.ignore_dirs) do
if vim.fn.match(path, ignore_dir) ~= -1 then
return true
end
end
elseif type(M.config.filesystem_watchers.ignore_dirs) == "function" then
return M.config.filesystem_watchers.ignore_dirs(path)
end
return false