-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
Add a shortlex sort order to the file explorer #66768
Comments
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines. Happy Coding! |
@isidorn would be nice to know which one, wasn't like I spent all that time writing up a detailed summary and not searching for existing issues... |
I'm going to assume it's this one. #27759 |
Yeah. There's also one about more sorting in the explorer. |
I just realized the sort order used in VS Code for file explorer is different than for example the Windows File Explorer.
This caught me by surprise. The reason for this is that the file name comparison function doesn't take into account the length of the file name. Under shortlex rules you would consider a file name of shorter length to be smaller than a file name of longer length.
I like the default layout with folders before files but I would like there to be an option to enable shortlex sorting. I think it's common enough to even argue that it should have been the default it's just an easily overlooked fact.
For example, this is what I get if I traverse the files using the
dir /b
command.This is exactly the way the files are returned from the file system, in this case NTFS. I could even argue that there is a miniscule benefit from having similar sort in the file explorer view as the files are handed to you by the underlying file system APIs (even if this is mostly a edge case on Windows).
I'm no expert on the VS Code codebase but I would presume that some change to these functions would be necessary so that they take length into consideration.
This could either be made as an toggle option, on top of existing sort rules, or it could just be made as a feature enhancement as I don't know for a fact, if the current file sort order was intended to not explicitly use shortlex rules or not. (I obviously think they should 😄)
The text was updated successfully, but these errors were encountered: