Do not complete redundant switches
This commit is contained in:
parent
64d4d29d43
commit
9e0502a1ca
|
@ -821,7 +821,10 @@ Completions CommandManager::complete(const Context& context,
|
||||||
{
|
{
|
||||||
auto switches = Kakoune::complete(token.content.substr(1_byte), pos_in_token,
|
auto switches = Kakoune::complete(token.content.substr(1_byte), pos_in_token,
|
||||||
concatenated(command.param_desc.switches
|
concatenated(command.param_desc.switches
|
||||||
| transform(&SwitchMap::Item::key),
|
| transform(&SwitchMap::Item::key)
|
||||||
|
| filter([&](const auto& key) {
|
||||||
|
return not parser.get_switch(key);
|
||||||
|
}),
|
||||||
ConstArrayView<String>{"-"}));
|
ConstArrayView<String>{"-"}));
|
||||||
return switches.empty()
|
return switches.empty()
|
||||||
? Completions{}
|
? Completions{}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user