Complete to take a pointer to output completions, not a mutable ref

This commit is contained in:
ridiculousfish
2016-02-06 19:17:43 -08:00
parent 31bc88d16f
commit c39b94949b
7 changed files with 64 additions and 36 deletions

View File

@@ -1506,7 +1506,7 @@ struct autosuggestion_context_t
/* Try normal completions */
std::vector<completion_t> completions;
complete(search_string, completions, COMPLETION_REQUEST_AUTOSUGGESTION);
complete(search_string, &completions, COMPLETION_REQUEST_AUTOSUGGESTION);
completions_sort_and_prioritize(&completions);
if (! completions.empty())
{
@@ -3324,7 +3324,7 @@ const wchar_t *reader_readline(int nchars)
const wcstring buffcpy = wcstring(cmdsub_begin, token_end);
//fprintf(stderr, "Complete (%ls)\n", buffcpy.c_str());
data->complete_func(buffcpy, comp, COMPLETION_REQUEST_DEFAULT | COMPLETION_REQUEST_DESCRIPTIONS | COMPLETION_REQUEST_FUZZY_MATCH);
data->complete_func(buffcpy, &comp, COMPLETION_REQUEST_DEFAULT | COMPLETION_REQUEST_DESCRIPTIONS | COMPLETION_REQUEST_FUZZY_MATCH);
/* Munge our completions */
completions_sort_and_prioritize(&comp);