-
Notifications
You must be signed in to change notification settings - Fork 251
group empty directories #216
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
Lol, this sounds so Java. |
this would be very nice |
I just pushed this to require("neo-tree").setup({
filesystem = {
group_empty_dirs = true,
}
}) |
Thanks for implementing this feature! Not sure why but can we render collapsible directories earlier as well. Please see the demo where directory group_empty.mp4 |
The problem there is that those folders are being lazy loaded, and the grouping only runs on the set of folders being loaded in a particular scan, which is just the one level for a lazy load. I think what I should do is that when a folder is opened that contains nothing but a single sub folder, I should keep loading children until I get to the end of what should be collapsed so I can group the set of dirs in one go. |
Ok, this is fixed. I did not end up trying to look ahead and pre-group folders, I feel like that would be a dangerous can of worms I don't want to get into. It was surprisingly difficult to get this right. What it does now is that as you drill down into a folder that should be grouped, it just adds that extra level onto the current folder. |
Thanks for the fix! I think a great part of this feature would be to reduce keystrokes when expanding directories, so having to press |
@axieax But then it will be inconvenient to create a folder/file in the middle level. |
Oh that's true, although it shouldn't be too many extra steps with #269. I feel like navigation of nested folders is a more common use case than adding a file/folder within a middle level, especially since once this file/folder is added, |
I'm mostly concerned with performance issues. Right now I only fetch one level at a time and lazy load everything else. Pre-grouping requires pre-fetching recursively and then I have to deal with those users that have performance issues because they have 10,000 folders in their project, or who knows what other issue affecting their performance. The deciding factor for me is that I don't actually like the feature for the "filesystem" source myself, so I don't want to do anything risky with it. Someone else could try to take it on and I'd entertain a PR. I mainly did it because I wanted the feature for the "buffers" source which doesn't need any lazy loading at all. |
That could be confusing at first, but you can always input the new file/folder name with |
This feature does not exist.
Originally posted by @cseickel in #211 (comment)
The text was updated successfully, but these errors were encountered: