From e28423301379ac683f0bdc0a367c888c039ad597 Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Wed, 18 Jul 2012 19:48:19 +0530 Subject: [PATCH] Don't add space at the end of tab completion for cd Fix for https://github.com/fish-shell/fish-shell/issues/235 --- complete.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/complete.cpp b/complete.cpp index 4e4d9fc4e..66b45f078 100644 --- a/complete.cpp +++ b/complete.cpp @@ -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)