-
-
Notifications
You must be signed in to change notification settings - Fork 622
Issue on windows when trying to iterate through the Appliction Data directory(not the AppData directory)(Confusing I know) #2866
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
Comments
Happens for me as well on Windows 11. It occurs when I try to switch to while true do
local name, t = vim.loop.fs_scandir_next(handle)
if not name then
break
end
local abs = utils.path_join { cwd, name }
print(cwd, name)
-- The rest of the code here
end The error above appears just after the |
Fixes nvim-tree#2866. The original code, while detecting whether Windows NT allows the dir to be iterated through, will go to the other branch of the if...else... statement, which is intended for cases when filter_reason is not none. Simply moving `is_fs_event_capable` into the first branch should solve the problem.
Affecting me as well (Windows 11, Neovim v0.10.1, Powershell 7.4.4). Meanwhile I revert back to Nvim-Tree v1.5.0 |
@generic-coder-1 @aasril I'd be grateful if you tested a fix branch #2874 cd /path/to/nvim-tree.lua
git pull
git checkout 2866-windows-explorer-ignore-unenumerable-directories When you're finished testing: git checkout master |
@alex-courtis, sure! I checked out the branch and I don't get the error anymore. |
Ditto! Works perfectly on my end. |
I think this problem has fixed, that also works for me |
Description
Let me preface this with:
I barely know what I'm doing. I installed neovim yesterday and just started NvChad today. I am by no metric an expert in anything vim, neovim, lua, git, github, or windows related. I'm just trying to get this to work on my machine.
Basically the problem is when nvim-tree is iterating through the files from where I called
nvim
in the terminal which is the directory of the current user. In the user directory(directory of the user not a directory called user) there is another directory called "Application Data"(which I didn't even know existed before this issue)(not to be confused with the AppData directory). When nvim-tree hits the Application Data directory it crashes with this ugly error:After some debugging(and copious amounts of print statments) I was able to figure out that in this part of explore.lua:
the variable
reason
ends up beingFILTER_REASON.none
. Fortunately, I was able to find a fix(I have no clue whether or not this is an actual fix or a "fix" that will end up breaking something else later down the line but works for now). Shorty above the previous code snippet, in this section:If you add
none = 0,
it ends up working just fine. I would try and make a pull request but 1) I don't know how to and 2) It's about 11:30 PM and I don't have the energy to figure out howMore on the Application Data directory
After doing some research, I realize that this directory is weird. It doesn't show up in the default windows file explorer(even when you make hidden folders visible) or with the
dir
command(windows version of ls)(I was able to get it to show up withls
from Git tho). Apparently it's there for some backwards compatibility reason as stated here(It's for windows 10 but I assume it's the exact same for windows 11).Neovim version
Operating system and version
Windows 11
Windows variant
Command Prompt
nvim-tree version
ad0b95d
Clean room replication
Steps to reproduce
nvim -nu .\AppData\Local\nvim-data\tmp\nvt-min.lua
(AppData not Application Data)Expected behavior
Opens up the folder tree sidebar
Actual behavior
The text was updated successfully, but these errors were encountered: