Skip to content

filesystem_watchers.ignore_dirs and git.disable_for_dirs functions #2799

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
alex-courtis opened this issue Jun 9, 2024 · 0 comments · Fixed by #2800
Closed

filesystem_watchers.ignore_dirs and git.disable_for_dirs functions #2799

alex-courtis opened this issue Jun 9, 2024 · 0 comments · Fixed by #2800

Comments

@alex-courtis
Copy link
Member

alex-courtis commented Jun 9, 2024

Can this functionality be implemented utilising API?
no, static config

Is your feature request related to a problem? Please describe.
Ignore directories based on dynamic conditions.

Describe the solution you'd like
filesystem_watchers.ignore_dirs and git.disable_for_dirs can be fun(string): boolean where string is the absolute path of the directory.

Describe alternatives you've considered
Setting dirs dynamically before setup.

Additional context
Use case:

local IGNORE_PATHS = {
  vim.env.HOME .. "/src/nvim-tree/r/dyn/foo",
  vim.env.HOME .. "/src/nvim-tree/r/dyn/bar",
}
local function ignore_path(path)
  for _, p in ipairs(IGNORE_PATHS) do
    if path:find(p, 1, true) == 1 then
      return true
    end
  end
  return false
end

foo/master, foo/worktree1 and bar repos will return false

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
1 participant