diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index 8a484e99ae0..aac21502664 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -1707,7 +1707,7 @@ Config: filesystem_watchers *nvim-tree-config-filesystem-watchers* • {enable}? (`boolean`) (default: `true`) • {debounce_delay}? (`integer`, default: `50`) Idle milliseconds between filesystem change and tree update. - • {ignore_dirs}? (`string[]|(fun(path: string): boolean)`, default: `{ "/.ccls-cache", "/build", "/node_modules", "/target", }`) + • {ignore_dirs}? (`string[]|(fun(path: string): boolean)`, default: `{ "/.ccls-cache", "/build", "/node_modules", "/target", "/.zig-cache"}`) Disable for specific directories. • {max_events}? (`integer`, default: `1000`) Disable for a single directory after {max_events} consecutive events @@ -2188,6 +2188,7 @@ Following is the default configuration, see |nvim_tree.config| for details. >lua "/build", "/node_modules", "/target", + "/.zig-cache", }, }, actions = { diff --git a/lua/nvim-tree.lua b/lua/nvim-tree.lua index e8c301b9a94..32919d43a2e 100644 --- a/lua/nvim-tree.lua +++ b/lua/nvim-tree.lua @@ -469,6 +469,7 @@ local DEFAULT_OPTS = { -- default-config-start "/build", "/node_modules", "/target", + "/.zig-cache", }, }, actions = { diff --git a/lua/nvim-tree/_meta/config/filesystem_watchers.lua b/lua/nvim-tree/_meta/config/filesystem_watchers.lua index 65ebf5a4d95..fab0c968c95 100644 --- a/lua/nvim-tree/_meta/config/filesystem_watchers.lua +++ b/lua/nvim-tree/_meta/config/filesystem_watchers.lua @@ -27,7 +27,7 @@ error("Cannot require a meta file") ---@field debounce_delay? integer --- ---Disable for specific directories. ----(default: `{ "/.ccls-cache", "/build", "/node_modules", "/target", }`) +---(default: `{ "/.ccls-cache", "/build", "/node_modules", "/target", "/.zig-cache"}`) ---@field ignore_dirs? string[]|(fun(path: string): boolean) --- ---Disable for a single directory after {max_events} consecutive events with an interval < {debounce_delay}. diff --git a/lua/nvim-tree/explorer/watch.lua b/lua/nvim-tree/explorer/watch.lua index 2ce5051c69a..e6afa68abf4 100644 --- a/lua/nvim-tree/explorer/watch.lua +++ b/lua/nvim-tree/explorer/watch.lua @@ -44,6 +44,10 @@ local function is_folder_ignored(path) if type(M.config.filesystem_watchers.ignore_dirs) == "table" then for _, ignore_dir in ipairs(M.config.filesystem_watchers.ignore_dirs) do + if utils.is_windows then + ignore_dir = ignore_dir:gsub("/", "\\\\") or ignore_dir + end + if vim.fn.match(path, ignore_dir) ~= -1 then return true end