Remove InsertCompletionSelect hook

This commit is contained in:
Maxime Coste 2019-04-15 17:58:37 +02:00
parent 9118a18d5d
commit 78419bc76f
3 changed files with 1 additions and 14 deletions

View File

@ -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

View File

@ -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<Hook>)
{
return make_array<EnumDesc<Hook>, 41>({
return make_array<EnumDesc<Hook>, 40>({
{Hook::BufCreate, "BufCreate"},
{Hook::BufNewFile, "BufNewFile"},
{Hook::BufOpenFile, "BufOpenFile"},
@ -85,7 +84,6 @@ constexpr auto enum_desc(Meta::Type<Hook>)
{Hook::InsertMove, "InsertMove"},
{Hook::InsertCompletionHide, "InsertCompletionHide"},
{Hook::InsertCompletionShow, "InsertCompletionShow"},
{Hook::InsertCompletionSelect, "InsertCompletionSelect"},
{Hook::KakBegin, "KakBegin"},
{Hook::KakEnd, "KakEnd"},
{Hook::FocusIn, "FocusIn"},

View File

@ -447,12 +447,6 @@ void InsertCompleter::select(int index, bool relative, Vector<Key>& 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);
}