From 30ad9a04759bc85931446cd8f4594ea71db22985 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 6 Sep 2015 18:09:32 +0100 Subject: Complete aliases in command prompt --- src/command_manager.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/command_manager.cc') diff --git a/src/command_manager.cc b/src/command_manager.cc index e626ed6c..5d5920a2 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -567,9 +567,14 @@ Completions CommandManager::complete(const Context& context, { if (command.second.flags & CommandFlags::Hidden) continue; - if ( prefix_match(command.first, prefix)) + if (prefix_match(command.first, prefix)) result.candidates.push_back(command.first); } + for (auto& alias : context.aliases()) + { + if (prefix_match(alias.first, prefix)) + result.candidates.push_back(alias.first); + } std::sort(result.candidates.begin(), result.candidates.end()); return result; } -- cgit v1.2.3