mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05: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
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
Reference in a new issue