-
-
Notifications
You must be signed in to change notification settings - Fork 623
Abort iteration when fs-event-incapable #2867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -40,22 +40,24 @@ local function populate_children(handle, cwd, node, git_status, parent) | |||
---@type uv.fs_stat.result|nil | ||||
local stat = vim.loop.fs_stat(abs) | ||||
local filter_reason = parent.filters:should_filter_as_reason(abs, stat, filter_status) | ||||
if filter_reason == FILTER_REASON.none and not nodes_by_path[abs] and Watcher.is_fs_event_capable(abs) then | ||||
local child = nil | ||||
if t == "directory" and vim.loop.fs_access(abs, "R") then | ||||
child = builders.folder(node, abs, name, stat) | ||||
elseif t == "file" then | ||||
child = builders.file(node, abs, name, stat) | ||||
elseif t == "link" then | ||||
local link = builders.link(node, abs, name, stat) | ||||
if link.link_to ~= nil then | ||||
child = link | ||||
if filter_reason == FILTER_REASON.none and not nodes_by_path[abs] then | ||||
if Watcher.is_fs_event_capable(abs) then | ||||
local child = nil | ||||
if t == "directory" and vim.loop.fs_access(abs, "R") then | ||||
child = builders.folder(node, abs, name, stat) | ||||
elseif t == "file" then | ||||
child = builders.file(node, abs, name, stat) | ||||
elseif t == "link" then | ||||
local link = builders.link(node, abs, name, stat) | ||||
if link.link_to ~= nil then | ||||
child = link | ||||
end | ||||
end | ||||
if child then | ||||
table.insert(node.nodes, child) | ||||
nodes_by_path[child.absolute_path] = true | ||||
explorer_node.update_git_status(child, node_ignored, git_status) | ||||
end | ||||
end | ||||
if child then | ||||
table.insert(node.nodes, child) | ||||
nodes_by_path[child.absolute_path] = true | ||||
explorer_node.update_git_status(child, node_ignored, git_status) | ||||
end | ||||
else | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was added recently and appears it will execute despite I reckon we should wrap that test around the whole block, something like: local abs = utils.path_join { cwd, name }
if Watcher.is_fs_event_capable(abs) then Defering to @evertonse on this one :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could live dangerously and optimise this a little, only testing when
|
||||
for reason, value in pairs(FILTER_REASON) do | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a change in behaviour for all users; unfortunately we can't do that.