summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 6edc61b5..2f67953b 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -127,13 +127,15 @@ public:
{
if (m_hooks_disabled)
do_restore_hooks = true;
- auto it = keymap.find(key);
- if (it != keymap.end())
+ auto it = std::lower_bound(keymap.begin(), keymap.end(), key,
+ [](const NormalCmdDesc& lhs, const Key& rhs)
+ { return lhs.key < rhs; });
+ if (it != keymap.end() and it->key == key)
{
if (context().options()["autoinfo"].get<int>() >= 2 and context().has_ui())
- context().ui().info_show(key_to_str(key), it->second.docstring, CharCoord{},
+ context().ui().info_show(key_to_str(key), it->docstring, CharCoord{},
get_face("Information"), InfoStyle::Prompt);
- it->second.func(context(), m_params);
+ it->func(context(), m_params);
}
m_params = { 0, '"' };
}