From 78419bc76f833b493b700bf3262c52fd93544744 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 15 Apr 2019 17:58:37 +0200 Subject: [PATCH] Remove InsertCompletionSelect hook --- doc/pages/hooks.asciidoc | 5 ----- src/hook_manager.hh | 4 +--- src/insert_completer.cc | 6 ------ 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/doc/pages/hooks.asciidoc b/doc/pages/hooks.asciidoc index 21e71d3d..163b2fdd 100644 --- a/doc/pages/hooks.asciidoc +++ b/doc/pages/hooks.asciidoc @@ -173,11 +173,6 @@ name. Hooks with no description will always use an empty string. Triggered when the insert completion menu gets hidden, the inserted completion text is passed as filtering text. -*InsertCompletionSelect* `selected completion`:: - Triggered when an entry is selected in the insert completion - menu. The filtering text is the selected completion text or - the empty string if the original text was selected back - *RawKey* `key`:: Triggered whenever a key is pressed by the user diff --git a/src/hook_manager.hh b/src/hook_manager.hh index 1653791c..909d24bc 100644 --- a/src/hook_manager.hh +++ b/src/hook_manager.hh @@ -39,7 +39,6 @@ enum class Hook InsertMove, InsertCompletionHide, InsertCompletionShow, - InsertCompletionSelect, KakBegin, KakEnd, FocusIn, @@ -62,7 +61,7 @@ enum class Hook constexpr auto enum_desc(Meta::Type) { - return make_array, 41>({ + return make_array, 40>({ {Hook::BufCreate, "BufCreate"}, {Hook::BufNewFile, "BufNewFile"}, {Hook::BufOpenFile, "BufOpenFile"}, @@ -85,7 +84,6 @@ constexpr auto enum_desc(Meta::Type) {Hook::InsertMove, "InsertMove"}, {Hook::InsertCompletionHide, "InsertCompletionHide"}, {Hook::InsertCompletionShow, "InsertCompletionShow"}, - {Hook::InsertCompletionSelect, "InsertCompletionSelect"}, {Hook::KakBegin, "KakBegin"}, {Hook::KakEnd, "KakEnd"}, {Hook::FocusIn, "FocusIn"}, diff --git a/src/insert_completer.cc b/src/insert_completer.cc index 3e44d325..5c1e9468 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -447,12 +447,6 @@ void InsertCompleter::select(int index, bool relative, Vector& keystrokes) for (auto& c : candidate.completion) keystrokes.emplace_back(c); - if (m_context.has_client()) - { - const auto param = (m_current_candidate == m_completions.candidates.size() - 1) ? - StringView{} : candidate.completion; - m_context.hooks().run_hook(Hook::InsertCompletionSelect, param, m_context); - } if (not candidate.on_select.empty()) CommandManager::instance().execute(candidate.on_select, m_context); }