File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,12 @@ function M.get_icon_state()
64
64
}
65
65
end
66
66
67
+ function M .use_git ()
68
+ return M .get_icon_state ().show_git_icon
69
+ or vim .g .nvim_tree_git_hl == 1
70
+ or vim .g .nvim_tree_gitignore == 1
71
+ end
72
+
67
73
function M .nvim_tree_callback (callback_name )
68
74
return string.format (" :lua require'nvim-tree'.on_keypress('%s')<CR>" , callback_name )
69
75
end
Original file line number Diff line number Diff line change @@ -152,12 +152,10 @@ end
152
152
function M .refresh_tree ()
153
153
if vim .v .exiting ~= vim .NIL then return end
154
154
155
+ local use_git = config .use_git ()
156
+ if use_git then git .reload_roots () end
155
157
refresh_nodes (M .Tree )
156
-
157
- if config .get_icon_state ().show_git_icon or vim .g .nvim_tree_git_hl == 1 then
158
- git .reload_roots ()
159
- refresh_git (M .Tree )
160
- end
158
+ if use_git then refresh_git (M .Tree ) end
161
159
162
160
if vim .g .nvim_tree_lsp_diagnostics == 1 then
163
161
diagnostics .update ()
You can’t perform that action at this time.
0 commit comments