Adjust prefix completions to sort alphabetically instead of by length.

Other completions are still sorted by length.
https://github.com/fish-shell/fish-shell/issues/923
This commit is contained in:
ridiculousfish
2013-08-31 15:01:02 -07:00
parent 23ba7b5bff
commit c38a40d193
5 changed files with 23 additions and 31 deletions

View File

@@ -1766,7 +1766,7 @@ int expand_string(const wcstring &input, std::vector<completion_t> &output, expa
case 1:
{
res = EXPAND_WILDCARD_MATCH;
sort_completions(expanded);
std::sort(expanded.begin(), expanded.end(), completion_t::is_alphabetically_less_than);
out->insert(out->end(), expanded.begin(), expanded.end());
break;
}