Skip to content

fix: Gitignore rules not being applied on new nodes. #415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lua/nvim-tree/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ function M.get_icon_state()
}
end

function M.use_git()
return M.get_icon_state().show_git_icon
or vim.g.nvim_tree_git_hl == 1
or vim.g.nvim_tree_gitignore == 1
end

function M.nvim_tree_callback(callback_name)
return string.format(":lua require'nvim-tree'.on_keypress('%s')<CR>", callback_name)
end
Expand Down
8 changes: 3 additions & 5 deletions lua/nvim-tree/lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,10 @@ end
function M.refresh_tree()
if vim.v.exiting ~= vim.NIL then return end

local use_git = config.use_git()
if use_git then git.reload_roots() end
refresh_nodes(M.Tree)

if config.get_icon_state().show_git_icon or vim.g.nvim_tree_git_hl == 1 then
git.reload_roots()
refresh_git(M.Tree)
end
if use_git then refresh_git(M.Tree) end

if vim.g.nvim_tree_lsp_diagnostics == 1 then
diagnostics.update()
Expand Down