@@ -35,37 +35,40 @@ local function populate_children(handle, cwd, node, git_status, parent)
35
35
end
36
36
37
37
local abs = utils .path_join { cwd , name }
38
- local profile = log .profile_start (" explore populate_children %s" , abs )
39
-
40
- --- @type uv.fs_stat.result | nil
41
- local stat = vim .loop .fs_stat (abs )
42
- local filter_reason = parent .filters :should_filter_as_reason (abs , stat , filter_status )
43
- if filter_reason == FILTER_REASON .none and not nodes_by_path [abs ] and Watcher .is_fs_event_capable (abs ) then
44
- local child = nil
45
- if t == " directory" and vim .loop .fs_access (abs , " R" ) then
46
- child = builders .folder (node , abs , name , stat )
47
- elseif t == " file" then
48
- child = builders .file (node , abs , name , stat )
49
- elseif t == " link" then
50
- local link = builders .link (node , abs , name , stat )
51
- if link .link_to ~= nil then
52
- child = link
38
+
39
+ if Watcher .is_fs_event_capable (abs ) then
40
+ local profile = log .profile_start (" explore populate_children %s" , abs )
41
+
42
+ --- @type uv.fs_stat.result | nil
43
+ local stat = vim .loop .fs_stat (abs )
44
+ local filter_reason = parent .filters :should_filter_as_reason (abs , stat , filter_status )
45
+ if filter_reason == FILTER_REASON .none and not nodes_by_path [abs ] then
46
+ local child = nil
47
+ if t == " directory" and vim .loop .fs_access (abs , " R" ) then
48
+ child = builders .folder (node , abs , name , stat )
49
+ elseif t == " file" then
50
+ child = builders .file (node , abs , name , stat )
51
+ elseif t == " link" then
52
+ local link = builders .link (node , abs , name , stat )
53
+ if link .link_to ~= nil then
54
+ child = link
55
+ end
53
56
end
54
- end
55
- if child then
56
- table.insert ( node . nodes , child )
57
- nodes_by_path [ child . absolute_path ] = true
58
- explorer_node . update_git_status ( child , node_ignored , git_status )
59
- end
60
- else
61
- for reason , value in pairs ( FILTER_REASON ) do
62
- if filter_reason == value then
63
- node . hidden_stats [ reason ] = node . hidden_stats [ reason ] + 1
57
+ if child then
58
+ table.insert ( node . nodes , child )
59
+ nodes_by_path [ child . absolute_path ] = true
60
+ explorer_node . update_git_status ( child , node_ignored , git_status )
61
+ end
62
+ else
63
+ for reason , value in pairs ( FILTER_REASON ) do
64
+ if filter_reason == value then
65
+ node . hidden_stats [ reason ] = node . hidden_stats [ reason ] + 1
66
+ end
64
67
end
65
68
end
66
- end
67
69
68
- log .profile_end (profile )
70
+ log .profile_end (profile )
71
+ end
69
72
end
70
73
end
71
74
0 commit comments