Shell: Sort CompletionSuggestions for paths lexicographically

This used to be ordered by inode, which can be surprising.
This commit is contained in:
Ben Wiederhake 2022-09-12 14:28:16 +02:00 committed by Sam Atkins
parent 802cf9bc69
commit 0e901f8c68

View file

@ -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;
}