Skip to content

Commit b754eb8

Browse files
authored
fix(explorer): reload executable stat (#1427)
1 parent f85b4d9 commit b754eb8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lua/nvim-tree/explorer/node-builders.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function M.folder(parent, absolute_path, name)
2323
}
2424
end
2525

26-
local function is_executable(absolute_path, ext)
26+
function M.is_executable(absolute_path, ext)
2727
if M.is_windows then
2828
return utils.is_windows_exe(ext)
2929
end
@@ -35,7 +35,7 @@ function M.file(parent, absolute_path, name)
3535

3636
return {
3737
absolute_path = absolute_path,
38-
executable = is_executable(absolute_path, ext),
38+
executable = M.is_executable(absolute_path, ext),
3939
extension = ext,
4040
fs_stat = uv.fs_stat(absolute_path),
4141
name = name,

lua/nvim-tree/explorer/reload.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ function M.reload(node, status)
6262
end
6363
end
6464
end
65+
local n = nodes_by_path[abs]
66+
if n then
67+
n.executable = builders.is_executable(abs, n.extension)
68+
end
6569
end
6670
end
6771

0 commit comments

Comments
 (0)