diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-08-31 15:01:02 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-08-31 15:01:02 -0700 |
commit | c38a40d1930d0af2f0d078896fe02fd0bee5fabd (patch) | |
tree | 2e70a5cbdd863bde7373ffaa9972a0cd5aaa0c10 /complete.h | |
parent | 23ba7b5bfff9393d222cd8e4a045e3439e24aba1 (diff) |
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
Diffstat (limited to 'complete.h')
-rw-r--r-- | complete.h | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -127,11 +127,10 @@ public: completion_t(const wcstring &comp, const wcstring &desc = L"", string_fuzzy_match_t match = string_fuzzy_match_t(fuzzy_match_exact), int flags_val = 0); completion_t(const completion_t &); completion_t &operator=(const completion_t &); - - /* The following are needed for sorting and uniquing completions */ - bool operator < (const completion_t& rhs) const; - bool operator == (const completion_t& rhs) const; - bool operator != (const completion_t& rhs) const; + + /* Compare two completions. No operating overlaoding to make this always explicit (there's potentially multiple ways to complare completions). */ + static bool is_alphabetically_less_than(const completion_t &a, const completion_t &b); + static bool is_alphabetically_equal_to(const completion_t &a, const completion_t &b); }; enum @@ -146,9 +145,6 @@ typedef uint32_t completion_request_flags_t; /** Given a list of completions, returns a list of their completion fields */ wcstring_list_t completions_to_wcstring_list(const std::vector<completion_t> &completions); -/** Sorts a list of completions */ -void sort_completions(std::vector<completion_t> &completions); - /** Add a completion. |