aboutsummaryrefslogtreecommitdiffhomepage
path: root/complete.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-08-31 15:01:02 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-08-31 15:01:02 -0700
commitc38a40d1930d0af2f0d078896fe02fd0bee5fabd (patch)
tree2e70a5cbdd863bde7373ffaa9972a0cd5aaa0c10 /complete.h
parent23ba7b5bfff9393d222cd8e4a045e3439e24aba1 (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.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/complete.h b/complete.h
index da94bacd..85208d69 100644
--- a/complete.h
+++ b/complete.h
@@ -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.