File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,18 @@ function M.reload(node, status)
41
41
break
42
42
end
43
43
44
+ local stat
45
+ local function fs_stat_cached (path )
46
+ if stat ~= nil then
47
+ return stat
48
+ end
49
+
50
+ stat = uv .fs_stat (path )
51
+ return stat
52
+ end
53
+
44
54
local abs = utils .path_join { cwd , name }
45
- t = t or (uv . fs_stat (abs ) or {}).type
55
+ t = t or (fs_stat_cached (abs ) or {}).type
46
56
if not filters .should_ignore (abs ) and not filters .should_ignore_git (abs , status .files ) then
47
57
child_names [abs ] = true
48
58
@@ -73,10 +83,12 @@ function M.reload(node, status)
73
83
table.insert (node .nodes , link )
74
84
end
75
85
end
76
- end
77
- local n = nodes_by_path [abs ]
78
- if n then
79
- n .executable = builders .is_executable (abs , n .extension or " " )
86
+ else
87
+ local n = nodes_by_path [abs ]
88
+ if n then
89
+ n .executable = builders .is_executable (abs , n .extension or " " )
90
+ n .fs_stat = fs_stat_cached (abs )
91
+ end
80
92
end
81
93
end
82
94
end
You can’t perform that action at this time.
0 commit comments