mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
Shell: Sort CompletionSuggestions for paths lexicographically
This used to be ordered by inode, which can be surprising.
This commit is contained in:
parent
802cf9bc69
commit
0e901f8c68
Notes:
sideshowbarker
2024-07-17 07:13:52 +09:00
Author: https://github.com/BenWiederhake
Commit: 0e901f8c68
Pull-request: https://github.com/SerenityOS/serenity/pull/15207
1 changed files with 4 additions and 0 deletions
|
@ -1519,6 +1519,10 @@ Vector<Line::CompletionSuggestion> Shell::complete_path(StringView base, StringV
|
|||
}
|
||||
}
|
||||
|
||||
// The results of DirIterator are in the order they appear on-disk.
|
||||
// Instead, return suggestions in lexicographical order.
|
||||
quick_sort(suggestions, [](auto& a, auto& b) { return a.text_string < b.text_string; });
|
||||
|
||||
return suggestions;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue