Do not change the insert completion menu when a candidate is selected
This commit is contained in:
parent
0ae628fde7
commit
09e2a0b6ac
|
@ -394,17 +394,21 @@ void InsertCompleter::menu_show()
|
||||||
|
|
||||||
void InsertCompleter::on_option_changed(const Option& opt)
|
void InsertCompleter::on_option_changed(const Option& opt)
|
||||||
{
|
{
|
||||||
|
// Do not reset the menu if the user has selected an entry
|
||||||
|
if (not m_matching_candidates.empty() and
|
||||||
|
m_current_candidate != m_matching_candidates.size() - 1)
|
||||||
|
return;
|
||||||
|
|
||||||
auto& completers = m_options["completers"].get<InsertCompleterDescList>();
|
auto& completers = m_options["completers"].get<InsertCompleterDescList>();
|
||||||
Vector<StringView> option_names;
|
|
||||||
for (auto& completer : completers)
|
for (auto& completer : completers)
|
||||||
{
|
{
|
||||||
if (completer.mode == InsertCompleterDesc::Option)
|
if (completer.mode == InsertCompleterDesc::Option and
|
||||||
option_names.emplace_back(*completer.param);
|
*completer.param == opt.name())
|
||||||
}
|
{
|
||||||
if (contains(option_names, opt.name()))
|
reset();
|
||||||
{
|
setup_ifn();
|
||||||
reset();
|
break;
|
||||||
setup_ifn();
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user