Fix for failing to properly complete cd command

This commit is contained in:
ridiculousfish 2012-05-05 14:21:21 -07:00
parent 47019e315a
commit 07f5319472
2 changed files with 11 additions and 3 deletions

View file

@ -277,6 +277,8 @@ class completer_t {
void complete_param_expand(const wcstring &str, bool do_file);
void debug_print_completions();
void complete_cmd( const wcstring &str,
bool use_function,
bool use_builtin,
@ -1522,8 +1524,14 @@ void completer_t::complete_param_expand( const wcstring &sstr, bool do_file)
flags | this->expand_flags() ) == EXPAND_ERROR )
{
debug( 3, L"Error while expanding string '%ls'", comp_str );
}
}
}
void completer_t::debug_print_completions()
{
for (size_t i=0; i < completions.size(); i++) {
printf("- Completion: %ls\n", completions.at(i).completion.c_str());
}
}
/**

View file

@ -767,7 +767,7 @@ int parser_t::eval_args( const wchar_t *line, std::vector<completion_t> &args )
expand_flags_t eflags = 0;
if (! show_errors)
eflags |= EXPAND_NO_DESCRIPTIONS;
if (this->parser_type != PARSER_TYPE_GENERAL)
if (this->parser_type != PARSER_TYPE_GENERAL && this->parser_type != PARSER_TYPE_COMPLETIONS_ONLY)
eflags |= EXPAND_SKIP_CMDSUBST;
/*