Repository navigation
Conversation
…nc git load Closed directories explored while git status was in flight kept the children filtered against the empty status, and reopening them does not explore them again. Walk every explored directory instead of the open ones only. Document that git.timeout still applies and that reloads still block, and add line comments to the changed functions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved Git-refresh issues can leave hidden directories stale, overwrite grouped submodule statuses and filters, and allow older initial-scan results to replace newer updates.
3 open issues
What changed in this PR
Adds an opt-in asynchronous initial Git status load to reduce blocking when opening large repositories, addressing #3394 while keeping tree construction synchronous.
Changes:
- Adds
experimental.git_async_load, disabled by default. - Loads initial Git status in the background, then refreshes explored directories and restores cursor focus.
- Documents temporary filter behavior, timeout handling, and synchronous reloads.
| File | Description |
|---|---|
lua/nvim-tree/git/init.lua |
Implements asynchronous initial loading, completion refreshes, and shared watcher creation. |
lua/nvim-tree/config.lua |
Adds the disabled-by-default experimental option. |
lua/nvim-tree/_meta/config/experimental.lua |
Defines and documents the option and its limitations. |
doc/nvim-tree-lua.txt |
Updates help text and the default configuration example. |
Review effort: Balanced
Author
|
The Copilot review on this PR was requested automatically by my GitHub settings. I did not intend it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

resolves #3394
Design
Opening a large repository of my notes was slow, so I wanted the git status to be loaded lazily.
experimental.git_async_load, off by default.Explorer:_loadis unchanged), and only the git status is loaded later. This keeps the change small and insidelua/nvim-tree/git/init.lua.git_ignoredfiles are shown andgit_cleanhides every file. I think a short time without git status is better than Nvim blocking.AI usage
AI used: Claude (Claude Opus 5.5) in Claude Code. The code was also reviewed by another Claude model (Claude Fable 5.2).
All code and documentation in this PR were written by Claude. None was written by me.
What I did:
git/init.lua, and followinggit.timeoutTesting
Claude ran these tests and I reviewed the results.
git_ignoredandgit_cleanon and off, and opening at the root, expanding after loading, or opening a file withfind_file. 14 were identical. The other 2 are the known difference documented in the option: withgit_clean,find_filecannot find the file while the status is loading.make lint,make check,make style,make style-doc,make format-checkandmake help-updatepass.I also tried it with my own configuration in the large repository, and opening it is clearly faster.