summaryrefslogtreecommitdiff
path: root/src/command_manager.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2011-09-14 15:41:56 +0000
committerMaxime Coste <frrrwww@gmail.com>2011-09-14 15:41:56 +0000
commitb59ad6a174b49a049fd6789cbeb54dc40fd85fa1 (patch)
tree71c8a6c43696e080cc3bcfbe68c89e2516b24c69 /src/command_manager.cc
parent4b38cd3cd0131b2ab276310cc234ab666bd99363 (diff)
Completion: dedicated completion header and basic filename completion
Diffstat (limited to 'src/command_manager.cc')
-rw-r--r--src/command_manager.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/command_manager.cc b/src/command_manager.cc
index d62fbdc2..26751db4 100644
--- a/src/command_manager.cc
+++ b/src/command_manager.cc
@@ -96,6 +96,13 @@ Completions CommandManager::complete(const std::string& command_line, size_t cur
return result;
}
+ if (token_to_complete == 1) // filename completion
+ {
+ Completions result(tokens[1].first, cursor_pos);
+ std::string prefix = command_line.substr(tokens[1].first, cursor_pos);
+ result.candidates = complete_filename(prefix);
+ return result;
+ }
return Completions(cursor_pos, cursor_pos);
}