summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-03-16 23:40:38 +0000
committerMaxime Coste <mawww@kakoune.org>2017-03-16 23:40:38 +0000
commit8b1078e51029850ea4610cee75a8c81a8e5afbba (patch)
treec2f76bfc29ba79f498d52757d05d8ed39e3c8e0b /src/input_handler.cc
parente44f95820ee182460bee2e7569ab4ecb1d444112 (diff)
Use a HashMap to store the normal mode keymap
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc
index 4f921a8a..b25e4174 100644
--- a/src/input_handler.cc
+++ b/src/input_handler.cc
@@ -258,21 +258,19 @@ public:
context().client().info_hide();
do_restore_hooks = true;
- auto it = std::lower_bound(keymap.begin(), keymap.end(), key,
- [](const NormalCmdDesc& lhs, const Key& rhs)
- { return lhs.key < rhs; });
+ auto it = keymap.find(key);
if (it != keymap.end() and it->key == key)
{
auto autoinfo = context().options()["autoinfo"].get<AutoInfo>();
if (autoinfo & AutoInfo::Normal and context().has_client())
- context().client().info_show(key_to_str(key), it->docstring.str(),
+ context().client().info_show(key_to_str(key), it->value.docstring.str(),
{}, InfoStyle::Prompt);
// reset m_params now to be reentrant
NormalParams params = m_params;
m_params = { 0, 0 };
- it->func(context(), params);
+ it->value.func(context(), params);
}
}