From 364914afbd3da050d021dceee02d4c89e78b9d52 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 18 Oct 2015 17:51:13 +0100 Subject: [PATCH] Do not filter completions in InsertCompleter anymore Just rerun the actual completers --- src/insert_completer.cc | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/src/insert_completer.cc b/src/insert_completer.cc index 8a9779a0..f81c47c3 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -350,41 +350,6 @@ void InsertCompleter::select(int offset, Vector& keystrokes) void InsertCompleter::update() { - if (m_completions.is_valid()) - { - ByteCount longest_completion = 0; - for (auto& candidate : m_completions.candidates) - longest_completion = std::max(longest_completion, candidate.completion.length()); - - ByteCoord cursor = m_context.selections().main().cursor(); - ByteCoord compl_beg = m_completions.begin; - if (cursor.line == compl_beg.line and - compl_beg.column <= cursor.column and - cursor.column < compl_beg.column + longest_completion) - { - String prefix = m_context.buffer().string(compl_beg, cursor); - - if (m_context.buffer().timestamp() == m_completions.timestamp) - m_matching_candidates = m_completions.candidates; - else - { - m_matching_candidates.clear(); - for (auto& candidate : m_completions.candidates) - { - if (candidate.completion.substr(0, prefix.length()) == prefix) - m_matching_candidates.push_back(candidate); - } - } - if (not m_matching_candidates.empty()) - { - m_current_candidate = m_matching_candidates.size(); - m_completions.end = cursor; - menu_show(); - m_matching_candidates.push_back({prefix, ""}); - return; - } - } - } reset(); setup_ifn(); }