You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plenary.scandirrespect_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.
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.
The text was updated successfully, but these errors were encountered:
I had noticed some quirky behavior here but I never dug in enough to realize what the issue is.
We definitely don't want to scan the whole tree recursively from the root because lots of people (me included) have some deep folder structures, especially if you go up to the home folder or higher.
I think what I would do is to create and store a gitignore filter on every new scan (without a parent_id) and re-use that for all lazy loaded folders. We also have to make sure that it always searches up the tree and find the right gitignore if this doesn't happen already in plenary.
If you have working fix, feel free to submit a PR or draft PR.
What I have right now just checks the root directory for a .gitignore file, but as you mentioned this doesn't handle a lot of cases. I'll create a draft PR with what I have right now, and we can discuss how to handle those.
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. Thedo_scan
function infs_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
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 methodplenary.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.
The text was updated successfully, but these errors were encountered: