diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2015-10-03 15:44:57 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2015-10-03 15:44:57 -0700 |
commit | aeaacedf75a99b06a93d8fe873ed7a795ed4f3dd (patch) | |
tree | eab60340f13ace98b5dfe9745b87d56edb2fba60 /src/complete.cpp | |
parent | bec6d5c174f103085a5c5b53fcbe3db5a9de1193 (diff) |
Don't do intermediate fuzzy directory matching with $PATH
When expanding an executable with $PATH, don't attempt to
interpret the directories in PATH as fuzzy matching. Fixes #2413.
Diffstat (limited to 'src/complete.cpp')
-rw-r--r-- | src/complete.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/complete.cpp b/src/complete.cpp index ae9d2ef3..3d79de04 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -1147,11 +1147,12 @@ void completer_t::complete_cmd(const wcstring &str_cmd, bool use_function, bool nxt_completion.append(str_cmd); size_t prev_count = this->completions.size(); + expand_flags_t expand_flags = EXPAND_FOR_COMPLETIONS | EXECUTABLES_ONLY | EXPAND_NO_FUZZY_DIRECTORIES | this->expand_flags(); if (expand_string(nxt_completion, &this->completions, - EXPAND_FOR_COMPLETIONS | EXECUTABLES_ONLY | this->expand_flags(), NULL) != EXPAND_ERROR) + expand_flags, NULL) != EXPAND_ERROR) { - /* For all new completions, if COMPLETE_NO_CASE is set, then use only the last path component */ + /* For all new completions, if COMPLETE_REPLACES_TOKEN is set, then use only the last path component */ for (size_t i=prev_count; i< this->completions.size(); i++) { completion_t &c = this->completions.at(i); |