From 738a6df77d584392304b92dc65f2ed735ca32966 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 30 May 2022 18:53:32 -0700 Subject: [PATCH] Switch complete_flags_t to uint8 and stop skipping 1<<1 --- src/complete.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/complete.h b/src/complete.h index f8cca79d5..7d0fbb2b5 100644 --- a/src/complete.h +++ b/src/complete.h @@ -33,20 +33,20 @@ enum { /// a space). COMPLETE_NO_SPACE = 1 << 0, /// This is not the suffix of a token, but replaces it entirely. - COMPLETE_REPLACES_TOKEN = 1 << 2, + COMPLETE_REPLACES_TOKEN = 1 << 1, /// This completion may or may not want a space at the end - guess by checking the last /// character of the completion. - COMPLETE_AUTO_SPACE = 1 << 3, + COMPLETE_AUTO_SPACE = 1 << 2, /// This completion should be inserted as-is, without escaping. - COMPLETE_DONT_ESCAPE = 1 << 4, + COMPLETE_DONT_ESCAPE = 1 << 3, /// If you do escape, don't escape tildes. - COMPLETE_DONT_ESCAPE_TILDES = 1 << 5, + COMPLETE_DONT_ESCAPE_TILDES = 1 << 4, /// Do not sort supplied completions - COMPLETE_DONT_SORT = 1 << 6, + COMPLETE_DONT_SORT = 1 << 5, /// This completion looks to have the same string as an existing argument. - COMPLETE_DUPLICATES_ARGUMENT = 1 << 7 + COMPLETE_DUPLICATES_ARGUMENT = 1 << 6, }; -using complete_flags_t = int; +using complete_flags_t = uint8_t; /// std::function which accepts a completion string and returns its description. using description_func_t = std::function; @@ -70,10 +70,6 @@ class completion_t { /// The type of fuzzy match. string_fuzzy_match_t match; /// Flags determining the completion behavior. - /// - /// Determines whether a space should be inserted after this completion if it is the only - /// possible completion using the COMPLETE_NO_SPACE flag. The COMPLETE_NO_CASE can be used to - /// signal that this completion is case insensitive. complete_flags_t flags; // Construction.