From 46db0dd5eb59bc62f1b735b97ecbdece8c87f389 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 8 Jan 2018 22:34:14 -0800 Subject: [PATCH] Stop checking EXPAND_SPECIAL_FOR_CD if ..._AUTOSUGGEST is set If EXPAND_SPECIAL_FOR_CD_AUTOSUGGEST is set, EXPAND_SPECIAL_FOR_CD is necessarily also set; simplify things by only checking for the latter. --- src/wildcard.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wildcard.cpp b/src/wildcard.cpp index 93027fc24..ee924c1d4 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -584,11 +584,12 @@ class wildcard_expander_t { c->prepend_token_prefix(prefix); } - // Hack. Implement EXPAND_SPECIAL_FOR_CD by descending the deepest unique hierarchy we + // Implement EXPAND_SPECIAL_FOR_CD_AUTOSUGGEST by descending the deepest unique + // hierarchy we // can, and then appending any components to each new result. // Only descend deepest unique for cd autosuggest and not for cd tab completion // (issue #4402). - if (flags & EXPAND_SPECIAL_FOR_CD && flags & EXPAND_SPECIAL_FOR_CD_AUTOSUGGEST) { + if (flags & EXPAND_SPECIAL_FOR_CD_AUTOSUGGEST) { wcstring unique_hierarchy = this->descend_unique_hierarchy(abs_path); if (!unique_hierarchy.empty()) { for (size_t i = before; i < after; i++) {