mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00: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;
|
return suggestions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue