Project panel from lexicographical to natural sorting. #20126
TomPlanche
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
You're definitely not supposed to change things forever, but simply replacing the sorting mechanism: someone prefers things the other way around. What's really needed is multiple sorting modes and a way to toggle between them. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While working on Leetcode problems, I stumbled upon a project panel sorting who bothered me.
The folders (and files) are lexicographicaly sorted...
This is annoying and not natural.
I found that the responsible for this is
sort_worktree_entries
in thecrates/project/src/project.rs
file used in the line 2005project::sort_worktree_entries(&mut visible_worktree_entries);
of the./project_panel/src/project_panel.rs
file.This uses the
./crates/util/src/paths.rs
'scompare_paths
function.I changed the function from:
to
Now the folders and files are in alphabetical order.
In order for the
./project_panel/src/project_panel.rs
's test to pass, I had to change them.Changing the order of the folders but for some of the tests (), the changes are weird:
Beta Was this translation helpful? Give feedback.
All reactions