diff options
author | Siteshwar Vashisht <siteshwar@gmail.com> | 2012-07-18 19:48:19 +0530 |
---|---|---|
committer | Siteshwar Vashisht <siteshwar@gmail.com> | 2012-07-18 19:48:19 +0530 |
commit | e28423301379ac683f0bdc0a367c888c039ad597 (patch) | |
tree | 898911084b3a0daeef6a4dc86ff8a5e251623c2d /complete.cpp | |
parent | d06d6c69645c4d355772cb19043469328c05ccc5 (diff) |
Don't add space at the end of tab completion for cd
Diffstat (limited to 'complete.cpp')
-rw-r--r-- | complete.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/complete.cpp b/complete.cpp index 4e4d9fc4..66b45f07 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) |