summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2024-04-19 15:36:23 +1000
committerMaxime Coste <mawww@kakoune.org>2024-04-19 15:36:23 +1000
commitb4fbfba24606159eb6f83c43a05a203d2d9135e2 (patch)
tree4c251813606498e7fff2c4cec082150eef65cb95 /src
parent3d7d0fecca885b00a7ae80180ea1841fab2c5993 (diff)
Complete complete-command completer type
Diffstat (limited to 'src')
-rw-r--r--src/commands.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/commands.cc b/src/commands.cc
index f217a9fa..cea69dd0 100644
--- a/src/commands.cc
+++ b/src/commands.cc
@@ -1268,6 +1268,14 @@ Vector<String> params_to_shell(const ParametersParser& parser)
return vars;
}
+Completions complete_completer_type(const Context&, CompletionFlags,
+ StringView prefix, ByteCount cursor_pos)
+{
+ static constexpr StringView completers[] = {"file", "client", "buffer", "shell-script", "shell-script-candidates", "command", "shell"};
+ return { 0_byte, cursor_pos, complete(prefix, cursor_pos, completers) };
+}
+
+
CommandCompleter make_command_completer(StringView type, StringView param, Completions::Flags completions_flags)
{
if (type == "file")
@@ -1494,7 +1502,7 @@ const CommandDesc complete_command_cmd = {
ParameterDesc::Flags::None, 2, 3},
CommandFlags::None,
CommandHelper{},
- make_completer(complete_command_name),
+ make_completer(complete_command_name, complete_completer_type),
[](const ParametersParser& parser, Context& context, const ShellContext&)
{
const Completions::Flags flags = parser.get_switch("menu") ? Completions::Flags::Menu : Completions::Flags::None;