Offer "--" as completion when completing switches
The next commit will give switch completions the menu behavior, so this is necessary so we can still type "echo --" without an auto-expansion to "echo -to-file".
This commit is contained in:
parent
1358fc3cef
commit
ba557e90a2
|
@ -766,8 +766,9 @@ Completions CommandManager::complete(const Context& context,
|
||||||
if (is_switch(token.content))
|
if (is_switch(token.content))
|
||||||
{
|
{
|
||||||
auto switches = Kakoune::complete(token.content.substr(1_byte), pos_in_token,
|
auto switches = Kakoune::complete(token.content.substr(1_byte), pos_in_token,
|
||||||
command.param_desc.switches |
|
concatenated(command.param_desc.switches
|
||||||
transform(&SwitchMap::Item::key));
|
| transform(&SwitchMap::Item::key),
|
||||||
|
ConstArrayView<String>{"-"}));
|
||||||
return switches.empty() ? Completions{} : Completions{start+1, cursor_pos, std::move(switches)};
|
return switches.empty() ? Completions{} : Completions{start+1, cursor_pos, std::move(switches)};
|
||||||
}
|
}
|
||||||
if (not command.completer)
|
if (not command.completer)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user