Skip to content

Commit c1466f9

Browse files
authored
fix(#2327): set parent folder git ignore status following file update (#2328)
* fix(#1931): do not execute git status in git ignored directories * fix(#1931): reload.refresh_node is always asynchronous * fix(#2327): set parent folder ignore status following file update
1 parent 273c170 commit c1466f9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lua/nvim-tree/explorer/node.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function M.get_git_status(node)
111111
end
112112

113113
function M.is_git_ignored(node)
114-
return node.git_status and node.git_status.file == "!!"
114+
return node and node.git_status and node.git_status.file == "!!"
115115
end
116116

117117
function M.node_destroy(node)

lua/nvim-tree/explorer/reload.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030

3131
local function update_parent_statuses(node, project, root)
3232
while project and node and node.absolute_path ~= root do
33-
explorer_node.update_git_status(node, false, project)
33+
explorer_node.update_git_status(node, explorer_node.is_git_ignored(node.parent), project)
3434
node = node.parent
3535
end
3636
end

0 commit comments

Comments
 (0)