Don't add space at the end of tab completion for cd

Fix for https://github.com/fish-shell/fish-shell/issues/235
This commit is contained in:
Siteshwar Vashisht 2012-07-18 19:48:19 +05:30
parent d06d6c6964
commit e284233013

View File

@ -254,6 +254,14 @@ const wcstring &completion_entry_t::get_short_opt_str() const {
/* completion_t functions */
completion_t::completion_t(const wcstring &comp, const wcstring &desc, int flags_val) : completion(comp), description(desc), flags(flags_val)
{
if( flags & COMPLETE_AUTO_SPACE )
{
flags = flags & ~COMPLETE_AUTO_SPACE;
size_t len = completion.size();
if (len > 0 && ( wcschr( L"/=@:", comp.at(len-1)) != 0 ))
flags |= COMPLETE_NO_SPACE;
}
}
completion_t::completion_t(const completion_t &him) : completion(him.completion), description(him.description), flags(him.flags)