aboutsummaryrefslogtreecommitdiffhomepage
path: root/complete.cpp
diff options
context:
space:
mode:
authorGravatar Konrad Borowski <glitchmr@myopera.com>2013-10-01 08:29:40 +0200
committerGravatar Konrad Borowski <glitchmr@myopera.com>2013-10-01 08:29:40 +0200
commita62ebc9a69ac57f74b9bcaa52813eaefd79aede2 (patch)
tree3c2d31a8cf5287940ffddbce4967de9f0afb79dc /complete.cpp
parent6c82e7acda212c7de5e0e8c46d4ba5f1b12fc061 (diff)
Restore directories' tab completion without slash in command.
This is needed for implicit cd when ending command with `/`.
Diffstat (limited to 'complete.cpp')
-rw-r--r--complete.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/complete.cpp b/complete.cpp
index 6f5da9ec..8df02b35 100644
--- a/complete.cpp
+++ b/complete.cpp
@@ -1141,22 +1141,18 @@ void completer_t::complete_cmd(const wcstring &str_cmd, bool use_function, bool
if (cdpath.missing_or_empty())
cdpath = L".";
- if (str_cmd.find(L'/') != wcstring::npos || str_cmd.at(0) == L'~')
+ if (use_command)
{
- if (use_command)
+ if (expand_string(str_cmd, this->completions, ACCEPT_INCOMPLETE | EXECUTABLES_ONLY | this->expand_flags()) != EXPAND_ERROR)
{
-
- if (expand_string(str_cmd, this->completions, ACCEPT_INCOMPLETE | EXECUTABLES_ONLY | this->expand_flags()) != EXPAND_ERROR)
+ if (this->wants_descriptions())
{
- if (this->wants_descriptions())
- {
- this->complete_cmd_desc(str_cmd);
- }
+ this->complete_cmd_desc(str_cmd);
}
}
}
- else
+ if (str_cmd.find(L'/') == wcstring::npos && str_cmd.at(0) != L'~')
{
if (use_command)
{