diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-03-13 13:52:23 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-03-13 13:52:23 +0000 |
| commit | 09e2a0b6ac1f3e1b295380ef5af23d370ccf5d53 (patch) | |
| tree | 44c433df1b54190cb4c9da72c4f02859f35605db /src | |
| parent | 0ae628fde7d117bc5768ad2a95eddd8babd02ccf (diff) | |
Do not change the insert completion menu when a candidate is selected
Diffstat (limited to 'src')
| -rw-r--r-- | src/insert_completer.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/insert_completer.cc b/src/insert_completer.cc index 5d76023d..2207464a 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -394,17 +394,21 @@ void InsertCompleter::menu_show() 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>(); - Vector<StringView> option_names; for (auto& completer : completers) { - if (completer.mode == InsertCompleterDesc::Option) - option_names.emplace_back(*completer.param); - } - if (contains(option_names, opt.name())) - { - reset(); - setup_ifn(); + if (completer.mode == InsertCompleterDesc::Option and + *completer.param == opt.name()) + { + reset(); + setup_ifn(); + break; + } } } |
