Fix overzealous cd tab completion

Changed cd completion to differentiate between cd autosuggest and cd tab
completion. cd autosuggest will find deepest unique hierarchy and cd tab
completion will not.

Issue #4402
This commit is contained in:
Matthew Brock
2018-01-08 16:36:20 -05:00
committed by ridiculousfish
parent faa17ec849
commit bf63e061c9
4 changed files with 48 additions and 2 deletions

View File

@@ -1031,6 +1031,9 @@ void completer_t::complete_param_expand(const wcstring &str, bool do_file,
if (!do_file) flags |= EXPAND_SKIP_WILDCARDS;
if (handle_as_special_cd && do_file) {
if (this->type() == COMPLETE_AUTOSUGGEST) {
flags |= EXPAND_SPECIAL_FOR_CD_AUTOSUGGEST;
}
flags |= DIRECTORIES_ONLY | EXPAND_SPECIAL_FOR_CD | EXPAND_NO_DESCRIPTIONS;
}