-
Notifications
You must be signed in to change notification settings - Fork 271
Description
At least as how I would expect it to.
The plenary.scandir respect_gitignore flag filters out entries in the current scan IFF a .gitignore file is present in the root of the path it scans. The do_scan function in fs_scan.lua scans with a depth of 1, so each time a folder is opened, a new scan is done with the path of that directory, which has the effect that a .gitignore in the root directory isn't picked up.
An example would be
.config/nvim/
|- lua/
|- packer_compiled.lua
|- .gitignore
with .gitignore containing lua/packer_compiled.lua; packer_compiled.lua is still visible in the tree.
One solution is to create a gitignore filter in fs_scan.lua and do the filtering there. This can easily be done by just copying the method plenary.scandir uses.
Another one is just scan the whole tree at once and on any refresh and so on, but that might be detrimental when there are a lot of files.
I have implemented the first solution and it works well. Another benefit of doing it that way is that ignored files could be highlighted differently.