Skip to content

Commit

Permalink
Remove InsertCompletionSelect hook
Browse files Browse the repository at this point in the history
  • Loading branch information
mawww committed Apr 17, 2019
1 parent 9118a18 commit 78419bc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
5 changes: 0 additions & 5 deletions doc/pages/hooks.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions src/hook_manager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ enum class Hook
InsertMove,
InsertCompletionHide,
InsertCompletionShow,
InsertCompletionSelect,
KakBegin,
KakEnd,
FocusIn,
Expand All @@ -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"},
Expand All @@ -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"},
Expand Down
6 changes: 0 additions & 6 deletions src/insert_completer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 78419bc

Please sign in to comment.