Properly handle empty completions (e.g. tab-complete 'foo' with extant files 'foo' and 'foobar' should offer both)

Fixes issue described in https://github.com/fish-shell/fish-shell/issues/290
This commit is contained in:
ridiculousfish
2012-08-20 13:09:21 -07:00
parent 3606664cf7
commit 670e33ab27
2 changed files with 23 additions and 41 deletions

View File

@@ -250,13 +250,8 @@ static bool wildcard_complete_internal(const wcstring &orig,
}
if (! out_completion.empty())
{
append_completion( out,
out_completion,
out_desc,
flags );
}
/* Note: out_completion may be empty if the completion really is empty, e.g. tab-completing 'foo' when a file 'foo' exists. */
append_completion(out, out_completion, out_desc, flags);
return true;
}
@@ -1073,7 +1068,7 @@ int wildcard_expand( const wchar_t *wc,
std::set<file_id_t> visited_files;
int res = wildcard_expand_internal( wc, base_dir, flags, out, completion_set, visited_files );
if( flags & ACCEPT_INCOMPLETE )
{
wcstring wc_base;