Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/nvim-tree-lua.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2276,6 +2276,7 @@ Following is the default configuration, see |nvim_tree.config| for details. >lua
"/build",
"/node_modules",
"/target",
"/.zig-cache",
},
},
actions = {
Expand Down
11 changes: 7 additions & 4 deletions lua/nvim-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ function M.open_on_directory()
return
end


local explorer = core.get_explorer()
if not explorer then
core.init(bufname)
Expand Down Expand Up @@ -469,6 +468,7 @@ local DEFAULT_OPTS = { -- default-config-start
"/build",
"/node_modules",
"/target",
"/.zig-cache",
},
},
actions = {
Expand Down Expand Up @@ -642,7 +642,7 @@ local ACCEPTED_STRINGS = {
local ACCEPTED_ENUMS = {
view = {
width = {
lines_excluded = { "root", },
lines_excluded = { "root" },
},
},
}
Expand Down Expand Up @@ -683,8 +683,11 @@ local function validate_options(conf)

if enum_value then
if not vim.tbl_contains(enums, v) then
invalid = string.format("Invalid value for field %s%s: Expected one of enum '%s', got '%s'", prefix, k,
table.concat(enums, "'|'"), tostring(v))
invalid = string.format("Invalid value for field %s%s: Expected one of enum '%s', got '%s'",
prefix,
k,
table.concat(enums, "'|'"),
tostring(v))
end
else
if def[k] == nil and types[k] == nil then
Expand Down
22 changes: 14 additions & 8 deletions lua/nvim-tree/explorer/watch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 or true then
ignore_dir = ignore_dir:gsub("/", "\\") or ignore_dir
end

if vim.fn.match(path, ignore_dir) ~= -1 then
return true
end
Expand Down Expand Up @@ -76,13 +80,15 @@ function M.create_watcher(node)

-- disable watcher when outstanding exceeds max
if watcher.data.outstanding_events > M.config.filesystem_watchers.max_events then
notify.error(string.format(
"Observed %d consecutive file system events with interval < %dms, exceeding filesystem_watchers.max_events=%s. Disabling watcher for directory '%s'. Consider adding this directory to filesystem_watchers.ignore_dirs",
watcher.data.outstanding_events,
M.config.filesystem_watchers.max_events,
M.config.filesystem_watchers.debounce_delay,
node.absolute_path
))
notify.error(
string.format(
"Observed %d consecutive file system events with interval < %dms, exceeding filesystem_watchers.max_events=%s. Disabling watcher for directory '%s'. Consider adding this directory to filesystem_watchers.ignore_dirs",
watcher.data.outstanding_events,
M.config.filesystem_watchers.max_events,
M.config.filesystem_watchers.debounce_delay,
node.absolute_path
)
)
node:destroy_watcher()
end

Expand Down Expand Up @@ -110,7 +116,7 @@ function M.create_watcher(node)
data = {
context = "explorer:watch:" .. path .. ":" .. M.uid,
outstanding_events = 0, -- unprocessed events that have not been debounced
}
},
})
end

Expand Down
Loading